13

i want to learn custom android launcher,i donot know how to start,can you give me some advice,some blog link or other example and so on.

John Riselvato
  • 12,854
  • 5
  • 62
  • 89
pengwang
  • 19,536
  • 34
  • 119
  • 168

3 Answers3

29

Your best bet is to start by looking at the sample launcher provided by Google. You can find that in SDK folder:

[Android-SDK]/samples/android-x/Home/

(where x is API level).

They have provided source code for an example home screen and it should give you a good start.

The next thing I would recommend is actually browsing the source of the default android launcher at the open source repo. You will need git to pull that down and you can find there here.

Read about using the AOSP here.

sgarman
  • 6,152
  • 5
  • 40
  • 44
  • 1
    thank you for your answer,can you give some custom launcher example – pengwang May 07 '11 at 04:59
  • 2
    Please see the first link I provided. It contains the source code to a launcher example. – sgarman May 07 '11 at 05:24
  • 3
    Explore the Default Android Launcher Source Code: https://android.googlesource.com/platform/packages/apps/Launcher2.git – TouchBoarder Jan 03 '13 at 09:51
  • @hsigmond can you please tell me that where I can find the explanation of launcher2. I seriously need a wiki documentation of whats happening in the code – Cyph3rCod3r Dec 02 '14 at 15:38
  • @Dr.aNdRO don't know about any place there is an explanation of what is happening in the code for the Launcher? would be great, but I'm afraid the comments in the code is the only documentation. If you find anything? please share it. – TouchBoarder Dec 03 '14 at 08:13
  • @hsigmond mahn I am still searching for it. I have to work on a launcher and the code is really messy annd no documentations as well – Cyph3rCod3r Dec 03 '14 at 09:15
0

here is source code of android 4.4 launcher3

You can easily compile the code in android studio;If you want to compile in Eclipse,just see the git tag GOODBYE_ECLIPSE,use the command in git git checkout tags/[the_tag_name]

Remember this code may crash in android L or above,and the minSDK=16.

Hope to help you to know the android launcher:)

Community
  • 1
  • 1
Zero
  • 1,142
  • 13
  • 10
  • Note that [link-only answers](http://meta.stackoverflow.com/tags/link-only-answers/info) are discouraged, SO answers should be the end-point of a search for a solution (vs. yet another stopover of references, which tend to get stale over time). Please consider adding a stand-alone synopsis here, keeping the link as a reference. – kleopatra Sep 09 '15 at 08:56
0

I recently answered a related question. That may be helpful.


Getting started with creating a launcher:

1 - First step

Putting this (as an intent-filter) into your AndroidManifest.xml will enable you to use the app as a launcher:

<category android:name="android.intent.category.HOME" />

2 - Considerations

Creating a launcher that will be used by other people is a big responsibility, as it will run permanently. You need to understand the Activity Livecycle (if you don't, there will be issues with running the program for hours/ days).

Make sure to catch every possible exception and there are no crashes.

3 - Features to learn about and implement

  • An app drawer / a list of all installed programs (you will need to list the apps asynchronously for performance reasons.
  • Settings to select the default launcher (see how). This is a smart thing to implement so that your users don't get stuck in your launcher (which happened before ^^).

Resources:

finnmglas
  • 1,626
  • 4
  • 22
  • 37