Force android Gmail sync in background - android

The Gmail app on my phone is not syncing email anymore unless it is opened in foreground.
(This is a known issue on several OnePlus devices after the Android 11 upgrade).
Is there any activity or intent that can be used to force the sync in the background?
At this moment I'm giving a shot to some Macrodroid / Tasker scripts but it works only if the app is opened in foreground.
I'm looking for something that can be triggered in background.

Related

Xamarin Forms [Android] Silent Push while App in Background => Freeze

I have a App that i now wanted to expand with Silent Push Functionality for a customers Feature Request.
But now i encounter a rather strange behaviour(app freeze)
The Used Xamarin.Forms Version is 4.8.0.1451 (Updates did not solve the problem)
The Problem is Android Only related
Normal Notifications work as expected and dont produce any error
Here the quick Behaviour:
Receiving Silent Pushes works if the app is in Foreground (Multible times no limit)
Bringing the App to the Background and back to Foreground works also flawles
Do i Receive a Silent Push while the App is in Background or the Device is Locked and i bring back the App to Foreground/Unlock the device the app seems frozen (unresponsive and App.OnResume does not get executed)
(Also to note: i can only receive 1 silent push when the app is in Background/Device is locked)
For now i dont do anything on receiving the Silen push (to isolate this error)
Debug output aswell as LogCat does not provide any info what so ever.
i could not track any managed code that does execute and not return properly from some method calls
i can reproduce this problem on android 11(Pixel3) and android 9(Blackview A60)
I hope someone here has an idea what this problem could be.
It more informations or details are needed, i happily provide
In Android, starting in Android 8.0 (API level 26), an Android application no longer have the ability to run freely in the background.
When in the foreground, an app can start and run services without
restriction. When an application moves into the background, Android
will grant the app a certain amount of time to start and use services.
Once that time has elapsed, the app can no longer start any services
and any services that were started will be terminated. At this point
it is not possible for the app to perform any work.
For more details about this, you can refer to Background Execution Limits in Android 8.0.

How can i prevent my app stopped when phone Reboot in flutter?

I was working on flutter app and my app mainly works in background so , what I want is to run my app continuously without stopping when the phone is rebooted, or at any means my app should run in background forever.
so, is there any mechanism in flutter to do This?
this can only be done on Android side on IOS when user closes the app its process will be killed shortly after (we are talking seconds or minutes).
on Android you can achieve this by using a ForegroundService plugin like android_long_task

I don't want my Android app to auto-update onto users devices

We're currently running tests (that end in 2 weeks) with clients using an "older" version of our app.
The older app has a long-running scanner foreground service that will not restart on the MY_PACKAGE_UPDATE broadcast (wasn't implemented at the time). The new version of the app correctly handles this broadcast and restarts the scanning on MY_PACKAGE_UPDATE.
We need to roll out updates mid-test to fix a bug appearing on only some devices, and we are able to reach out to those specific users. The problem is that for any current users with auto-update turned on, their foreground scanning service will exit and not restart.
Am I correct that the MY_PACKAGE_UPDATE broadcast won't kick in yet? As in, it'll only begin working two updates from now?
Is there a way for me to turn off auto-updating for my app in the play store for all users?

Not getting push notification when swipe from recent

I'm not getting notification when user swipe the app from recent. I've notice that behavior occurs in some specific device for instance I've tested it on nexus devices and HTC devices it's working fine but when user swipe the app from the recent in huawei and some samsung devices it doesn't show notification. I mean i don't get onMessageReceived() callback
After some research I found out that in these devices when user swipe it from recent it force stop the app (the process is completely killed) and I don't get any notification. In huawei they have protected and unprotected apps and if I add the app in protected list from the setting, I start getting notification because i this case it doesn't force stop the app. and I believe in samsung they have the same thing with blacklist and whitelist apps.
I've also tried some solutions like restart the service onTaskRemoved() callbacks or make your app START_STICKY. I've also tried WakefulBroadcastReceiver but nothing is working for me.
So my question is how can i get notification even if it gets forced stop, like it's happening when swiping app from recent.
An old question, but I think it’s important to know that HUAWEI has a feature called “power-intensive app monitor “. It kills every app that runs in the background for a long time unless user gives special permissions to it.
The path to do this:
Settings -> Security & privacy -> Location services -> recent location requests: YOUR APP NAME -> Battery -> uncheck Power-intensive prompt, App launch: Manage manually: check all three positions: Auto-launch, secondary launch, run in background.
I don’t know if there's a way to do this programmatically. I think the best way is to create a sort of help activity and explain the user what to do if application won’t work.

Android 5.0 force stop behavior

Just update to Android 5.0 by OTA. The biggest find is that if a user Force Stop my app(in System Setting), my app stops right now. And my app cannot receive any broadcast anymore, even if my receiver is registered in AndroidManifest.xml. More surprisingly, when the user reboot the device, my app even cannot receive android.permission.RECEIVE_BOOT_COMPLETED broadcast.
Does anyone pay attention to this?
Yes, I just noticed that on my Nexus 5, and I'm really loving it!
When the user "Force Stop" an app in Settings->Apps, it will be TOTALLY stopped and is black listed from receiving any broadcasts UNTIL the user open the app from the launcher.
I see it as a way like the "Disable" of system apps, you completely disable this app until you open it again.
I see this really very useful as I have lots of apps that are using unnecessary services in the background like Facebook for instance.

Categories

Resources