I want to create an android app that runs on the background, there should not be any UI or Launcher, app should runs on the startup, Is there any example I could follow, I found few resource but those are not helpful for me
First of all look at the official documentation of Services, see for yourself if this is really what you need. Then for your second part of question, you can ask the system to tell you about the device booting completed and run the service. You can find more here.
Related
I'm new to Android development and I'd like to develop an app that shows application statistics, but only for their background runs (with background i mean the app is totally closed, also in the multitasking, and it starts to run for doing different jobs, or run always in background for different reasons, for example the messaging apps that must be always running in background...).
For example i would like to know the amount of time of run in background of the app in a certain timespam, how many times the app was started in the background in a certain timespam, the duration time of single run in background of the app etc...
My question is: are there APIs that provide this informations?
If not, is it possible to retrieve this informations in another way?
I'm interested in developing with API 24 (Android 7.0 Nougat) and above.
I have read about ActivityManager and AppUsage, but i can not figure out how they can be useful for my purpose.
Can anyone help me please? Thank you.
I think you can do this with very easy steps first make the application which will run in the background and for this, you can refer to this link.
Link of background running app
after this, you can use SQLite DB to store all log information.
hope this will help you.
I have an app where I detect tags and my question is :
I want my app to do an action when detecting new tags, in this case, opening a webpage. It works without problems but only when the app is on the foreground, but I want it to work even when the app is running in the background. I read about Android Services but I'm not sure it is what I can use.
Can you give me directions to find a way to solve that problem?
Thank you very much
Please see AsyncTask from google documentation. Here is the link https://developer.android.com/training/best-background.html
This site has an example on it
http://www.sitepoint.com/scheduling-background-tasks-android/
I am trying to create a benchmarking app that launches a few apps and measures the load time. Starting a timer and launching an app (via intents) is the easy part. And, if I have source to the child app, I can either have it record the time and pass that back, or I can just have it kill itself completely at some point. But, how do I know when stock apps have finished loading? Or, how can I make them close automatically so that mine is brought to the foreground again to stop the timer? I know the source for stock apps is public, but I don't think it's practical for me to try to modify it. Or is it? I can't tie my benchmarking app to a specific version of Android.
Specifically, I'm interested in measuring load times for the browser, youtube, and mail.
I've looked at using the ActivityManager to get info about running apps, but I think in that case I would have to poll in the background, and I've read that ActivityManager info is not necessarily always up-to-date, anyway.
Any suggestions would be very much appreciated.
I decided to just modify the source and build a version of my app for each version of Android/processor. I won't have to target each device specifically, just processor families (Atom/armV7/etc.)
Getting and compiling Android source is easy
Building a custom version of a stock AOSP app is also not that bad
From there, it's just a matter of using intents to invoke activities and pass information.
How do I create a simple app that runs a method or activity without actually opening a gui?
I have the coding for the app already.
For example, a task manager on android I have has an icon that you push and it terminates apps running in the background without having to open an app and then pushing terminate manually.
Do I just remove the layout or do I need to have more than that?
Sorry for using the wrong terms, I'm still learning.
Thanks
Ran into your question by chance, I'm learning on the go myself. But it sound to me you maybe should consider making a service, and not an activity that has a layout. A service can work in the background and interact with other applications, which seems to me is your case.
Android Service API http://developer.android.com/reference/android/app/Service.html
Good luck!
I want to launch more than one application at the same time.Like one application should run in the background when a new application is started, and I have to switch between those two application.
If anyone having the code to do this please help me.
Give some website links to know about the multitasking in android and how to achieve it.
If you want to run something in the background, you have to use a Service. Services are not killed except in extreme memory situations. Read the Application Fundamentals for more information.