How to make a launcher

I have been developing for quite some time, and now I'm trying to create an application that will replace the original home (for example, HTC).

I need to open the application when the user presses the home button on his phone.

So basically it's a replacement for the house.

Does anyone know how to do this?

+58
android launcher
Jan 30 '11 at 7:18
source share
5 answers

Just create a regular application, and then add a couple of lines to the application manifest file.

First you need to add the following attribute to your activity:

android:launchMode="singleTask" 

Then add two categories to the intent filter:

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

The result might look something like this:

  <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.dummy.app" android:versionCode="1" android:versionName="1.0" > <uses-sdk android:minSdkVersion="11" android:targetSdkVersion="19" /> <application android:allowBackup="true" android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:theme="@style/AppTheme" > <activity android:name="com.dummy.app.MainActivity" android:launchMode="singleTask" android:label="@string/app_name" > <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> <category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.HOME" /> </intent-filter> </activity> </application> </manifest> 

It's simple!

+66
Mar 02 '14 at 11:00
source share

You can check the source code of Launcher and Launcher2 , which is used in Android.

+19
Jan 30 '11 at 7:27
source share

These are examples provided by the Android team, if you have already downloaded the samples, you can import the sample to replace the original screen by following these steps.

File> New> Other> Android> Android Sample Project> Android xx> Home> Done

But if you do not have uploaded samples, download them using the steps below.

Windows> Android SDK Manager> selects the "Sample for SDK" for the SDK you need> Install the package> Accept the license> Install

+14
Jul 18 '13 at 13:34 on
source share

I found this quite useful. He described every step every step. You may want to follow this http://taywils.me/2011/07/05/buildanapplicationlauncherwithandroid/

+3
Dec 24 '13 at 19:48
source share

Here's the source code for Launcher3 (AOSP launcher) used by KitKat (and probably candy):

https://android.googlesource.com/platform/packages/apps/Launcher3/+/master

If you see a new launcher from AOSP, just replace 3 with a URL with a newer version.

+2
Mar 06 '15 at 10:04
source share



All Articles