Override or disable settings menu - android

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).

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).

Create an android preference screen for a service

I developed an Android Service without GUI, called via a custom Intent by external applications. The previous version of the software used a GUI and preference management was done via a graphical menu that opened a PreferenceActivity.
However, now I would like to have a dedicated preference screen, only for service configuration. I'm wondering if it is possible to reuse the PreferenceActivity, via having an icon on the launcher saying "MyApp Preferences" or by having a "Settings" button on the services list (for example, see Google Keyboard on the running services).
If possible, I would like to achieve this by not creating another activity, since I have nothing useful to put on that besides a single button to open settings. Any ideas?
I think you can use the PreferenceActivity as the entry point, and don't need your own activity with a single button to launch it. For that, add
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
To your PreferenceActivity in the AndroidManifest.xml.

Android how to start activity on Boot-up

Let me describe you what I want: I want to build a "master app" and set it so that when the phone is powered up, it immediately goes into the master app. The user can never exit this app (this will be used for something like parental control), and he can only launch other apps from within it.
Basically it will be like a "custom desktop".
I must stress out, it is important that this app never exits. As long as the phone is started, this is the only environment that the user has access to.
Now after I explained what I need, I will need your help to tell me what am I looking for. Is this some kind of "default launcher" that I keep hearing about? Or how is this called?
How can I do it?
Thanks
Add this into Manifest.
<receiver
android:name=".Bootupclass"
android:enabled="true"
android:permission="android.permission.RECEIVE_BOOT_COMPLETED" >
</receiver>
Bootupclass
public class Bootupclass extends BroadcastReceiver{
#Override
public void onReceive(Context context, Intent intent) {
//write intent here
}
}
I need someone to give me the exact code needed to make the app:
Here Goes,
If you make an app as a launcher app, and if it is the ONLY launcher app within your system, it will of course be started when you switch on your device. And also when you click on the home button, since your app is the only launcher app within the system, the same would be started.
so ,
1) start on bootup 2) be the default action when pressing the home button (the "desktop")
could both be merged into 1.
You mentioned that your phone is rooted, So easiest way to achieve what you require would be to
1.Install your app with just these lines within the manifest. i.e within your first activity. Nothing else is required. (this would make your app as a launcher app)
<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.LAUNCHER" />
</intent-filter>
2.Un-install the default launcher application within your device.
What is being asked in the question body is different from the question title.
Listening to BOOT_COMPLETED will do literally what is requested by title - give control to the application once when device is powered on or restarted.
It is not enough to achieve the real goal - to prevent user from exiting the application and reaching "normal" home screen - once user presses "exit" or "home", he will essentially leave your app. While you can intercept "Exit" button and prevent it from quitting your app, "home" button is not possible to block programmatically.
In order to make and app like parental control and prevent user from reaching unwanted apps you need to implement "custom home screen" or "custom launcher" (which is the same thing).
It is rather large topic, but this seems to be a good starting point: Android - creating custom launcher.
And because author insists on "exact code", to make your app to start instead of a home screen (after boot or pressing "home" button), you need the following in the manifest:
<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>
After install, press "home" button - you will be given a choice of standard launcher or your app. Check "use as default" and select your app - from now on it will start instead of the normal home screen.
Beware, though, that there are few known issues with custom launchers. One is - you have to block access to settings, otherwise user can switch back to default launcher. Also, after your app is updated (i.e. you post new version) user will be asked what home screen to use and can choose default launcher.
I must stress out, it is important that this app never exits This I believe is not possible.
From your requirement it seems that you require a MDM solution. Upwards of Android 2.2 device administration APIs have been available. Check out http://developer.android.com/guide/topics/admin/device-admin.html
The user will have to install your app and allow it to be a Device Administrator. (You can see currently available administrators from Setting -> Location and Security -> Device Administrator). Now as an administrator you can control features on device eg. disallow apps to be uninstalled, prevent installation of specific apps, disallow launch of specific apps. wipe device if security is breached etc. You can also prevent your app from being uninstalled.
There are apps available with such features. I can name Maas360 off the top of my head.
Disclaimer: I haven't tried the device administration apis myself.

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.

Is it possible to launch options with my contact app to select on Android icon is clicked?

Is it possible to launch an option like which application you want to open on contact icon is clicked in Android? So when I clicked on the Android phone icon, then it should ask to whether you want to launch Android default app or my application.
Basically I have developed call log module of Android application with customization so I want to give user to select any option at click of Android phone icon.
So is it possible?
It is possible, in fact it happens naturally when you have more than one application installed for a desired action. Intent filters would help you.
it is possible. i try for Dail icon put this code in your androidmenifest file
<intent-filter>
<category android:name="android.intent.category.LAUNCHER" />
<category android:name="android.intent.category.DEFAULT" />
<action android:name="android.intent.action.DIAL" />
</intent-filter>
when clicked on call icon then open option complete action using list my application is in list.
i think also action tag available for contact icon.
No, it's not possible. When you click an icon in the launcher it simply launches the clicked app. You could instead ask the user which app to use in certain situations like when trying to call someone. I'm not very sure, but you might be able to ask the user which log to use when clicking on a missed call notification.

Categories

Resources