Is there a way to enable, disable native android password screen pro-grammatically? I am asking this question because I saw the app SureLock which is capable of enabling and disabling android system password lock programmatically by user interaction without any root privileges. When ever user tries to go into system settings via SureLock app they have enabled native system password screen lock. App also works ics & jb systems without a problem.
Unless is there any alternative ways of implementing similar logic to design custom lock like system password lock.
Thanks.
You can use Device Administration API. There is a sample code comes with SDK. First you have to make sure that your application is run above API 2.2 Go to your SDK folder and then samples and then ApiDemos. You can import that project as a sample project. Then go to com.example.android.apis.app package and see the DeviceAdminSample.java class. That's what you looking for.
I believe you can use the KeyguardService to control that.
https://developer.android.com/reference/android/app/KeyguardManager.html
https://developer.android.com/reference/android/Manifest.permission.html#DISABLE_KEYGUARD
Use Device Admin APIs for Android, you can lock the device, reset and set password restriction also
Related
I would like to create an app which is preinstalled on a device and has complete control of it (no way to exit it), this is for devices handed out for a specific purpose. It will have some pages/navigation as well as the ability to run certain whitelisted apps.
Is there anything out there helping with this, or would this kind of an app have to be a custom build of Android? Thanks.
To have complete control over the device you would need a custom operating system. I don't think it is possible to do what you are asking for with an app
The way was in progress to implement this was with a custom compiled OS that signed a launcher with the key provided by the hardware vendor.
You can certainly fake most of this with your own launcher but to get it to be the system default launcher you need to have the vendor key I believe.
There are apps that donot do exactly what you want but achieve something similar to that. App Lock is one such app. It blocks the specific app view from the user until he enters the pin. The user will have to set Device administrator properties for such an app usually but if you are planning it as preinstalled then that can also be handled.
I do not want to launch with root, just as a common Android app, like other. I want to ask the user nicely and after that have the admin access and protection. Kaspersky is able to do it, so others should be able too.
What are the API calls here?
It is using the Device Administration APIs, you can read about it here:
http://developer.android.com/guide/topics/admin/device-admin.html
You can clone this eclipse project :
https://github.com/pedrolobito/DeviceAdminDemo
It's a fully working Android Device Admin App.
I want to make an App Locker app for Android. The app should run on various devices. It seems that Android does not allow the developer to do such low level work.
Please guide me how can a developer make such an application.
This answer will help You. It used a background service to check which application is in foreground and then check whether I need to lock the application or not.
As a workaround, you can develope a new home screen replacement app, that allows the user to run only some apps, and not all the apps installed on the system.
Some useful hints here: https://stackoverflow.com/q/4538431/584134
But it's only a facade, it's not reliable and the user must launch and use your application instead of the default android home screen.
Or you can use another app, Android Parental Control
The Settings on Android provides an option to add VPN manually.
Can this be done programmatically through some kind of an API?
I'm not looking for a way to connect to a VPN. I'm only concerned about configuring a VPN profile.
Please see this answer, it is not possible with the Android SDK.
This is not possible with Android SDK. However, some manufactures like
Motorola have their own flavor of android and in their SDK they have
made it possible.
See also this question -- Create VPN profile on Android. Briefly, we came to the conclusion that it's not only not possible with the Android SDK, but it's not possible even with a hacked SDK unless you have a rooted device (because the VPN profiles are stored via the system KeyStore, so you would need to be running as a system process to add / modify them).
However, there does appear to be a third-party VPN app that at least claims to do this without a rooted device, but it doesn't appear to be open-source and I can't vouch for it (see the comments here: http://code.google.com/p/android/issues/detail?id=8915).
I'd like to access (and change) settings of the stock android browser via code. Is it possible, and if so - how?
YES, it's programming question - i'd like to change it by code, not by manual clicking.
What about doing it for rooted device?
Android's operating system level security model basically prevents this. Your program would need to run as the same user ID as the browser or as the superuser, which is not possible unless you have the certificate used to sign the browser or your application is only for rooted phones.
In the unlikely event that one of these is the case, you would ensure the browser is not running and then simply change its private databases. Looking at the browser source should reveal anything that's not clear about the databases and any other places it might be storing things.
With some work, you could make an alternative browser that is a near twin of the stock one but either cooperates by providing an API for programmatic settings changes, or is signed with a certificate you do possess, so that your other program can establish a shared user id with it and change its settings db.