usage-statistics

Android 6.0 Marshmallow UsageStatsManager issue when trying to retrieve foreground app

百般思念 提交于 2019-11-29 09:08:58
whenever I try to query the Usage Stats of the UsageStatsManager I can correctly get the last running app. However, if I pull down the status bar and there is a new notification, the last used app (based on UsageStats) will change to that of the notification. As a result, I get false alarms that the foreground application has changed. I can't seem to find a way to filter those specific draws. Any ideas? Right now, I query for the foreground app with the following code. The problem exists only in Marshmallow (5.X works correctly). UsageStatsManager mUsageStatsManager = (UsageStatsManager)

Count and limit the number of users on my app

天大地大妈咪最大 提交于 2019-11-28 12:58:04
I need to implement a system to limit the number of users that can concurrently use my app. I am thinking the best way to go is to count the number of sessions currently active and then limit based on that. How can I count the number of sessions currently active. I am using memcached to store my sessions if that makes a difference I think the easiest way is to intercept the session's open , destroy and gc callbacks (using session_set_save_handler() ) and increment/decrement a session count value within memcached. Something like: class Memcache_Save_Handler { private $memcached; public function

Android Usage Access for Android 5 Samsung devices

不问归期 提交于 2019-11-28 08:11:41
As you might know, since Android 5 was launched, accessing the recent tasks (usage stats) of your device requires the user to enable this feature manually (Settings->Security->Usage Access). My app checks if the device uses Android 5, and if so, then it offers the user the possibility of opening the settings screen for enabling usage access: Intent intent = new Intent(Settings.ACTION_USAGE_ACCESS_SETTINGS); startActivityForResult(intent, 12345); The problem comes when I try to do this in a Samsung device running Android 5... I got this error when the line shown above is executed: android

iPhone/iPad data usage tracking

痴心易碎 提交于 2019-11-28 03:06:00
问题 Just wanted to ask the community a quick question. Out of curiosity, would anyone have an idea how the iPhone App "DataMan" and "Data Usage" are pulling data readings of your personal cellular data usage? I've check the web high and low for possible answers and all so far has been dead ends. How could they have gotten their Apps to be Apple approved? Any help or advice would be great! 回答1: One way to do this would be to install a configuration profile with the proper APN settings which will

Android 6.0 Marshmallow UsageStatsManager issue when trying to retrieve foreground app

纵饮孤独 提交于 2019-11-28 02:49:12
问题 whenever I try to query the Usage Stats of the UsageStatsManager I can correctly get the last running app. However, if I pull down the status bar and there is a new notification, the last used app (based on UsageStats) will change to that of the notification. As a result, I get false alarms that the foreground application has changed. I can't seem to find a way to filter those specific draws. Any ideas? Right now, I query for the foreground app with the following code. The problem exists only

Statistics about “Microformat vs HTML+RDFa” adoption

*爱你&永不变心* 提交于 2019-11-27 15:14:13
问题 Are there some recent and reliable statistics about "Web use" (webpages using one standard or another) of these standards? Or an specific statistic about vCard (person and/or organization) scope of use? Only statistics , this question is not about "what the best ideia?" or "how to use it?". Looking for statistics numbers to compare Microformats adoption with (any kind of) RDFa in HTML adoption. We can considere, for "counting pages" statistics, that Microdata is a kind of RDFa-HTML. NOTES

How to Track App Usage in Android? How to detect when an activity is launched?

蓝咒 提交于 2019-11-27 11:36:05
I need to track app usage in Android like how AppUsage does it (i.e. track number of app launches, and time spent using each). What I plan on doing is record the start time when an app is launched, and then get the end time when an app is paused or stopped. In LogCat, I'm able to see logs of Activity starting. I've looked at the available system broadcasts, I'm not sure if there is anything that broadcasts whenever an activity is started. . Basically, how do I detect when an activity is launched? Edit: Moreover, Android also has a usage statistics system available internally which can be found

How to create a Service which continuously monitors app usage information?

孤人 提交于 2019-11-27 10:16:51
Problem at Hand : I have to create a Service which runs continuously. This service monitors 5 apps say 5 android games installed on your phone. This service needs to get the information of: 1. How many times is the game opened and run? 2. For how much time each game has run. for example: Say If I have this service installed in my app. And I let it run for a month. I need information of this kind on the screen of the app: Game Number of times the game is run Duration of Game play Game 1 20 times played for 15 hours in total Game 2 16 times played for 25 hours in total .. .. Game 5 10 times

TrafficStats Api android and calculation of daily data usage

↘锁芯ラ 提交于 2019-11-27 08:44:23
Have a confusion over following two methods of TrafficStats of Android: getUidTxBytes(int uid) and getUidRxBytes(int uid) , These two methods return the number of bytes transmitted and received through the network for this UID. But what is the time unit of it, is it per second? If I want to calculate data transmitted and received per day per app, what should I do. I thought one way, to store data in sql and keep on adding data to the table. Is it proper way? These are counters "since the interface went up" or "since the application with this UID has started". So say if your phone goes into

Check if my application has usage access enabled

人走茶凉 提交于 2019-11-27 08:17:01
I'm using the new UsageStatsManager API to get current foreground application in Android 5.0 Lollipop. In order to use this API, the user must enable the application in the Settings->Security->Apps with usage access screen. I send the user directly to this screen with this Intent: startActivity(new Intent(Settings.ACTION_USAGE_ACCESS_SETTINGS)); Now, I want to validate the user enabled my application. I wanted to do so like I validate the user enabled my application to use the NotificationListenerService but I have no idea what is the String key, if it even exists. Settings.Secure.getString