usage-statistics

How can I find the data usage on a per-application basis on Android?

吃可爱长大的小学妹 提交于 2019-12-17 00:46:38
问题 I am trying to find out the data usage on Android on a per-application basis. Something like Android Data Usage Apps and Quota / Cap Monitor Widgets: never get charged extra for data or get capped again! . I looked at Stack Overflow question How to go about detecting data usage in the Android environment . But it's not been of much help. ActivityManager activityManager = (ActivityManager) this.getSystemService(ACTIVITY_SERVICE); ActivityManager.MemoryInfo mInfo = new ActivityManager

Track number of impressions of a widget running on a remote website

这一生的挚爱 提交于 2019-12-13 05:50:33
问题 I have created a widget that is being hosted on a number of websites. I originally implemented the code using only jquery and JSONP to buid the widget. Upon implementing the widget on live webiste though we had the unfortunate experience of that other widgets which were on the site already had really poor javascript in them which killed our widget, so to cut a long story short I have created a second version which works using an IFrame. I have read up on the google analytics site that you can

How to track application usage? (2)

给你一囗甜甜゛ 提交于 2019-12-13 03:43:17
问题 I asked this question yesterday and got a great response/code example. The only problem is that I forgot to mention that I am forced to work with the .Net Framework 2.0 and can't use the List.Select ( I assume the linq namespace). Does anyone have a good work around for List.Select seen below: class Program { struct ProcessStartTimePair { public Process Process { get; set; } public DateTime StartTime { get; set; } public DateTime ExitTime { get { return DateTime.Now; // approximate value } }

“Usage Stats” Permission throws error?

偶尔善良 提交于 2019-12-13 03:14:05
问题 I have been using this Stackoverflow answer to check if the user has already granted the "Usage Stats' permission: boolean granted = false; AppOpsManager appOps = (AppOpsManager) this .getSystemService(Context.APP_OPS_SERVICE); int mode = appOps.checkOpNoThrow(AppOpsManager.OPSTR_GET_USAGE_STATS, android.os.Process.myUid(), this.getPackageName()); if (mode == AppOpsManager.MODE_DEFAULT) { granted = (this.checkCallingOrSelfPermission(android.Manifest.permission.PACKAGE_USAGE_STATS) ==

How to check mobile data usage programmatically?

不羁的心 提交于 2019-12-10 19:29:39
问题 The question is pretty straight forward, How do I find out how much mobile data (in GB or MB) has the user used in the current month? As it has been reported as off topic, I want to clarify that the data usage is supposed to be checked via code in an app. Is there some code I can use to check for the users used data? 回答1: See: https://developer.android.com/reference/android/net/TrafficStats.html Try: Toast.makeText(this, android.net.TrafficStats.getMobileRxBytes()+"Bytes", Toast.LENGTH_SHORT)

Is there a Java library that enables gathering UI usage statistics?

房东的猫 提交于 2019-12-10 11:26:50
问题 Is there a Java library that enables gathering UI usage statistics? Something that feels like log4j? 回答1: If you are working with the Eclipse plateform you might have a look on the Usage Data Collector project: http://www.eclipse.org/epp/usagedata/ 回答2: I answered this question before I saw yours. Specifically, I would point you at the NetBeans Platform Gesture Collection Infrastructure. Although planning to use it, I have not yet, but it is much more mature than the Eclipse Usage Data

Weekly Active Users for each day from log

拥有回忆 提交于 2019-12-10 10:39:59
问题 I was wondering if someone could help me with some SQL for returning the amount of unique users logged into a database table during a period of two or more days (let's use 7 days as a reference). My log table contains a timestamp (ts) and user_id in each row, representing activity from that user at that time. The following query returns the Daily Active Users or DAU from this log: SELECT FLOOR(ts / 86400) AS day, COUNT(DISTINCT user_id) AS dau FROM log GROUP BY day ORDER BY day ASC Now let's

Android Lollipop know if app as Usage Stats access

非 Y 不嫁゛ 提交于 2019-12-09 11:35:45
问题 Since Android Lollipop, we have now an API for accessing apps usage stats. However, your app must be granted those permissions by the user. I know that for redirecting the user to those settings using Settings.ACTION_USAGE_ACCESS_SETTINGS. Now, my question is how do you know the user has granted you those permissions so that you can stop redirecting him to the settings. Thanks! 回答1: you can simply query usagestats with daily interval and end time the current time and if nothing is returned

Weekly Active Users for each day from log

浪尽此生 提交于 2019-12-06 14:20:36
I was wondering if someone could help me with some SQL for returning the amount of unique users logged into a database table during a period of two or more days (let's use 7 days as a reference). My log table contains a timestamp (ts) and user_id in each row, representing activity from that user at that time. The following query returns the Daily Active Users or DAU from this log: SELECT FLOOR(ts / 86400) AS day, COUNT(DISTINCT user_id) AS dau FROM log GROUP BY day ORDER BY day ASC Now let's say I would like to add to this single query (or at least retrieve in the most efficient possible

Android get UsageStatsManager in API level 21

情到浓时终转凉″ 提交于 2019-12-06 02:46:10
I need to get info about recent apps usage. Before API 21 it was used getRunningTasks or getRecentTasks to get this info. These methods were deprecated in API 21 according docs. There is UsageStatsManager class now, introduced in API level 21. But! Context.getSystemService(UsageStatsService) was added only in API level 22! The question is - how to get needed data in API 21 ?? According dashboards , there is 13% of users at this API level, I don't wanna lose them. Well Context#getSystemService(...) was introduced in API level 1 but Contexts' USAGE_STATS_SERVICE String was introduced in API