Galaxy watch 4 bringing application back to foreground (programmatically) - Wear OS General

Hi,
After porting Android application that previously ran on Wear OS to Galaxy watch 4 I came upon unexpected issue with bringing the application back to foreground after it was sent to background by pressing on the Home button.
In Wear OS it was a simple matter of starting an empty activity while in background what returned the application back to the fore.
In Galaxy watch 4 it doesn't work (probably due to new Google restrictions concerning opening activities while in background: https://developer.android.com/guide/components/activities/background-starts).
I was trying to resolve this issue by ambient mode but without success.
So I would really appreciate your kind assistance in solving this:
How can I bring application back to foreground programmatically in Galaxy watch 4.
Thanks in advance

kirillr said:
Hi,
After porting Android application that previously ran on Wear OS to Galaxy watch 4 I came upon unexpected issue with bringing the application back to foreground after it was sent to background by pressing on the Home button.
In Wear OS it was a simple matter of starting an empty activity while in background what returned the application back to the fore.
In Galaxy watch 4 it doesn't work (probably due to new Google restrictions concerning opening activities while in background: https://developer.android.com/guide/components/activities/background-starts).
I was trying to resolve this issue by ambient mode but without success.
So I would really appreciate your kind assistance in solving this:
How can I bring application back to foreground programmatically in Galaxy watch 4.
Thanks in advance
Click to expand...
Click to collapse
the solution is requesting the following permission:
android.permission.SYSTEM_ALERT_WINDOW
This allows app overlay that in turn allows starting activities while app in BG

Related

Step goal and sleep tracking?

Hi,
can anybody tell me how I can set another step goal (its set with 6000) - I cant find it on the app at the phone and also not on the gear... But it must be possible to change it, or??
And another question: Can the gear s2 track the sleep? If yes, how to set it or do i need another app for it?
Thanks a lot
Frank
In the S health watch app go to the far right and open the settings menu and you can set your step goal in there.
Thanks for your answer, but it works not! I had only the choice to select the source of the stepcounter (gear or phone).
If I set it to phone I can change the goal - but when I switch back to gear it back again to 6000... And I have again no chance to change it...
Crazy...
As said above, you simply go S Health settings on the watch to change it.
I got it
Thanks for your help...
Or go into s health on s2 and scroll using bezel all the way to the right to Settings and select 2nd option - Step Target, and change target there.
That's exactly what had been advised in the first reply, isn't it?
What about the sleep tracking? For now it would seem they have forgotten it.
How about how to change from phone to gear for soirce? I know its there but can't seem to find it.
Is there anyway to switch function on the S2, i find as per my Gear 2 it is inaccurate (prefer using my mobile) and it consumes battery.
(Reopen Question) How to Change Pedometer Target / Steps Goal on Gear S2
While this was answered over a year ago, either it's changed since then, or I'm misunderstanding.
I can find several S Health widgets, but I can't see the S Health APP anywhere on the S2.
There's even a Pedometer widget, but turn the bezel as i might, I don't find the three-dot menu icon, "More", or "Settings" anywhere.
The Data Source is set to the watch, not the phone. But clicking on S Health even in the Apps List just brings up the 24 Hour Activity Log.
It's a bluetooth-only version of the watch, so there's no carrier involved. I'm using it with a Note 4 on Verizon.
The software version on the S2 ends in EPK5.
Thanks for any help!
TTZ1Z said:
While this was answered over a year ago, either it's changed since then, or I'm misunderstanding.
I can find several S Health widgets, but I can't see the S Health APP anywhere on the S2.
There's even a Pedometer widget, but turn the bezel as i might, I don't find the three-dot menu icon, "More", or "Settings" anywhere.
The Data Source is set to the watch, not the phone. But clicking on S Health even in the Apps List just brings up the 24 Hour Activity Log.
It's a bluetooth-only version of the watch, so there's no carrier involved. I'm using it with a Note 4 on Verizon.
The software version on the S2 ends in EPK5.
Thanks for any help!
Click to expand...
Click to collapse
I'm running the same version
Launch the S-health app on the S2 - not any of the widgets. Rotate the bezel to the right until you see the Settings "tab". Click on the button at the bottom. Scroll down to Step Target.
Rob
Must "Start" to get to Settings
As I said in my earlier post, starting the S Health app on the S2 simply brought up the 24 Hour Log (circle showing goals for sleep, serious exercise, light exercise, etc.) Rotating the bezel did nothing.
However, if you press the "Start" button on that circle, THEN rotating the bezel will bring up various screens (or "tabs"), including Settings!
Thanks for the help.
TTZ1Z said:
As I said in my earlier post, starting the S Health app on the S2 simply brought up the 24 Hour Log (circle showing goals for sleep, serious exercise, light exercise, etc.) Rotating the bezel did nothing.
However, if you press the "Start" button on that circle, THEN rotating the bezel will bring up various screens (or "tabs"), including Settings!
Thanks for the help.
Click to expand...
Click to collapse
I just had to reset my S2 because I got a new phone and I'm having the same issue and reading every forum and Forum post out there and I cannot find how to change this on the watch. Phone is at 10k, S2 is at 6k. Wat them both at 10k. This is so aggravating. These instructions worked like 6 months ago but there is no changing the step Count on the gearas far as I can tell. I'm so annoyed right now LOL the search continues
Sent from my [device_name] using XDA-Developers Legacy app
---------- Post added at 02:21 PM ---------- Previous post was at 01:53 PM ----------
Welp of course I figure it out after commenting lol
On watch:
1. Press on step graph
2. Press on 3 dots on the right
3. Press on gear on the right
4. Press on step target
5. Change
♡ [emoji1]
Sent from my [device_name] using XDA-Developers Legacy app
Thanks for posting your response. I've been struggling for a week trying to figure this out.

Notification access settings in emotion ui?

I'm having a very, VERY difficult time getting this phone comfortably paired with my new Huawei watch. Irony of ironies, my Asus zenwatch 2 performed flawlessly for many months with the device, but since a factory reset, I can not get this to consistently stay paired with EITHER watch, leading me to believe it's an issue with the software, or the phone itself. I've got Android wear set to run with screen off, and ignoring battery optimizations, but still, many many times notifications I see received on my phone won't push to the watch, unless I open the Android wear app on my phone, at which point they forward immediately to the watch. Obviously, this is less than ideal to have to repeatedly do.
I've called Googles service number, and after very little troubleshooting they forwarded me to Huawei, who said I have to talk to the Chinese headquarters because Huawei USA doesn't service international devices. They don't have an international phone number that I've been able to find yet (Huawei USA has a wrong number listed for them.) And they haven't responded to my emails.
I've gone through many, many trial and errors trying to fix it on my own. I'd flash a custom rom if I was sure that would help, but I'm not versed in those ways, and I'd like to exhaust every other possibility before risking bricking.
I'm desperately trying to find a particular settings menu, for notification access, that emotion ui has squirrel away somewhere. I can tell it's a Huawei setting and not an android wear setting based on the aesthetics of the screen, but the only time I'm able to see this setting is when installing Android wear for the first time.
I'd like to check this setting WITHOUT having to unpair my watch and reinstall Android wear, but no amount of digging through the settings menu of emotion ui has shown me where to find it. It isn't in the notification menu, nor in permissions. Any gurus of this Android skin know where to find the notifications access settings page?
I have screenshots of the settings menu to show what I'm trying to find, but due to my post count I can't share links to them in this post, but I can pm them if that is helpful.
As an update to my situation, I discovered a slightly inelegant solution to accessing the notification access menu : I've started using an app called feel the wear to emphasize the notification vibrations, since the Huawei watch, particularly with a metal link band, is a little weak on the vibration motor. By uninstalling and reinstalling the app, it sends me to the notification access page again. The bad news, is that when my problem manifested again (after a phone restart, an event that consistently seems to be the catalyst for this) I reinstalled feel the wear, and Android wear was still enabled to have notification access.
So, to summarize, I've eliminated the following possibilities through troubleshooting that might cause the notifications to stop pushing to the watch unless I open the Android wear app on my phone (which immediately pushes the notifications to my watch.)
-notification access for Android wear
-doze settings (battery optimization is disabled for Android wear)
-Android wear has full permissions (trusted app)
-Android wear is set to auto launch, and is permitted to continue running after screen off.
Now, while I was in the notification access menu after reinstalling feel the wear, I did disable and then re-enable notification access for Android wear. This caused the watch to restart, notifications haven't delayed since that yet, but it hasn't lasted long enough for me to be comfortable that this remedies the issue.
Unpairing and repairing the watch every time this occurs isn't acceptable, is there any light to be shed on what could still be causing my problem?
Finally, if it could be any help, I'm a Tasker user, so if there is a profile I could write with a trigger when receiving a notification that might help, I have access to that utility. I tried writing one already, that, when my screen was off, would automatically open the Android wear app when receiving a notification from my three main apps that I monitor, but while the app was indeed open when I received notifications from one of those apps, it appeared that until the app was open with the screen ON, the notifications wouldn't push through, so it didn't solve my problem. Don't know if there's any action I can put in a profile that might "wake up" Android wear when I get a notification. (I hope my diligence in these Tasker pursuits illustrates the effort I've put into making this work, I adore this phone, and love Android wear, and really want them to play nicely together.)
Came across this thread while Googling for the same problem. I found a solution that while still inelegant, is better than the one you have here. I downloaded More Shortcuts. Which allows access to various settings activities that Huawei seems to hide, including Notification Access. Some of the android default stuff is there but then not functional. For example, I went to Data Usage which took me to a screen with black text on a black background, though also included a toggle and a dropdown that brings stuff up...
I tried downloading this app, but it doesn't seem to work with Nova Launcher. I'm curious to see what else I can modify
Please use the QUOTE feature when replying to me to get my attention. Thanks!

How do you toggle between current app and watch display etc?

Loving my Gear S3 Frontier but still a bit confused about using it on occassions! Can anyone tell me is there a simple way to:
1. Keep an app you are currently using on the display?
For example, while walk around the supermarket, I was using the excellent "My Notes in Gear" to work through a shopping list I'd created previously. Problem was that when the watch display turned off if I raised my wrist up to look at the screen it frequently had reverted to the watch display. Only way i could get it back to my shopping list was to select the apps view and tap on the "My Notes in Gear" app again. Surely I must be doing something wrong and there's an easier way to resume the view of an app you are currently using?
2. Easily toggle between watchface (time) display and current other app in use?
Say I'm tracking a hike in S Health but I want to check the current time. Is there an easy way to toggle from S-Health to the watchface, and then quickly switch back to S-Health tracking again?
Having had the watch a couple of weeks now I'm sure I should have a handle on these things by now, so maybe I'm just being dumb - or maybe these things are not as easy to do as they should be?!
Really, NOBODY has a solution to this??!!
SirBindy said:
It's not rocket science.
Set your double-tap home button to "last app".
Click to expand...
Click to collapse
Thanks for the tip. OK, maybe it's not rocket science but to me it seems very strange that there's is not a standard quick way to click back to a current open app. After all, on your mobile phone it's very easy.
And is there any easy/quick way to toggle between watchface (time) display and current other app in use, as when I just want to quickly check the time? Yes, I realise now I can optionally set my double-tap on the home button to view current app, but what if you prefer to set that to normally open another app like S-Health or S-Voice? Sorry, but I really think this is an aspect of typical use of a smartwatch that the designers have not fully thought through. Surely the ability to easily switch between your watchface and another app you are running should be a standard and quick operation?!
I'm having the same issue. And yes, I've set the home button to revert to my previous apps. I'd prefer, however, to raise my wrist and have the app that I was currently using still be there. For example, whenever I'm out on a run and I'm listening to music, I have to double press the home button, and select the application in order to begin toggling to the next sound track. Similar situation happens when I'm using the notes app. Does anyone know of a way to "lock" the current app so that it doesn't go away when I put my hand down?
Worked in the previous Gear 1&2&S. There are a setting for movement activation : Last screen or Clock. Very usefull, do not know why Samsung removed this setting in the Gear S2/S3 ???
It does this on Galaxy Gear too.
It makes much more sense the app you're using is just there, no need to press any button :-/
Thanks for the double tap tip.

Question; app running in foreground but screen locked

Guys,
I am using Waze app to navigate around town, but since I have installed android 7.0 on my S7, the app closes after a while when I lock the screen. I use this for when I ride my motorcycle. I use earphones to listen to the instructions that the app gives me, I do not however want my screen to be turned on and unlocked when the phone is in my pocket. Do you guys have any idea how to prevent Waze from closing whenever I lock the screen?
Thanks in advance
You could try adding Waze to the "Unmonitored apps" in Settings > Device Maintenance > Battery > (Scroll to the bottom) > Unmonitored Apps > Add Apps
See if that prevents Nougat from automatically killing it
This sadly didn't work for me, appreciate your time though
This could be a Nougat specific thing, I know people have complained that leaving multiple apps in the background as recent apps results in Nougat closing all but 6 of them, with no way to prevent it, might be worth giving Samsung a shout on Twitter, or contact Waze devs to see if they have a workaround
Good luck
I am going to contact waze about this. If anyone in the meantime strumbles up on a solution or possible workaround, please keep me posted!

Notifications fixed?

Hi,
I had an Honor Note 8 and notifications any came through if apps were open in app memory, or if they had a widget.
Adding them to a whitelist/ignoring battery optimisations did not work and notifications were blocked and only came through when you opened up the apps.
Is this fixed in the Honor Note 10?
Could any users please test by closing all open apps from app memory and seeing if notifications come through for the following apps:
eBay
Etsy
Amazon seller app
Google Hangouts
WhatsApp
Facebook messenger
This is the only thing holding me back from buying this phone. It doesn't look like a Global version will ever be released and I need to know if the Chinese ROM still kills notifications.
Thank you
Hi buddy
I have noticed when my screen is off for a bit then when I open WhatsApp loads of notifications come through.
Apps&Notifications/Battery/App Launch and set individual aps to Manage manually and turn Run in background. Now Apk does not turn off when the display is turned off ... ?
Kucko34 said:
Apps&Notifications/Battery/App Launch and set individual aps to Manage manually and turn Run in background. Now Apk does not turn off when the display is turned off ... ?
Click to expand...
Click to collapse
Even with those option it does not work on note 8. We had to remove an APK called powergenie from the system to stop it from killing app even if those app are whitelisted.
Huawei power management is too aggressive.
jbfuzier said:
Even with those option it does not work on note 8. We had to remove an APK called powergenie from the system to stop it from killing app even if those app are whitelisted.
Huawei power management is too aggressive.
Click to expand...
Click to collapse
One year I used Note 8 with Nougat and no problem with Power Management! Upon upgrading to Oreo system it automatically shuts down applications in the background, and it also does Note 10 ... ?
Phonemanager was the problem here on the Note 8. When i disabled that everyting worked great.
There are 2 settings that will totally minimize this problem (even Galaxy note 8 and iphones of my brothers are having this problem too)
but if you follow these 2 steps you will definitely minimize them as much as other phones
1. Settings/Battery/App Launch and set individual aps you like to get the notification to Manage manually
- turn all the 3 options on here (running in background , startups , and can be run by other apps) this will stop your phone from killing these specific apps from running in background
The second reason you don't get your notifications is because when your screen is off the Wifi will be disconnected first and then for a certain period of time , the system will also turn off your mobile data to save the battery as well. This means even if you have those apps running in background , you still won't get the notification because there's no internet connection....
So step 2 - go to Settings/Battery/ then look at the top right corner for the "gear" icon ,click ---- > Keep mobile data on <----- turn on option
(if you don't have mobile data plan and only rely on your wifi connection,well, you need to turn on keep your w-lan on instead )
Have fun and cheers
Sprazer said:
There are 2 settings that will totally minimize this problem (even Galaxy note 8 and iphones of my brothers are having this problem too)
but if you follow these 2 steps you will definitely minimize them as much as other phones
1. Settings/Battery/App Launch and set individual aps you like to get the notification to Manage manually
- turn all the 3 options on here (running in background , startups , and can be run by other apps) this will stop your phone from killing these specific apps from running in background
The second reason you don't get your notifications is because when your screen is off the Wifi will be disconnected first and then for a certain period of time , the system will also turn off your mobile data to save the battery as well. This means even if you have those apps running in background , you still won't get the notification because there's no internet connection....
So step 2 - go to Settings/Battery/ then look at the top right corner for the "gear" icon ,click ---- > Keep mobile data on <----- turn on option
(if you don't have mobile data plan and only rely on your wifi connection,well, you need to turn on keep your w-lan on instead )
Have fun and cheers
Click to expand...
Click to collapse
Thanks, but I did all of this on the Note 8 (when I had one) and it did nothing. All of my notifications were blocked. The only way to fix it was to remove the awful PHONE MANAGER app via the ABD removal method.
If the Note 10 is going to be the same, I'll have to pass. I just want a phone that'll work properly out of the box.
No problem with WhatsApp, messenger eBay and Facebook so far, everything comes straight thru.
I did however observe sligh delay with Gmail.
Even with Gmail widget active in the background emails come at least one minute later after sending from another device.
ultrajapa said:
No problem with WhatsApp, messenger eBay and Facebook so far, everything comes straight thru.
I did however observe sligh delay with Gmail.
Even with Gmail widget active in the background emails come at least one minute later after sending from another device.
Click to expand...
Click to collapse
I am using the Honor Mediapad X2 and having the same notifications issue, please note that there exists a HIDDEN WHITE LIST within Phone Manager where certain apps like Whatsapp are white listed and allow notifications to come through whereas other apps such as Hangouts and email clients are not. Having said this, do not use Whatsapp as a test to determine whether the Note 10 has the same issue or not. I do not know whether the Note 10's white list now includes apps such as Hangouts as it is a newer device and so it may be more up to date.
For your test, try an unpopular app which uses standard GCM protocol, kill the app, put the device into DEEP SLEEP (screen off, etc) and only then see if the device wakes up and notifications come through, they should.
Please use the QUOTE feature when replying to me to get my attention. Thanks!
The problems that i had on the Honor 8 are not on the Honor 10. I get all notifications with no problems. Just set the apps in manual mode and select all 3 options in phonemanager -> startup apps.
phorenzik said:
Hi,
I had an Honor Note 8 and notifications any came through if apps were open in app memory, or if they had a widget.
Adding them to a whitelist/ignoring battery optimisations did not work and notifications were blocked and only came through when you opened up the apps.
Is this fixed in the Honor Note 10?
Could any users please test by closing all open apps from app memory and seeing if notifications come through for the following apps:
eBay
Etsy
Amazon seller app
Google Hangouts
WhatsApp
Facebook messenger
This is the only thing holding me back from buying this phone. It doesn't look like a Global version will ever be released and I need to know if the Chinese ROM still kills notifications.
Thank you
Click to expand...
Click to collapse
Hi
I am sorry to disappoint you. On the Huawei Honor note 10 (EMUI 8.2.0 build 132) you won't receive notifications if the application is closed (not running in the background nor in the foreground), with one exception that I have found so far: WhatsApp.
All the settings you can modify only affect the application WHILE IT'S RUNNING IN THE BACKGROUND, that is, the app will keep running if the background and won't be killed if you disabled battery optimization for the specific app and changed the App Launch setting to "Manage Manually" with all 3 options enabled. However, if the application was closed by you or never launched after restarting the phone, you won't receive notifications even with disabled battery optimization and power management.
I am so frustrated, I don't even get reminder notifications from Google Keep notes app. The only workaround is to manually open all the apps you wish to get notification from when you power up the phone.
If anyone has a better workaround or has a different behavior than what I described, please advise!
Cheers,
David
godudu said:
Hi
I am sorry to disappoint you. On the Huawei Honor note 10 (EMUI 8.2.0 build 132) you won't receive notifications if the application is closed (not running in the background nor in the foreground), with one exception that I have found so far: WhatsApp.
All the settings you can modify only affect the application WHILE IT'S RUNNING IN THE BACKGROUND, that is, the app will keep running if the background and won't be killed if you disabled battery optimization for the specific app and changed the App Launch setting to "Manage Manually" with all 3 options enabled. However, if the application was closed by you or never launched after restarting the phone, you won't receive notifications even with disabled battery optimization and power management.
I am so frustrated, I don't even get reminder notifications from Google Keep notes app. The only workaround is to manually open all the apps you wish to get notification from when you power up the phone.
If anyone has a better workaround or has a different behavior than what I described, please advise!
Cheers,
David
Click to expand...
Click to collapse
David, plz see my post above. I believe there is a built-in white list which once we are able to decipher would be very happy
Could this be the white list?
/data/data/com.huawei.systemmanager/files/cootekphoneservice/white_list
https://forum.xda-developers.com/showthread.php?p=77664703
Please use the QUOTE feature when replying to me to get my attention. Thanks!
Have friends solved the notification issue?
I still keep going
nemkate said:
Have friends solved the notification issue?
I still keep going
Click to expand...
Click to collapse
Hi,
Unfortunately I believe this is per design and not a bug (Huawei strict battery saving policy.
The only way to guarantee notifications is to open the app you wish to get notifications from and keep it always running in the background.
Read the article below, it explains down to the bit level why notifications don't work on Huawei phones:
Damn I cannot post outside links because I am a new user. So Instead, search Google for this:
"why-your-push-notifications-never-see-the-light-of-day"
I hope it helps
D
godudu said:
Hi,
Unfortunately I believe this is per design and not a bug (Huawei strict battery saving policy.
The only way to guarantee notifications is to open the app you wish to get notifications from and keep it always running in the background.
Read the article below, it explains down to the bit level why notifications don't work on Huawei phones:
Damn I cannot post outside links because I am a new user. So Instead, search Google for this:
"why-your-push-notifications-never-see-the-light-of-day"
I hope it helps
D
Click to expand...
Click to collapse
I solved the problem as you said .
Hopefully correct the problem with the new update.
thank you so much :iyi::iyi::iyi:
For me no Problem with all.All Notification working.I use Mini Widgets,Whatsapp,Signal...
SmartPhonesFan said:
I don't use whatsapp that magically works but FB messenger , mails , skype , etc doesn't .. when I open messenger there is orange waiting for network so app can happily work in background but internet wifi or mobile internet will be killed anyway when phone in sleep mode ..
Click to expand...
Click to collapse
Have you checked under Phonemanager-Autostart runs in Background ?
SmartPhonesFan said:
I have tried everything..
Maybe I uninstalled something from Huawei what keeps wlan or data always on
Click to expand...
Click to collapse
This always on option is there is the developer options in my unrooted stock release.
Hello friends, I am trying to decide if buy this phone or not, but the notification is a basic feature. My most used apps are Telegram, Facebook Messenger and WhatsApp, so I want to know if there was an update or something that fixed the notification management. Thanks in advance.

Categories

Resources