Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use customized screen instead of default start screen in Android?

Tags:

android

I 'am making an enterprise app, the user should be able to use only those applications which i provide him. My idea is overriding the default start screen with my custom layout with the app icons, of only those apps which i provide to the user. I will disable home, menu back and search buttons in the starting screen. Even if the user presses home button he should be redirected to my custom screen which contains icons.

I have seen an application which has achieved this without rooting the device. Here is the link for that app.

I just want to know how should i send the starting screen into background and my custom layout into foreground.

like image 526
Anirudh Avatar asked Jan 23 '13 06:01

Anirudh


3 Answers

Your app seems like a custom launcher (but with restrictives permissions). So you can define your app as a launcher, to do that you can add this in the manifest :

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

Then you have to implements a method to get back to the real launcher.

like image 195
Goo Avatar answered Oct 23 '22 23:10

Goo


I 'am making an enterprise app, the user should be able to use only those applications which i provide him.

That needs to be a custom ROM.

I just want to know how should i send the starting screen into background and my custom layout into foreground.

Make your app be the home screen. There is an SDK sample available that shows how to create a home screen.

like image 25
CommonsWare Avatar answered Oct 23 '22 22:10

CommonsWare


Q: How should I send the starting screen into background and my custom layout into foreground ?
A: Using BroadCastReceiver, you can achieve this through intent filter : android.intent.action.BOOT_COMPLETED

But, I am very curious to know, how did you override home key press functionality.

like image 25
Manjunath Avatar answered Oct 23 '22 22:10

Manjunath