49

How do I create a home-screen replacement application? Is there any information about the home-screen application available?

Can any application be a home-screen by just registering it with a CATEGORY_HOME intent?

Octavian Helm
  • 39,405
  • 19
  • 98
  • 102
Simon
  • 13,173
  • 14
  • 66
  • 90

2 Answers2

42

Writing your own home screen application is possible. It is called the Launcher.

You can get the source code of the default Android Launcher via Git.

The project URL is:

https://android.googlesource.com/platform/packages/apps/Launcher2.git

You can get the source code like this:

git clone https://android.googlesource.com/platform/packages/apps/Launcher2.git

That will create a directory called Launcher2 for you. Now you can get cracking and create your custom launcher.

If you need help with using Git then checkout Git's documentation section.

Octavian Helm
  • 39,405
  • 19
  • 98
  • 102
  • 18
    Don't forget to take a look at the source code of ADW Launcher as well: http://code.google.com/p/adw-launcher-android/ – benvd Sep 08 '10 at 10:41
  • This question specifically asks if an app could register for a specific intent - if it's complex, I can understand the sample code, but how complex can it be? Can someone just describe the intent and its requirements? – Kenzi Oct 08 '12 at 14:07
  • Which obviously makes my answer wrong. Makes sense. How about checking out the code and finding out? – Octavian Helm Oct 08 '12 at 14:08
36

The specific Intent to make your activity the Home screen is:

<activity....>
<!-- Put this filter inside the activity to make it the Home screen -->
    <intent-filter>
        <action android:name="android.intent.action.MAIN" />
        <category android:name="android.intent.category.HOME" />
        <category android:name="android.intent.category.DEFAULT" />
    </intent-filter>
</activity>
Ena
  • 3,481
  • 36
  • 34