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.
Related
I have a demand for a product, but I don't know where to start to research it.
The idea is to create an app for a totem of an establishment.
It should always be in the foreground and the customer should not have any way to leave this view.
Besides when I open the OS he should already open the app.
Does anyone have any idea how I can follow this idea?
App for android.
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 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.
Basically I want to prevent a particular application from starting. A further question may be related to the Android internal behaviors from clicking application button to application running. Help clarifying each internal step will be highly appreciated.
Put it in detail: When the user clicks 'YouTube' button on the screen (assuming YouTube has not been started by far), who gets to know first this particular click is YouTube? Also, I think finally Zygote will spawn a new process representing YouTube, and this process will be written in process table in kernel. Should I let Zygote know this is an application that the user should not start?
If the user starts an app by clicking on an app icon per default you won't be able to intercept it.
You might be able to do something if you made your own launcher application which had it's own shortcuts to all apps that reside on the phone. That would be my best suggestion to a possible work around.
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!