Android lock home key press - android

I know it is not possible to lock/detect/disable the home key in Android device.
I am using the following code which shows "Complete action using" dialog:
<category android:name="android.intent.category.HOME"/>
<category android:name="android.intent.category.DEFAULT" />
By checking on "Use by default for this application"and selecting my application, it becomes the home screen app for every time user presses "Home". Upto this it was OK but when user updates the application from market this setting is cleared.
How can I retain this setting even after application update from market?

Related

Hide settings app icon in dropdown menu [duplicate]

I'm making an application that should be used in a store that displays product information. I use an Android tablet to provide the customer with some interactive information. The user should not be able to do anything else with the tablet.
So far i managed to disable the back and home button. The application starts when the booting of the device has finished. He can therefore not start any other application when he restarts the device (I was not able to prevent the user from restarting the device).
The problem is, that the customer can open the settings menu and force kill my application.
Is there a way to either disable the settings menu (e.g. by protecting it with a password) or to override it by my application?
I do not plan to add my application to the Android market since it should only run in the stores.
I found out how to override the settings menu.
Since the settings menu is opened via an implicit Intent I just need to add the right intent filters my activity:
<intent-filter >
<action android:name="android.settings.SETTINGS" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<intent-filter >
<action android:name="android.settings.WIRELESS_SETTINGS" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
This will let the user chose the settings application he wants to open. If I now set my activity as default, the user can not access the settings menu via the status bar.
I'm pretty sure you can't disable the settings menu all together.
What you could do is look into something like removing the status bar (the one at the bottom).
Check out something like: TabletBar Hider. I haven't tested it, and it would also require that you find a way of having your app run this or a way to implement it into your app. If the status bar gets hidden as soon as your app boots - I can't see how one would get into the settings menu.
You could look into this about getting fullscreen (but I don't know if you've allready tried/considered that).

How to make app as a default system launcher?

I have developed the launcher application, for the first time when I installed it on device android system pop up chooser dialogue with two options i.e. Always & Just once. I selected "Always" now my app becomes default launcher but issue is when I update the app, the system pop up the same chooser dialogue again, I don't want to show that pop up. How to make the app as a default system launcher? To achieve this, Do I need to create system level app?
I have used following permission to make the app a launcher
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.HOME" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.MONKEY" />
</intent-filter>
It is not possible to change the user preferences. Google does not allow developer to change user preferences.
A workaround may be useful, you can check for if your application is default launcher through a service and then prompt user to choose your application as default.
You can find how to check if your application is the default launcher from here (tried this one, it works for me) or here
Then you can prompt the user to select your application if it is not the default launcher. A workaround to do so is given here.

can my android application act as default application for tablet

I'm developing an android application for my customer. And in that, the User needs to work with that application only. The User should not use any other applications in the Tablet, and my application need to be the default application after i installed the application...
If i shutdown the Tablet my application will be stoped, and if i switch on the tablet means my application will be automatically started.
could i achieve this, any steps to achieve for it..
Help me to fix this, Thanks in Advance
you can start your application while boot is completed using broadcaste but you cant stop the app getting exit while user pressed home button.
You may define your activity as Home, in the manifest file, define as below:
<activity android:name=".YouClassName">
<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>
This way, after install you application, when user long tap the Home button, Android would prompt use to choose which HOME to enter, one is the system default, the other is your activity. At this time, user may also set your activity as default HOME, then when power on, system enter your activity automatically.
If you permission to delete system default launcher (the default home), then your activity becomes to be the unique home.

Override or disable settings menu

I'm making an application that should be used in a store that displays product information. I use an Android tablet to provide the customer with some interactive information. The user should not be able to do anything else with the tablet.
So far i managed to disable the back and home button. The application starts when the booting of the device has finished. He can therefore not start any other application when he restarts the device (I was not able to prevent the user from restarting the device).
The problem is, that the customer can open the settings menu and force kill my application.
Is there a way to either disable the settings menu (e.g. by protecting it with a password) or to override it by my application?
I do not plan to add my application to the Android market since it should only run in the stores.
I found out how to override the settings menu.
Since the settings menu is opened via an implicit Intent I just need to add the right intent filters my activity:
<intent-filter >
<action android:name="android.settings.SETTINGS" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<intent-filter >
<action android:name="android.settings.WIRELESS_SETTINGS" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
This will let the user chose the settings application he wants to open. If I now set my activity as default, the user can not access the settings menu via the status bar.
I'm pretty sure you can't disable the settings menu all together.
What you could do is look into something like removing the status bar (the one at the bottom).
Check out something like: TabletBar Hider. I haven't tested it, and it would also require that you find a way of having your app run this or a way to implement it into your app. If the status bar gets hidden as soon as your app boots - I can't see how one would get into the settings menu.
You could look into this about getting fullscreen (but I don't know if you've allready tried/considered that).

How to change default Android's Desktop application?

I hear that the Android's desktop is an application that I can change.
I'm searching for some information about how to do that.
I guess you mean when you press the home button you want to have your app there instead of the default home screen? And do you mean on a non-rooted phone?
I use an intent filter for that, i.e. I want my activity to start on phone boot-up and be the default home screen.
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
<category android:name="android.intent.category.HOME"/>
<category android:name="android.intent.category.DEFAULT"/>
</intent-filter>
On a regular phone, the user will get an option to choose between your app and the default home screen though at first, although he can mark a checkbox then to always choose this app as the default screen then - but your app cannot force the user to do that.
In the market you can search for Home Replacements. Once you install one and press the home button you will get a Choose Dialog, that let's you pick from the default Home and the newly installed one.
The current Home Screen that I use is Launcher Pro.

Categories

Resources