Wednesday, March 30, 2011

Can one Android app have more than one icon in app launcher?

Why not! Just add this to your favorite AndroidManifest.xml:



<application>
<activity android:name="AActivity" android:icon="@drawable/a_icon" android:launchMode="singleTask"
android:screenOrientation="portrait"
android:label="@string/a_name" android:theme="@android:style/Theme.Translucent.NoTitleBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="BActivity" android:icon="@drawable/b_icon" android:launchMode="singleTask"
android:screenOrientation="portrait"
android:label="@string/b_name" android:theme="@android:style/Theme.Translucent.NoTitleBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="CActivity" android:icon="@drawable/c_icon" android:launchMode="singleTask"
android:screenOrientation="portrait"
android:label="@string/c_name" android:theme="@android:style/Theme.Translucent.NoTitleBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity></application>

and that's it. You'll get s single app with three different app icons: a_icon, b_icon, c_icon.



Some useful tools for Android shell

ps | grep "launcher" will look for all processes running on Android that have launcher in their name
pm path com.android.launcher will show where the process binary lives

Monday, March 28, 2011

ADB: error: insufficient permissions for device

Needs: 


adb kill-server 
sudo adb start-server
adb devices

to work

Thursday, March 24, 2011

Return in Java class constructor

I have never seen that before but looking at Android source tree found something like that:

class A {
    A(String arg){
    if (arg == null){
        return;
    }
  }
}

Tuesday, March 22, 2011

Android default wallpaper location

In system/frameworks/base/core/res/res/drawable/default_wallpaper.jpg

The rest of the wallpapers are in system/packages/apps/Launcher2/res/drawable-hdpi/wallpaper_ ...

Sunday, March 20, 2011

True

THE JOB DESCRIPTION GUIDE:
  • "Fast-paced" = we change our minds alot, shut up.
  • "Self-starter" = oops, last guy left quickly.
  • "Team-player" = our boss takes the credit.
  • "Good communicator" = you're the asshole we'll have talk to clients.
  • "Knowledge of HTML" = recruiter is 700 years old and thinks this is difficult.
  • "Benefits include health insurance and 401k" = we don't pay much, so this had to be in the ad.
  • "Flexible work schedule" = better enjoy unpaid OT, dickface.
  • "Java or C++" = we don't know what the fuck we're doing...
  • "Java or C++ or .NET" = ...maybe you know?
  • "Cutting edge technology" = we've upgraded to XP SP3.
  • "Bachelors in CS/IT or technical discipline or equivalent experience" = we used to hire people right out of high school, until the incident.

    Taken from here

Saturday, March 19, 2011

Remove Android application from app launcher

Just remove this:



<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
intent-filter>

from AndroidManifest.xml