Hello
I only know C# programming language and I create games in unity and my projects get completed by today and I also created some app with MIT app inventor. I need one extension to close all background app like optimizing the android device. I tried to write code to stop background apps below
List ApplicationInfo> packages;
PackageManager pm;
pm = getPackageManager();
//get a list of installed apps.
packages = pm.getInstalledApplications(0);
I can explain above code. So, here a list is created and a list stored package name of all installed app in a android device
ActivityManager mActivityManager = (ActivityManager)context.getSystemService(Context.ACTIVITY_SERVICE);
for (ApplicationInfo packageInfo : packages) {
if((packageInfo.flags & ApplicationInfo.FLAG_SYSTEM)==1)continue;
if(packageInfo.packageName.equals("mypackage")) continue;
mActivityManager.killBackgroundProcesses(packageInfo.packageName);
}
now above code just call activity manger to kill background app by list or we can replace the list by an package name
I dont know Java or any one can tell what kind of library are needed for this extension or somebody can create this extension ?
any help is appreciated