Remove App is running in background notification - Android Q&A, Help & Troubleshooting

Hello guys,
I am currently developing a native Android app using Android SDK, it runs on location so the app runs in the background constantly fetching user's location. For that, android automatically shows a notification that app is running in background and user cannot remove it
I have found only that Android Oreo now gives you a feature where you can remove this notification. But this has to be done on every user's phone. Can we add something in our code that hides this for all users?
Appreciate any help.
Thank you

Related

[Q] App for Managing 'Background Data' efficiently?

Dear experts,
I'm looking for an App which allows efficient control of the 'Restrict background data' checkbox on a per-App Basis.
In ICS today I can navigate
Settings -> Data Usage -> "someAPP"
and then check/uncheck the 'Restrict background data' checkbox to make the data traffic explicit for me: If I don't use "someAPP" I can expect that there is no background data traffic generated by "someAPP" (no extra cost in roaming mode).
I do have some apps (e.g. a pushmail app for company mails) which I always want to allow the use of background data in order to get my mail.
Other's (e.g. use of gmail, G+, etc.) I want to toggle the behaviour very quickly:
If I'm in 'roaming' mode: disable, if in my home-network with flat cost: enable.
This is the reason I can't use the 'Mobile Data' switch.
Today I navigate as shown above, which is cumbersome and likely to be incomplete.
I think of an app, where you can compose a list of apps (from the installed ones) and enable/disable 'restrict background data' for apps on this list with one click.
Any idea, if an App featuring this exists?
thanx,
pottendo
PS: I've found
http://forum.xda-developers.com/showthread.php?t=1326157
which's suggestion is not exactly meeting my requirements.
Hacking support...
hi,
as there was no response I started hacking myself - based on the settings app from the AOSP tree.
With some significant help (thanx gw) I managed to extract some internal API to access the network policy manager from my app - just like the android settings app does.
The code is:
[...]
mPolicyService = INetworkPolicyManager.Stub.asInterface(
ServiceManager.getService(Context.NETWORK_POLICY_SERVICE));
[...]
... mPolicyService.getUidPolicy(packages.get(position).uid)...
[..]
Now I'm stuck at:
[...]
05-14 21:54:31.478: E/AndroidRuntime(19765): java.lang.SecurityException: NetworkPolicy: Neither user 10107 nor current process has android.permission.MANAGE_NETWORK_POLICY.
[...]
although my manifest lists:
[...]
<uses-permission android:name="android.permission.MANAGE_NETWORK_POLICY"/>
[...]
So any ideas to allow my app to behave just like the settings app?
thanx, pottendo
PS: would have posted this in the android developer forum - but still missing some posts..
Update...
Just to keep you updated (and collect some meaningful posts ): I managed to include the app within a system image (nadlabaks Milestone CM9) and set the respective permission in the manifest:
<permission androidrotectionLevel="signatureOrSystem" />
this seems to work somehow - but still not entirely.
pottendo
Solution!
hi,
finally I found the 'fix' for my application.
I moved the source of my little app to a android buildable tree and built within this framework. It get's properly signed then and either is part of my home-made mod-image, or (for a shortcut, thanx to nadlabak!) I can copy the app to /system/app on my phone via 'adb push ...' and install from the phone.
'adb install -r ...' cannot be used, as this is no option for system apps.
It works now, and I'm now able to control the BG data propery from my app. Now I should start learning java ui programming...
thanx for listening,
pottendo
Share?
Hi,
This is exacty what I'm looking for !!
Would you mind sharing your work? If yes, please email me.
Thanks !
Olivier
Sorry, overlooked your request.
I've not done too much since my last post - i've an international flatrate now.
The build setup is quite complex as internal Android interfaces are used.
I have to reverse engineer again for Android 4.2.
I'll followup ... But don't hold your breath!
pottendo
Sent from my Galaxy Nexus using xda app-developers app

[Q] Noob looking to develop an android app with push notification.

Friends, i'd like to create an android app with push notification.
I'm a noob in android app development but i've interest to learn android app programing.
Below is my requirement. I'm not sure how/where to start about this, any guidance from other android developers would be a great help
Requirement:
1) Send message with image/text/sound/video clip to all who have installed this app.
2) All past messages must be available in the app for any reference later - Something like a message thread
3) Upon receiving any new message there must an alert in the notification area at the top.
4) All messages must be available even for new installs.

App Lock

I am developing an android application to lock specific apps. It is expected to work like most app lock application.
User clicks on an app
My app detects launch of that app
Checks if it is marked by the user
If yes, puts my PIN activity over it
I have done a bit research but I couldn't find a solution that suits phones running API22(Android Lollipop 5.1.1). (I am using Nexus 4 running Lollipop 5.1.1).
I would be happy to get some references/links that would help solve my problem

How to partition display of android device to 30-70 using Android Open Source Project

I am building a project in which I need to make my app run every time like the split screen.
The first section must be 30% of screen and user can not remove/uninstall my app and even he can not kill the app.
My app needs to be run all the time and in 70% of screen the end user can run anything they want.
I am trying to understand the aosp for emulator to make a partition in android screen 30% for my app and 70% for rest of the apps.
Please do not warn me about licence and other EULA terms because my client already handling that.
I am trying to do this by modifying the SystemUI and the framework apps but no luck
Can anyone suggest the best practice to achieve this?
Thanks in advance.

How to keep an app since SDK 16 running foreground every time?

I’m building an app to monitoring the android device in Kotlin.
I’ve looked in 3 obstacles:
1 - The difference between android under and post 7.0.0 on foreground services
2 - Chinese ROMs, with an agressive kill of apps when user do a simple clean on last apps
3 - which android tool can I use for resolve it.
I’ve seen until now: AlarmManager, permanent notifications, accessibility service… Broadcast receiver to up application when system restart and battery optimization, but all my tries didn’t seem to help me in solving.
For example, the follow tutorial doesn’t work after I clean the lastest apps used in a Chinese ROM (Xiaomi): robertohuertas.com/2019/06/29/android_foreground_services
Showing permanent notification is the only way according to android docs. But chinese rom use there own task management to save battery which even closes permanent notification, If user manual cleans app from resent task. Currently i am ignoring those devices/ limited support. I am looking for better solution.

Categories

Resources