Android 4.2 GPS icon cant be removed from notification bar - android

I have a problem with the localization only in Android 4.2.2 devices.
When i use the normal process to get a localization and the fine-location permission is enabled the GPS icon never disapear.
The problem is that the icon appear even the localization is not fetched by the GPS, for example with the getLastKnownLocation (for example with this usefull tip https://code.google.com/p/android-protips-location/source/browse/trunk/src/com/radioactiveyak/location_best_practices/utils/GingerbreadLastLocationFinder.java ) or with the network provider.
The localization process is normal, based on the location best pratices: https://code.google.com/p/android-protips-location/source/browse/trunk/src/com/radioactiveyak/location_best_practices/ project
creates by Reto Meier in this post:
http://android-developers.blogspot.com.es/2011/06/deep-dive-into-location.html
Of course, the locationmanager and listener are stoped and put it to null.
The problem is only for the Android 4.2.2 version.
do you know if this is a Android bug?
Thank you in advance!

I think this describes your problem:
Google Bug report
It looks like a bug to me

Related

Android LocationManager: unexpected behavior in Android 12

Users in the field are reporting random problems with GPS location in an app.
The app has been using LocationManager for about 12 years with little modification.
I was able to see some unpredictable behavior by testing on Pixel 3 with Android 12.
The behavior includes location being off by half a mile, and not updating regularly unless some other app uses GPS.
Are there some things that are different about location manager in Android 11/12?
If so where are they documented?
The code I have has worked fine since Android 1.5.
I am using it through a library, but decompiling gave me this call:
mLocationManager.requestLocationUpdates("gps", 250, 1, listener);
I changed it to
mLocationManager.requestLocationUpdates("gps", 100, 0, listener);
It worked for a bit and then stopped working again.
The updates don't come in.
Does it need background location even though the documentation says I SHOULDN'T need background location to use location in an activity or foreground service?
If not, what the heck is going on?
Weve seen the same problem #nathanMDT which we logged initially with the SDK we thought was at fault, link below. The problem is Android 12 specifically and a change they made about a month ago to some google map permissions, all the relevant articles can be found in the below post. The devs dropped an update about 3 days ago in this tracker which im hoping will help. First response was "wait till Android 13". As a side note downgrading to Android 11 instantly fixes the frequency updates - not that this helps much.
https://issuetracker.google.com/issues/215186921?pli=1
https://github.com/mapbox/mapbox-unity-sdk/issues/1850
Foreground services still require background location permissions to access location. That's because its non obvious to the user that just because there's a notification there that it's still using GPS. And yes, this was added in Android 11: https://developer.android.com/guide/components/foreground-services#bg-access-restrictions

Samsung S8 Nougat Always On Display (AOD) api

Does anyone know if Google provides an API to configure the AON on the S8 and similar devices?
On the Display documentation I didn't find anything.
I was wondering if someone had experience creating app that make changes like, adding text, positioning image adding an app icon etc (I know the stock features do provide some of these features but I wanted to know if it was possible to do this by creating a third party app)
Thanks
After doing some research I came across a guy who has been doing some development on the Always On Display. On XDA forum he has an app that does exactly what I am looking for and he has been kind enough to provide some further info.
It's an overlay targeting the AOD, you can build overlays either by
manually adding code with Apkeditor (app) or build an overlay with
Android Studio, my mods are built with Android Studio.
There's a substratum template that should help you themeing apps.
(With overlays) https://github.com/substratum/template

android GPS location doesn't work?

I'm new to android development and I tried 2 tutorials to get the current location but neither of them work for me. I get the exact expected layout but instead of showing the location, it appears to be totally blank as if the command that sets the text field doesn't exist. The logcat doesn't show any exception that's why I didn't post it. Everything else looks normal.
I thought it might be something related to the permissions that must be ran in realtime starting from android 6.0 but this tutorial that I've tried deals with that issue, besides doesn't the lack of permissions throw a security exception ?
Here are the two tutorials that I've followed exactly as they are:
http://demonuts.com/2016/12/30/get-current-location-android-studio/
http://www.viralandroid.com/2015/12/how-to-get-current-gps-location-programmatically-in-android.html
For maps to working you need to put google_maps_key into google_maps_api.xml which is under values folder. You get this key in google api manager.

Android Activity Recognition Sample Bug

So I downloaded the Sample App for 'Recognizing the User's Current Activity' on the android website http://developer.android.com/training/location/activity-recognition.html
The problem I'm having is that when I press the 'Start Updates' button, then the 'Stop Updates' button, and then the 'Start Updates' button again, the updates don't start again the second time.
I've searched online but couldn't find much material on the topic so yeah, I've also tried debugging and found that the onDisconnected() method call (via the ConnectionCallbacks interface) isn't being called in either of the DetectionRemover.java or DetectionRequester.java files.
If anyone knows why this is happening I'd really like to know why. From what I've gathered it doesn't seem to be anything in the sample code, and I think it might be a problem on the Google Services side.
P.S. I'm using Google Play services rev 16. along with a Samsung galaxy s2 android version 4.1.2
I noticed this same problem running the sample code on my Nexus 4 (Android 4.4.4). I found that if I commented out the following line of code in the ActivityDetectionRemover continueRemoveUpdates() method, it fixed the problem:
mCurrentIntent.cancel();
Sorry, I don't yet have a good explanation as to why canceling the PendingIntent causes this issue.
UPDATE: I also commented out the cancel in the MainActivity onStopUpdates() method:
mDetectionRequester.getRequestPendingIntent().cancel();
Which is effectively doing the same thing as the first line above.

Spoofing Location

I've got an application in the browser that's customized to use Android's browser geolocation APIs. I'd like to find a way to fake the lat/lng that's sent to the browser so I can type in arbitrary coordinates.
In doing some research I came across DDMS - http://developer.android.com/guide/developing/tools/ddms.html - which seems to do what I want, but seems to require the IDE or an emulator. I don't want to use an emulator because I want to test on the device and I don't have the IDE set up for Android.
Does anyone know if there's a way to send mock location data to an Android device without loading up the IDE (or doing it through the emulator)?
I do not believe this is possible -- sorry!
Also the DDMS and IDE solutions are one and the same and only work with the emulator.
Just in case someone stumbles across this question like I did, here is some info about how to mock the LocationProvider on a physical device. Marking this as community wiki because I didn't come up with the original answer. Code is listed in diffract.me/2009/11/android-location-provider-mock (looks like domain is expired as of 9/29/2010, I used Google's cache of the page) & from stackoverflow.com/.../android-mock-location-on-device.

Categories

Resources