danb
danb

Reputation: 10379

How do I set my application to default on a rooted device

We have a tablet app that we're deploying at retail outlets. It currently self updates late at night but after it does it is no longer the default "home" application and the user is given the choice to start our app or the default launcher again. We'd like to always have our app be the default home application even after updates. Is there a way to do this on a rooted device?

This is an ICS based device so the addPreferredActivity doesn't seem to work as I cannot get the android.permission.SET_PREFERRED_APPLICATIONS permission even though the device is rooted. If there is a way around that, I think I could get this done..

Upvotes: 3

Views: 5561

Answers (2)

user1414160
user1414160

Reputation:

Sometimes it happens that some application cant work properly in rooted device i also had same kind of problem in my device (was also Rooted).so i had only one way remain that to install os again so i did it with use of some software (like superoneclick) and with use of it i unroot my device and reinstall os. then the application works perfectly so may be u should also unroot your device if its possible.

Upvotes: 0

CommonsWare
CommonsWare

Reputation: 1006674

Is there a way to do this on a rooted device?

The simplest solution is the one you rejected from the comment: remove the stock launcher and make yours be the only launcher.

This is an ICS based device so the addPreferredActivity doesn't seem to work as I cannot get the android.permission.SET_PREFERRED_APPLICATIONS permission even though the device is rooted.

Root, by itself, has nothing to do with permissions. In this case, SET_PREFERRED_APPLICATIONS is a signature-level permission, meaning that your app would have to be signed by the same signing key as the firmware, which will not be possible unless you roll your own modded ROM.

If I am reading the Android source code correctly, the results of addPreferredActivity() wind up in /data/system/packages.xml, in a <preferred-activities> element. Play around with modifying that file very carefully and see if that will get you what you want.

Upvotes: 10

Related Questions