I'm making a parental control/accountability app for android. It consists of a monitoring service that runs in the background and starts when the phone is booted.
Unfortunately, I have found that when android is started in "Safe Mode", services are not started automatically, and because of this my app has a serious flaw.
While in safe mode, the web and other apps can be started without my monitoring service running.
I thought that if it isn't possible to monitor app activity while in safe mode, maybe I could at least have my app detect if the phone was previously in safe mode. Then it could maybe alert the parent or accountability partner?
Does Android keep any log of this? Or any boot log in general?
Related
My question is more like client side.
I am using Janus AudioBridge Room to make audio call.
Android app works fine in foreground and background mode if device is not on Batter saver mode.
But when device is in Battery saver mode. App gets hold while getting into background.
When we gets back to the app. Call rejoins from there. But if it gets long enough to call 'Keepalive' event. Then app will stops or crash.
I handle this by getting this android permission explicitly from user.
"android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS"
Then in battery saver mode. our call does not affects. as our app now can work on background in battery saver mode also.
I don't think this is the best way to do that.
I checked Whatsapp permissions. They are not asking for it.
What Whatsapp or other calling applications are doing to do this in a more proficient way?
Any guide and Clue will be helpful. I appreciate
I am building an Android app that needs to be in constant Bluetooth (Classic) communication with a peripheral device. As long as the app is running in the foreground, everything is fine. But when the app is put in the background, the system kills the app after a indeterminate amount of time. The app can hang in there anywhere from 2 - 15 minutes. This happens even when the app doesn't have any battery optimisation. I hoped by turning the Battery Optimization OFF, it would prevent Android from putting the app into Standby Mode/Killing it.
If the app cannot run forever when the device is running on Battery, how long can one expect the App to exist in the background?
I wish the duration of the app's existance in the background was determinable! I appreciate any help on the matter.
Tested on Motorola G5S Plus running Android 8.1.0
The manifest file has background_running turned ON:
<meta-data android:name="android.app.background_running" android:value="true"/>
App's Target SDK is API 29: Android 10
You need to implement background service with WakeLock/Foreground Service, In service you need to write all bluetooth code that you want to run in background, Code that you wrote in activity/fragment place in service, for bluetooth callbacks need to implement Broadcast Receiver.
I'm trying to connect an App to a custom system with BLE that I added to my dog's door, which allows me to open/close it remotely as well as to know when is open "illegally" so it reproduce an alarm in my phone.
I've added the BLE class to the Main Activity and manage it from there, using fragments to see the data and sending commands.
But the problem I'm having is that, after some time, the App just close itself, breaking the BLE connection so I can't receive updates in "real time".
I don't know if is possible that the system don't kill the App, I've hear about services and that they keep the connection alive, but I'm not sure if they respect the other parts of the App or if the App get killed but the service don't. I've never worked with services before.
I've added the REQUEST_IGNORE_BATTERY_OPTIMIZATIONS permission and also disabled the memory optimization as well but it still get killed.
When the app is killed and I press the App icon to open it, it looks like a fresh start and it should be keep alive all the time. Otherwise I will have "security issues" if something happens while I'm not connected.
When de app is in the background for a while (usually about half an hour) the connection is broken. The logs do not show anything, even while I have created a partial wake lock and put the app on the Doze whitelist.
This causes the media flow to be stopped, which is not something we want to have. Since the called side then receives a hangup message, but the app does not, the media just stops flowing.
While trying to debug this, I also note that logcat is disconnected after a while (might be a android studio on mac issue. Have had more problem with this). So debugging this is very difficult.
I want to write an application that can prevent some application from launching. My requirement is to block some application for some period. So what is the way to block or prevent others application from starting or launching through my application.
My question is -- Is it possible to prevent launching other application from my application? If yes then what is the way.
I tried killing the running application. But it only kills when the application is in the background. When the application is in opened state(displayed on the screen) the killing of the application is not working.
So what is the way to block or prevent others application from starting or launching through my application.
Write your own home screen, so you are the one doing the launching, and implement your launching rules there.
This will cover basic scenarios. It will not help with:
Stopping apps that are launched via notifications (e.g., in response to an incoming SMS)
Stopping apps that are launched via other things in the system bar on tablets (e.g., some tablets let you get to the Settings app from there)
Stopping the user from rebooting their device in safe mode and getting rid of your home screen
The only way to handle those scenarios is to create your own ROM mod with adjustments to the operating system, then distribute that ROM mod (e.g., on your own devices).