6

I'm developing android application for CAR usage and I need that in phone or tablet the driver can only run and use this application: No calling or running other app. Is that possible? If it is not, is there any way to restrict the user for example uninstallaing other apps and disabling the installation system and disabling the calling system?

Thanks in Advance,

hamid
  • 852
  • 11
  • 27
  • it's possible by using Activitymanager create a service and watch Activity stack and pick top application if it's not your application then launch your application.for more securilty u can disable keygaurd keys – ρяσѕρєя K Jun 17 '12 at 09:38
  • 1
    The user you want to restrict from using any other app on the phone is not the owner of the phone I suppose? – Dirk Jäckel Jun 17 '12 at 09:44
  • To really make sure nothing else can be started you should modify the system software on the phone. – Dirk Jäckel Jun 17 '12 at 09:45
  • Thanks imran, But how to launch my application. Please provide some code. Thanks a lot. No Dirk, Taxi agency provides the phones or tablets for them to use only in car services. – hamid Jun 17 '12 at 09:55

2 Answers2

8

I have done a similar app like this, which is in fact an in-cab entertainment system. I have also written a blog post about it, you can check it out here: http://arnab.ch/blog/2012/01/android-auto-updating-homescreen-application/.

This is a complex application and let me list out the relevant items for you:

  1. Your app should be a HomeScreen application (search google for how to create HomeScreen app for Android)
  2. It seems clear that you would have some control over the device, so you can ensure that no additional applications are installed.
  3. The homescreen can be dynamically enabled/disabled, check out KytePhone app to see what I meant. In short you would need some password to exit your HomeScreen app.
  4. If you want to silently uninstall/install any application, then you'd need root access, or you'd have to have a custom Android build where your app will have System privilege (might not be what you're looking for).

I hope I am able to give you some direction, if anything is not clear then let me know.

Arnab
  • 736
  • 5
  • 14
  • @Arnab - Thanks. Useful blog. I am sure that you would have gone through tons of relevant articles while developing your application. Sharing them would be useful....very useful...on your blog or here. – Srikanth Dec 13 '12 at 10:06
0

You can use Accessibility service to solve this issue and you need to check granted application packages inside onAccessibilityEvent method.

import android.accessibilityservice.AccessibilityService;

public class MyAccessibilityService extends AccessibilityService {
...
    @Override
    public void onAccessibilityEvent(AccessibilityEvent event) {
    }

    @Override
    public void onInterrupt() {
    }

...
}

please follow the link: https://developer.android.com/training/accessibility/service.html

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62