Android notifications service - android

I want to know the process flow of android apps like i have an app in my device by which it blocks the apps in background. Eg - If the app is forbidding the whatsapp then there will not be any notification in the device untill and unless the app is opened by user.
I want to basic mechanism how the app is doing this as it blocks the apps and also disable data for that forbidden app.

You can not block notifications of any other Android Application or disable its background processes. You might be able to achieve that on a rooted device but that's something not appreciated.
Again if you want to disable data programmatically, you require a rooted device. You can read that here.
If you want to achieve Single-Purpose Device, read here.

Related

Keep Flutter application active on device at all times, possible?

A client of mine is requesting for a very specific functionality, to keep the application always active, even after the user force kills it. He wants to ensure that the users have the application active at any time while using the device on which it is installed (the devices are managed in a constrained environment).
I've done some research on it, and already enabled background services for sending the user's location, but if they force kill the app then we are unable to send locations to the server. We've seen other apps do it, but wonder how they do it.
According to https://stackoverflow.com/a/34573169/640907 it should be possible in Android. We also found https://ssaurel.medium.com/how-to-auto-restart-an-android-application-after-a-crash-or-a-force-close-error-1a361677c0ce but I don't think this will work for our use-case, as the user can close the application without "force kill" aswell..
Anyone knows how to achieve this for a Flutter application?

Is it possible to lock the complete device from a flutter app?

I want to lock my android device as soon as a particular event happens in an application. The application will keep running in the background and lock the device as soon as the event happens. I tried plugins like flutter_screen_lock but they only provide locking within the particular app while I want the complete device to get locked.
Quick answer to your question this is not possible. If it would be possible both App Distribution Providers (App- and Play Store) would not accept your App because it would be against those Rules.

Android - Manufacturer specific battery saving

Im developing a chat app which uses GCM to notify the user of incoming messages. One problem I can't seem to fix is that every manufacturer seems to implement his own battery saving in addition to the doze feature of Android. Most of the time a few apps get automatically put on the whitelist of these phones(like whatsapp).
As example Huawei uses "Protected Apps" and only if the user accepts my Intent which tries to add my App to the protected apps, only then my app works as expected.
Is there any way to get whitelisted or something like that for every manufacturer ? I can't believe I have to buy every phone on the market to test if somebody decided the doze feature is not enough.
Best Regards!

Android- programmatically restrict which apps can be run

I'm building an app that needs to restrict which apps can be run along with it.
In example, when my app is running (foreground or background) I can allow user to run only GoogleMaps, and MusicPlayer.
I've read a bit about Device Policy Controller and creating profiles, and up to some point it seems to have the feature I need, but it is designed for enterprise deployment, and user needs to encrypt their phone beforehand. Is creating personalized profiles a way to go?
My other idea was to run a service that each few milliseconds check if there is any forbidden app running and finish it, but it seems to be not robust.
Is there any way of handling this problem programmatically?
I don't think that Device Policy Controller is a right thing for you.
And you can't just kill other apps without root.
So some kind of user-friendly way to achieve the goal is to check running apps list with ActivityManager.getRunningAppProcesses and to notify user that he has to finish particular apps to use your app.

Disable notifications in Android

I have a live streaming app where you can be recording for hours and when the user receives a text message or a phone call, the vibration is trnaslated into sound and rippling video on the streaming.
Is it possible to somehow programmatically disable all notifications or do I have to ask the user to do so by himself?
You cannot control notifications from other apps. There is indeed a solution for rooted devices.
'Standards' part in this guide says:
One of the unfortunate problems Android users face is that there is no
centralized control for how notifications work. This means that if
there is an application prompting you with a notification, short of
uninstalling the application, there isn’t much you can do. Starting in
Android 4.1, users received a buried binary setting to 'Turn off
notifications’ for a specific app.
No, unfortunately not. Perhaps on rooted devices, but ¯_(ツ)_/¯. Best way seems to navigate the user to the related setting to disable all notifications, as you have also mentioned.

Categories

Resources