Received a great answer by someone on Twitter, tested working: try { PackageManager packageManager = context.getPackageManager(); ApplicationInfo applicationInfo = packageManager.getApplicationInfo(context.getPackageName(), 0); AppOpsManager appOpsManager = (AppOpsManager) context.getSystemService(Context.APP_OPS_SERVICE); int mode = appOpsManager.checkOpNoThrow(AppOpsManager.OPSTR_GET_USAGE_STATS, applicationInfo.uid, applicationInfo.packageName); return (mode == AppOpsManager.MODE_ALLOWED); } catch...

Here's what you see (note: I know most of them from experience so feel free to correct me in comments if I'm wrong): The red and grey bar is kind of a performance review. It's based on the FPS and you should do everything to keep it green and full....

math,statistics,discrete-mathematics,moving-average,usage-statistics

The classical solution to this kind of problem is using the median instead of the average. You can also combine these two ideas: discard a certain amount of values (e.g. the upper and the lower 25%) and compute the mean of the remainder. This is called a truncated mean.

These statistics are not available on iOS, as they are seen as an breach of the users privacy.

android,packages,usage-statistics,android-recents

String topPackageName ; if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { UsageStatsManager mUsageStatsManager = (UsageStatsManager)getSystemService("usagestats"); long time = System.currentTimeMillis(); // We get usage stats for the last 10 seconds List<UsageStats> stats = mUsageStatsManager.queryUsageStats(UsageStatsManager.INTERVAL_DAILY, time - 1000*10, time); // Sort the stats by the last time used if(stats != null) { SortedMap<Long,UsageStats> mySortedMap = new...

javascript,html5,canvas,cpu-usage,usage-statistics

You should take a look at this article from Paul Irish on his requestAnimationFrame cross-browser shim. It will firstly try to optimise frames based on browser capability, and also, have backwards compatibility for old, non-GPU enabled browsers. From the jQuery ticket: Benefits: let the browser choose the best 'animation tick'...

android,package,usage-statistics

If you want to get the foreground running time of all applications in android lollipop use the following piece of code. //Variables with dummy values and objects. UsageStats usageStats; String PackageName = "Nothing" ; long TimeInforground = 500 ; int minutes=500,seconds=500,hours=500 ; UsageStatsManager mUsageStatsManager = (UsageStatsManager)getSystemService("usagestats"); long time = System.currentTimeMillis();...

android,android-5.0-lollipop,usage-statistics,android-recents

you can simply query usagestats with daily interval and end time the current time and if nothing is returns this means the user hasnt granted permissions @TargetApi(Build.VERSION_CODES.LOLLIPOP) public boolean doIHavePermission(){ final UsageStatsManager usageStatsManager = (UsageStatsManager) context.getSystemService("usagestats"); final List<UsageStats> queryUsageStats = usageStatsManager.queryUsageStats(UsageStatsManager.INTERVAL_DAILY, 0, System.currentTimeMillis()); return !queryUsageStats.isEmpty(); } Daily interval with start...

configuration,z3,usage-statistics

All theories have final checks, but smt.arith.nl.rounds is only for the non-linear arithmetic solver (old; not NLSAT). There may be lots of final checks, none of which involve any non-linear arithmetic, or they use other methods to solve those parts.