How to retrieve app usage statistics of an android device? - android

I'm constantly trying new apps and my phone is getting cluttered with old apps, I no longer use. So, I thought I'd develop a simple app to help me out. There are similar apps, but none does exactly what I want:
I would like to have a list of apps which I've installed in the last month, which I've used X number of times (for easy access: They may be keepers!) as well as those I've not used in Y weeks.
Is there any way to get app usage statistics with Android? I guess ActivityManager might help me to gather that statistics, but is there a way to read just when an app has been used last? Or how many times in a given period?
Any tips will be most welcome :)

You can try out my app for uninstallation of the apps you don't need : https://play.google.com/store/apps/details?id=com.lb.app_manager .
Also, if you wish to find exact usage statistics of your apps, you can use my app this way: find "settings" (the app itself) inside the list (you can perform a search query), choose to make a shortcut of it, and then choose on the dialog "Usage Statistics". This way you can perform both the operations you wanted.
I also plan on adding this feature somehow in the future, but that's what you can do for now.
Here's a screenshot (it's the first on what I show here) :

Related

is it possible to program an app that receives data from an already existing app?

I'm trying to program an app using android studio that receives data (blood sugar levels) from the app tomato (which calculates blood sugar levels automatically every 5 mins or so). The tomato app already exists and is made by a company.
So I was wondering if doing this is possible. if so, how?
I saw this post: Is it possible for an Android app to use data from another app? which is very similar to what im trying to do but i didnt find an exact solution/answer to this.
Any opinions and help are very much needed and welcomed.
You would first need to know how the app is storing the data, you could check your phone's storage using the Device File Explorer in Android Studio. If they have exposed the data then you are able to check and read the files that the app has exposed. However, I have a feeling that they would not be leaving them in plain text for you to take.
Upon some further reading, it seems they read from a device called a MiaoMiao Transmitter. You could ask the producer of this product for a developer kit and see what they say. This would come with documentation as to how you can get data from the product. However, if they do not provide you with any help, you will need to do some investigation as to how the device functions.
Perhaps it sends android broadcasts when it is taking a reading? This is just speculation of course. This is very niche and I believe that is a reason there are only a few apps that use the device - they are trying to lock out "non-verified" developers. However, when there is a will, there is always a way! ;)
Best of luck!

How to trigger actions between applications

I'm here to get some information about an idea in my head. I have two applications (running both on iOS and android) with similar functionalities. The first is developed by me, the second is a famous app used to add votes for students.
Now my app has the same feature, but my question is:
Is it possible to write a function or whatever can help me, to make possible that when I add a vote on my app, It also triggers a specific action (in this case, the "add a vote" action) in the second one (the one not developed by me)? I'm not asking you the specific process (because I should give you major details about the two apps), but I want to know:
1) Is it possible?
2) What language, programs, etc. should I use to do that?
3) Maybe links to video or articles that explain how to archive similar objectives
In my knowledge, it is not possible to invoke an action from your app to another app which you don't own.
One way which I can possibly think is, if there is a web API exposed from the other application then you may be able to achieve what you want.

Can I build this quiz client app?

I've been programming for over 20 years, but mostly in the VB and SQL. As a side job, I host game shows at local bars and restaurants (Trivia, name that tune, etc.) and I'd like to develop an android app that I can install on mobile devices to give to customers to interact with the game.
I'm trying to make the game shows more interactive than just pen and paper (and time-consuming, manual scoring). I can get Kindle Fires for $40 each, so I thought it would be cool to create an app that will allow the user to do 3 things:
Choose an answer from a list (Multiple choice), and everyone can answer
Buzz in (blocking other users out)
type in an answer
I'd like the tablets to send the responses to a central "hub" or application that will record the answers so it can automatically do the scoring for me. If possible, I'd prefer to be able to have everything connect through an ad hoc wifi network that I would set up on site (that part I know how to do, too).
I'm not looking to have the questions appear on the phone at this point; I have an office-based application that automates a powerpoint presentation based on questions/answers and other parameters imported from a database/spreadsheet. (VBA is nice and easy for me.)
Ideally, the quiz questions would work like this:
I project the answer where everyone can see it.
After announcing the questions, the tablet apps are "activated" and
the user can then select their A, B, C or D answer (or buzz in, or
type an answer depending the type of questions/quiz).
My hub application would then receive the following information:
team/player name, answer choice, time it took to answer the question
(because I'm thinking of using a points tier that gives faster
players get more points, either based on time ).
The catch is, I don't even know where to begin from an android development standpoint, as I have no experience in that realm. In most programming cases, I know keywords to search on, but I'm totally flying blind here.
Does this seem like a feasibly application? There are systems online that I can buy, but the buzzers are expensive and the software has some significant limitations that prevent me from spending the money. I'd rather develop something myself and spend $40 per client unit and load it up with my software.
(Then, of course, license the whole kit and kaboodle and make a mint and retire in 5 years, living the good life off of my pub quiz empire...)
So, if you have any suggestions on starting points, or specific methods and processes to being fiddling with, an IDE...any help would be greatly appreciated. Once I'm up and running, I will reward you with extra points if you ever come to one of my events.
Go full kotlin !
Android works well with Kotlin and you can have a server quickly setup with : https://start.spring.io/#!language=kotlin
https://kotlinlang.org/docs/tutorials/kotlin-android.html
A good client for Android is provided here :
https://github.com/square/retrofit
You will probably have hard time to get started. Using same language for every part of the system will make things easier.
Also, Kotlin is less verbose than Java and will prevent you to make the usual mistakes found in Java world.
Also, if you create an open source project out of it, you may be eligible for IntelliJ.
Your very first stop is : http://try.kotlinlang.org/#/Examples/Hello,%20world!/Simplest%20version/Simplest%20version.kt
Get to know the language by trying it out. When you are in ease with it, start looking at Anko (https://github.com/Kotlin/anko).
To do the project in an easy way, break it down in milestones.
Simple app which shows 4 buttons (choices) and shows a message for each button. (Eg. you clicked "1")
Small server with spring boot. It should display whatever you post to it. (An "echo" server)
Improvement of the simple app to POST something to the server and display the answer in a dialog.
At that point, you application is practically done! You would have understood enough to complete it. The hardest thing would be behind.
Don't think your are smarter than the flock. Do these milestones, at least. You will be thankful to yourself.
This post may seems unrelated, but I explain how good Kotlin can be in such projects : https://www.linkedin.com/pulse/why-do-android-projects-cost-less-than-ios-christian-baune

Is it possible to develop an Android app that monitors the use of other apps?

I am a long time lurker on Stack Overflow where generally the solutions I sought already existed on here. However, I am stumped trying to find information on tackling this problem.
Basically, I am looking at making an Android app - first time making such an app - and part of the functionality is to monitor what else the phone user is doing and then maybe create a log of what the person has done. For example, spent 27% of the time when the phone screen is on using Facebook.
As for my actual Android Studio experience, all I have created so far is a simple app that takes in text from an input field and alerts it back out to you. I am studying a video series to learn how to use and develop with Android Studio.
I am enthusiastic about the challenge, so if anyone has some good resources or information to help me achieve this I would be really grateful.
Yes it is possible to track applications usage, using google API.
Here is google resource link
What may interest you the most is the part concerning UsageStats
You can use this since api 5.0. You can then for example use method getTotalTimeInForeground() to get the total time this package spent in the foreground, measured in milliseconds, which seems to correspond to your needs.
Therefore, using your Facebook example. After you get the package name (com.facebook.katana) , you could get the application (Facebook) uptime on a daily/weekly/monthly base.
Also, you could use getLastTimeUsed() and make your application logs those timestamp then do some maths.

Google Analytics on Android

There is a specific and official analytics SDK for native Android apps (note that I'm not talking about webpages in apps on a phone). This library basically sends pages and events to Google Analytics and you can view your analytics in exactly the same dashboard as for websites. Since my background is apps rather than websites, and since a lot of the Google Analytics terminology seems particularly inapplicable to a native app, I need some pointers. Please discuss my remarks, provide some clarification where you think I'm off-track, and above all share good experiences!
1. Page Views
Pages mostly can match different Activities (and Dialogs) being displayed. Activities can be visible behind non-full-screen Activities however, though only the top-level Activity can be interacted. This sort-off clashes with a "(page) view". update -> Read http://android-developers.blogspot.com/2010/12/analytics-for-android-apps.html and accept it.
You'd also want at least one page view for each visit and therefore put one page view tracker in the Application class. However this does not constitute a window or sorts. Usually an Activity will open at the same time, so the time spent on that page will have been 0. This will influence your "time spent" statistics. How are these counted anyway?
Moreover, there is a loose coupling between the Activities, by means of Intents. A user can, much like on any website, step in at any Activity, although usually this then concerns resuming the application where he left off. This makes that the hierarchy of Activities usually is very flat. And since there are no url's involved. What meaning would using slashes in page titles have, such as "/Home"? All pages would appear on an equal level in the reports, so no content drilldown.
Non-unique page views seem to be counted as some kind of indicator of successfulness: how often does the visitor revisit the page. When the user rotates the screen however usually an Activity is recreated, thus making it a new page view. This happens a lot. Maybe a well-thought-through placement of the call might solve this, or placing several, I'm not sure.
How to deal with Page Views?
2. Events
I'd say there are two sorts:
A user event
Something that happened, usually as an indirect consequence of the above.
The latter particularly is giving me headaches. First of all, many events aren't written in code any more, but pieced logically together by means of Intents. This means that there is no place to put the analytics call. You'd either have to give up this advantage and start doing it the old-fashioned way in favor of good analytics, or, just be missing some events.
Secondly, as a developer you're not so much interested in when a user clicks a button, but if the action that should have been performed really was performed and what the result was. There seems to be no clear way to get resulting data into Google Analytics (what's up with the integers? I want to put in Strings!).
The same that applies to the flat pages hierarchy, also goes for the event categories. You could do "vertical" categories (topically, that is), but some code is shared "horizontally" and the tracking will be equally shared. Just as with the Intents mechanism, inheritance makes it hard for you to put the tracking in the right places at all times. And I can't really imagine "horizontal" categories. Unless you start making really small categories, such as all the items form the same menu in one category, I have a hard time grasping the concept.
Finally, how do you deal with cancelling? Usually you both have an explicit cancel mechanism by ways of a button, as well as the implicit cancel when the "back"-button is pressed to leave the activity and there were no changes. The latter also applies to "saves", when the back button is pressed and there ARE changes. How are you consequently going to catch all these if not by doing all the "back"-button work yourself?
How to deal with events?
3. Goals
For goal types I have choice of: URL Destination, Time on Site, and Pages/Visit. Most apps don't have a funnel that leads the user to some "registration done" or "order placed" page. Apps have either already been bought (in which case you want to stimulate the user to love your app, so that he might bring on new buyers) or are paid for by in-app ads. So URL Destination is not a very important goal.
Time on Site also seems troublesome. First, I have some doubt on how this would be measured. Second, I don't necessarily want my user to spend a lot of time in my already paid app, just be active and content. Equivalently, why not mention how frequent a user uses your app?
Regarding Pages/Visit I already mentioned how screen orientation changes blow up the page view numbers.
In an app I'd be most interested in events/visit to measure the user's involvement/activity. If he's intensively using the app then he must be loving it right?
Furthermore, I also have some small funnels (that do not lead to conversion though) that I want to see streamlined. In my mind those funnels would end in events rather than page views but that seems not to be possible.
I could also measure clickthroughs on in-app ads, but then I'd need to track those as Page Views rather than Events, in view of "URL Destination".
What are smart goals for apps and how can you fit them on top of Analytics?
4. Optimisation
Is there a smart way to manually do what "Website Optimiser" does for websites? Most importantly, how would I track different landing page designs? update -> Seems I could use the Custom Variables for that. More details are still welcome.
5. Traffic Sources
Referrals deal with installation time referrals, if you're smart enough to get them included. But perhaps I'd also want to get some data which third-party app sends users to my app to perform some actions (this app interoperability is possible via Intents).
Many of the terminologies related to "Traffic Sources" seem totally meaningless and there is no possibility of connecting in AdSense.
What are smart uses of this data?
6. Visitors
Of the "Browser capabilities", "Network Properties" and "Mobile" tabs, many things are pointless as they have no influence on / relation with my mostly offline app that won't use flash anyway. Only if you drill down far enough, can you get to OS versions, which do matter a lot. I even forgot where you could check what exact Android devices visited.
What are smart uses of this data? How can you make the relevant info more prominent?
7. Other
No in-page analytics. I have to register my app as a web-url (What!?)?
Google Analytics is pretty good for basic tracking of Android app usage. If you need more mobile-app-focused analytics you may also want to look at these:
http://www.flurry.com
http://www.capptain.com
A benefit of these over Google Analytics is that they are designed to track mobile app usage, rather than web site usage, so are more specific in what they do, but to be honest there's always going to be work for you to do to define what actions within your app matter to you enough to track - that's more about the needs of the business, than the technology.
I am not convinced with google analytics for tracking our application. Because as per my requirement i would like to get the error or crash report from my launching application in market. From this error report i could see the stack trace of the crash so that i can fix my bug. But from google analytics i am not sure how to get these details, I would suggest the best crash report trackr is Acra you will get more info here http://code.google.com/p/acra/
If someone know how to get these crash report using Google analytics please share.
I've no analytics experience but after searching a while i found this page Flurry-vs-Mixpanel-vs-Google-Mobile-Analytics-who-wins-Why and i think you can find useful information and I also decided to use Flurry

Categories

Resources