I want to create an app that which get close whenever the device shakes. Can anyone explain how to do that?
I have an idea that it requires to create a service that runs in background, but I am struggling with actual coding and don't know how to do it.
Related
Please help me how to detect driver is inside car or not, means vehicle is moving or not? even if application kill( A kind of Broadcast receiver which Broadcast even app terminate )
I have tried with Activity recognition but here I need to open activity, if I will terminate app, will not get any call back.
Please help me or suggest me any solution for this for Android.
thank you
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
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.
I'm having the follow question how I'm disable Force Stop button, this is to accomplish one task of my project this is not for virus or malware or malicious things. I have to disable it for my service do not be killed because inside him it checks the time and create a file in a determinate time of system this is because my client wants to block the Android OS when it creates. I've already searched and appears if you start the with startForeground() method the force stop button became disable and another solution but i do not find much material is about create a system service if anyone know i will be happy. And if want make a suggestion for my work and works i will be very grateful. Thanks
You can't. The user is always able to stop a service on the phone, as he should be- its his phone, he can decide he doesn't want your app to run anymore.
The force close button appears because your program has entered a state in which it can no longer be executed sensibly (for instance an uncaught exception). Disabling the display of the close button will not solve your problem, you should debug your code.
Iam trying to create an app without editing the android os in such a way to notify my app whenever the user enters the patten wrong. is this possible. i was thinking about using a listener that listens to the log of the phone. i am not sure this will work though because iam quite a beginner in android.