How to background the application and that application after some time - android

I Develop a one application which contaion the scenario given below in that
Some time of application goes into the background and after the some period of time that application comes in front of side this just createing the demo application.
In this application i can't use any GPS System also.
please help to solve this problem and which kinds of permision to give
the application and how to face this problem.
Thanx in advance
#androidTech

As far as I can understand, you want to hide your application in background. So, there is a method for that
moveTaskToBack(boolean nonRoot)
this will do the trick for you, when you pass boolean true to its arguments.

Related

How to code an app that blocks other apps from launching for a certain time using Android Studio

I want to code an app that hinders other app from launching. Can someone please help to start from the beginning. Can someone provide an example and i'll try my best to understand it. Thanks (Full code if possible :D)
One example is AppBlock in the play store.
To create a feature that 'blocks' other apps from running like AppBlock, you simply just need to show a popup on top of the other apps.
Look into SYSTEM_ALERT_WINDOW, with this, you can draw on top of any other app.
Once you have that working, you should look into the other permissions of AppBlock,as it'll show you what they're doing.
AppBlock's Permissions
bind to an accessibility service
update component usage statistics
receive data from Internet
view network connections
full network access
run at startup
reorder running apps
control vibration
prevent device from sleeping

How does call app works when the call app is removed from task list (aka Overview screen) in Android?

I learned that following is Overview screen.
I clicked the dialer and dialed a number and then swiped the dialer to the right.
But still the call is on like this.
How is this done?
I am a newbie to Android programming. I am thinking if they had used a back ground thread or a separate service or something else, so that it is never killed accidentally. How is this done?
Please help me. Thanks.
I believe it is using the Android foreground service. You can checkout how to run it in the doc:
https://developer.android.com/guide/components/services.html#Foreground
The difference of foreground from background service is when phone is low on memory, system will not automatically close it to release memory, it should be closed manually by user, which is why you need to have a notification as a way for user to close it when you first create it.

Android : How to notify the user when the Application is not running

I am new to Android and have a problem with the Notifications. I know that this topic has been taken up earlier as well but I just wanted to know if there is any other way to go about it.
Problem : In my application I want that the user is notified that he/she has entered in the radius of a particular location. I have the functionality working when the application is alive and in the foreground. I will however want that the user is also notified when the application is not working and not there in the foreground.
In the previous posts I have found out that this can be done by using something called as the C2DM. Altough I am not much aware of it but by using C2DM I would be introducing an extra network trip. My question is that the only way to go about it? Can't this functionality be done any other way round, something locally like something of a daemon thread of sorts?
Also if C2DM is only the way, and as my application is not in my foreground will the C2DM also inform once the user reaches the radius of a particular location?
Will like to thank you all in advance. Please do let me know if any one of you have faced a situation/problem/requirement similar to this before and also if you can highlight the way forward for this?
I have the functionality working when the application is alive and in the foreground. I will however want that the user is also notified when the application is not working and not there in the foreground.
Use addProximityAlert() on LocationManager, and then it will not matter whether your app is in the foreground or not.

How to detect whether my Phonegap Activity is already running or not?

I have developed a android application using phonegap. I have registered certain recievers which get invoked as per my needs. Now the issue which i am facing is that if my application is already open then the reciever is opening the activity again. It happens because i coded in such a way. But suppose if my application was close then there is no issue.
So i think so i need to check whether the activity is open and then open it accordingly. Any suggestions?
This post contains set of solution which might help you decide which one is suitable for you requirement.
Checking if an Android application is running in the background

Making user service invisible in the running service list

I am developing an application in which I start a service which will run in the background,
Now I want to make this service invisible to the customers so that they can not stop it.
Is that possible?
Any help regarding this issue will be appreciated.
Thanks
You should not and cannot do such a thing. This will violate the basic privileges of the user over his phone and is a potential (big) security hole.
Don't run it. Then it won't show up and the users won't be able to stop it.

Categories

Resources