Answer the question
In order to leave comments, you need to log in
How to make a restriction so that the user can use only one program? [Android]?
Greetings, habrasobshchestvo!
Tell me how to solve the following problem:
Ideally, the user could run only one program on the device.
Or close access to the Internet to everyone except this program, and remove all entertainment, and prohibit them from being installed.
Or give limited rights to the account and let it be used only.
In general, that the device is used only to work with this one single program.
I hope that someone has already encountered a similar issue and knows how to solve it =)
Answer the question
In order to leave comments, you need to log in
To the user the limited uchetka on most I can not. Also, if it's in Windows, I advise you to start by replacing the shell with explorer in the registry with the desired program and the task manager block (via gpedit).
I use this play.google.com/store/apps/details?id=com.whisperarts.kidsshell&feature=search_result
you can search for something with similar functionality
Something like play.google.com/store/apps/details?id=com.whisperarts.kidsshell&feature=search_result and for internet chop play.google.com/store/apps/details?id=com.googlecode.droidwall.free&feature =search_result or similar.
OU! I wrote such utility. hang the service on the onbootloader and check the timer, if your process is not in the foreground, throw it in the foreground. All. With a check timeout of 200ms, it is no longer possible to leave the kiosk. Moreover, you can custom allow processes, homescreen, for example, so that the user can see how much time and use your app)
NOOO!
Runnable appsChecker = new Runnable()
{
//@Override
public void run() {
boolean inForeground = false;
List<RunningAppProcessInfo> appProcesses= null;
appProcesses = activityManager.getRunningAppProcesses();
if (appProcesses!=null) {
for (RunningAppProcessInfo appProcess : appProcesses) {
if (appProcess.importance == RunningAppProcessInfo.IMPORTANCE_FOREGROUND) {//.IMPORTANCE_FOREGROUND) {
// Log.d("timer vis",appProcess.processName+":"+appProcess.importance);
if (appProcess.processName.equals("com.bigbuzzy.business")) {
inForeground = true;
}
}
}
}
//Log.d("timer",inForeground+":"+ inWiFi);
if (!inForeground) {
/*
boolean isSystem = false;
for (RunningAppProcessInfo appProcess : appProcesses) {
if (appProcess.importance == RunningAppProcessInfo.IMPORTANCE_FOREGROUND) {
PackageInfo p = null;
try {
p = ForegroundService.this.getPackageManager().getPackageInfo(
appProcess.pkgList[0], PackageManager.GET_PERMISSIONS);
}
catch (NameNotFoundException e)
{
}
if (p != null) {
String ss = "";
if (p.requestedPermissions==null) ss = null;
else {
for (String s : p.requestedPermissions) {
ss= ss + s;
}
}
boolean issSystem = (p.applicationInfo.flags & ApplicationInfo.FLAG_SYSTEM) == 1;
Log.d("System", appProcess.processName+":"+p.versionCode);
}
}
}
*/
Intent i =new Intent();
i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
i.setClassName("com.dgdfgdfgd.business", "com.dfgdfgdfgdfgdgdgf.business.MainMenuActivity");
startActivity(i);
i = null;
}
appProcesses= null;
handler.postDelayed(appsChecker, INTERVAL);
//}
}
};
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question