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.
Related
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.
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.
Last year I developed an app on a Xoom running Honeycomb 3.0. When running on that device the following code from the manifest worked.
<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.BROWSER"/>
<category android:name="android.intent.category.DEFAULT"/>
</intent-filter>
As you will know this registers my app (specifically, the Activity) to listen for "Home Intents." This worked fine and after the first time I could set my app as the default activity for this action.
Now I have installed the same app onto a Samsung Galaxy Tab running Honeycomb 3.1 and this functionality no longer works, no matter what state the app is in, or how many times it has been opened.
Is this intentional? Is this a Samsung only issue? Most importantly - can I regain the functionality I used to get on the Xoom?
P.S My app is completely legitimate in its intentions and has a perfectly understandable reason to want to replace the Home app.
Get rid of:
<category android:name="android.intent.category.LAUNCHER" />
<category android:name="android.intent.category.BROWSER"/>
and see if that helps. Also, try the Home sample app found in your SDK. It uses the following <intent-filter>:
<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>
My solution was to install, and then uninstall the sample Home app for Android 3.1.
Pressing home now allows a choice between my app and the default Launcher app.
My app remains unchanged.
I had this same problem on an ASUS tablet. I believe the problem was because Launcher was set as the default app for the Home button (i.e., I pressed the home button, got the popup that asks which application I wanted to use, clicked the 'Use by default for this action' checkbox at the bottom of the pop-up, then chose Launcher).
You can fix the problem by going to Settings->Applications, choosing the Launcher, then clicking on the Clear Defaults button.
I gather the reason the sample Home app does the trick is because it clears the defaults itself (how, I don't know, but I know it's not done by setting categories in the intent-filter).
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?
I have an Android AIR application (developed with Flex SDK 4.5.1) for which I need to block the Home Button, as the app is used by patients in a hospital without supervision, i.e. it is crucial that they cannot leave the app.
It seems that the only way to hijack the Home Button is to be registered as the default launcher, so that your own app gets the focus when home is pressed. This is easily achieved in the manifest, such as:
<activity android:excludeFromRecents="false">
<intent-filter>
<category android:name="android.intent.category.DEFAULT"/>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
<category android:name="android.intent.category.HOME"/>
</intent-filter>
</activity>
Now the problem is: If I do quit the application, the original launcher should be made available to the user and I think the solution would be to just start the original launcher, but how should I do that? The original Android-way of "intents" is not available in AIR and the navigatetoURL() function seems to work only for special URIs, e.g. "market://.." launches the default market app, however, I need to execute an arbitrary application...
Edit: I am referring to a mobile Android App running in this case on an Archos tablet, but it could run on any Android device with AIR installed, such as a typical mobile phone like the HTC desire. With "home button" I am referring to the respective hardware button that allows the user to switch applications (or, to be more exact, to switch to a launcher app that typically shows all the apps as icons to tap on). This "home button" functionality I need to block, as the user should not be able to easily switch to another application.
This is probably a less useful answer but disabling device buttons sounds like something that should be handled at the OS layer and not at the Application layer. Might want to have a custom build of Android for this purpose.