for a university project I have to track the screen time of an android smartphone. It's hard to find proper search results, because my search engines do only suggest apps, that already do this for you. I am interested in how these apps do this. I assume, there is a native API on android which supports you with this. Unfortunately, I can't find anything that already does this.
The app is supposed to run a little service which tracks the time of the screen activity and other stuff (like location). It would be great, if someone of you can help me out on where to look for examples and where to find information about the android API.
Edit:
To be a bit more precise: It's about the overall screen time, not about the screen time a specific app has.
Broadcast Actions might be a solution for this,
ACTION_SCREEN_ON
ACTION_SCREEN_OFF
https://developer.android.com/reference/android/content/Intent.html#ACTION_SCREEN_ON
https://developer.android.com/reference/android/content/Intent.html#ACTION_SCREEN_OFF
Related
I'm a beginner in android development. I need some idea about how can I make an app which can track a phone's live location. I want to use the same app on 2 devices and both of them should be able to track each other. Can someone please help?
the good starting point is https://developer.android.com/training/location where you can find examples and best practices. Depending on your application please consider a suitable strategy (background tracking, geofencing, and impact on the battery). The second thing you have to solve is how to exchange/share information between devices. There are ways how to deal with it. For example, google API, web socket or something else. Sorry for the general answer.
I want to know how much my application using battery of user's mobile programmatically. I search for it but not able to find any specific solution for it.
If you are trying to configure usage for your battery from your app, you cannot. If
you are trying to know how much battery is left in your device you
can.
Suggestion: One thing you can do is start a session once your app opens and end it when you close. That way you can know how much battery was used. Again, other factors like background apps and multitasking comes into play hence you cannot identify it. Maybe these links can help you.
https://developer.android.com/topic/performance/power/battery-historian
https://developer.android.com/training/monitoring-device-state/battery-monitoring#java
Again I might be wrong here. Comments and edits are welcome.
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.
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) :
I want to know how to control system resources and services like bluetooth, SMS, phone contacts etc.
Honestly, i want to know how or what to do to control sms usage based on user behavior, block incoming call or change it to auto vibrate mode without user noticed like that.
Actually, I want it for my assignment about context aware access control paper.
I choose Android for implementation but i am afraid i
couldn't submit my paper in time if i study android from the beginning and all by myself.
No offense but I want to avoid errors.
I feel my head becomes swollen whenever "force close error" show as I need it urgent.
As Willytete said developer site is the best one for you
There you can find
Application Fundamentals
Download the Android SDK and start programing
The first program tutorial where you can start Hello World
Notepad Tutorial where it give you a lot of ideas
List of Sample Apps, where there is a lot of codes
Getting the Samples, it explain how to use this.
You will get all the information from developer site that you needed, while move from beginner to an expert