The Realwear HMT device mentions that it supports Assisted GPS. The device does not have google play service installed. There are no samples available for GPS on their Github.
How do I access the location on the device?
Accessing the location services on the HMT-1 is done via the Location Manager, which is standard Android functionality. Implementation wise, it is accomplished exactly the same as any other Android device, the only difference comes when optimizing the application for voice control. The correct permissions must be added to the manifest, but Google Play Services is not required for GPS/AGPS to function.
On the HMT, go to My Programs>'Settings'>'Page Down'>'Location'>'Mode', then say 'High Accuracy'>'Agree' to select this mode.
https://developer.android.com/reference/android/location/LocationManager
Related
I am testing an app that uses geofencing and I need to be able to specify mock locations. In my research I found old posts (5 years) talking about using Allow Mock Locations in developer options but that seems to only be in older versions of Android. Now I see a place to specify a mock location app but no way to specify one. I looked at code samples to create a mock location app but the permission that has to be set (ACCESS_MOCK_LOCATION) appears to be only valid for system apps. Is there no way to do this anymore without rooting?
Firstly, the apps that acquire ACCESS_MOCK_LOCATION appear in developer options, which means you will be able to select your app as a mock location app when you add-in manifest
Secondly, ACCESS_MOCK_LOCATION is not a system app permission. So there is no need for rooting the device or marking your app as a system app etc.
I have a web app built using react embedded in a native app using WebChrome Client.
The react app tries to read your current geolocation using HTML5 Geo Location API and show results based on that.
It is working fine for most android devices but it is not working for certain Huawei phones in African Market because Google Play Services is missing from those devices.
While there is a way to get the geolocation of the device without Google Play Service by using Android Location Manager.
But the question is how do I configure WebChromeClient to use the Android Location Manager instead of Google Play Services?
I looked at the WebChromeClient interface but found no way to do it.
Any ideas are appreciated.
Huawei Location Kit may help with your issue.
Location Kit provides capabilities for you to obtain the precise user device location quickly, helping you build up global positioning capabilities and expand your global business. Currently, Location Kit offers two modes for accessing its capabilities.
Android : The Location SDK for Android offers location-related APIs for your Android apps. These APIs mainly related to four functions: fused location, activity identification, geofence, and high-precision location. This mode is applicable to mobile phones and Huawei tablets.
REST API : REST APIs of Location Kit enable you to initiate requests using HTTPS to call location-related capabilities, including geofence and GeoLocation (API). This mode is applicable to web clients.
For Details, pls kindly refer Docs.
Huawei also has provided some HMS Core kit plugins for React Native:
Reference documents
Location Kit plugins for React Native
#Fred,
Using Android Management API how can we get the Location information of a device. Do we need to install any 3rd party application to get the location? How Location modes impact Location information?
There is currently no way to do this using Android Management API. You can use a policy to enable the location mode but you will need another 3rd party application to get the location of the device. You can check this post on how to set the location policy.
For the location mode options, you can refer to this link. However, for devices running Android 9 and 10, setting the locationmode to any mode other than OFF or LOCATION_DISABLED will just turn on the location.
I have some android devices remote from me. And I have own app and root remote access on it. The app can give me devices' GPS coordinates via internet. But It works only if device is signed up in google account. Remote devices are not.
So how I can sign up remotely(using android rooted shell, or some app) or get GPS coordinates without signing up?
I'm not sure where you or the other user are getting your data from, but there's no need for Google account to get location.
There's a simple step by step to get it done https://developer.android.com/training/location/receive-location-updates.html and no where it says anything about Google account.
If you want to use the FusedLocationProvider (as per link) the device must have Google Play Services installed on it. That's an app that is automatically installed by Google on all devices that have Google Play Store.
If your devices does not have Google Play Store installed then you must use the LocationManager https://developer.android.com/reference/android/location/LocationManager.html by calling this code:
LocationManager lm =
(LocationManager) context.getSystemServices(Context.LOCATION_SERVICE);
and making the relevat calls on the lm instance to receive location updates.
Both methods need location permissions on your AndroidManifest.xml but none needs the user to have a Google Account.
The Location Services using not only the GPS but also the surrounding WiFi networks and network localisation are services provided by Google, unrelated to GPS global technology.
The network/wifi localisation service REQUIRES a Google Account to work.
I have a service which receives locations through registering a LocationManager.requestLocationUpdates.
But there have been some issues on some phones.
When battery runs low, the network location provider stops sending location fixes (this problem is addressed in this SO question). It's not a only a problem with my app but also the other apps just stop receiving locations.
Even when the phone is recharged the problem persists until the full reboot.
However, I found out (and someone also mentioned it in the SO question above) that Google Maps still keeps receiving location updates - when I open Google Maps app it shows the correct location and updates.
So I was thinking about a workaround of using locations from Google Maps API. I have absolutely no experience with the Maps API, but it seems that it needs a proper GUI (Activity) application to be used with. Or am I wrong? Is there a possibility to use Google Maps API to receive locations even within the Service?
Given some extensive testing from a reliable source, I believe that you might want to consider using the FusedLocationProvider supplied with Google Play Services. It seems to take the headache out of choosing the appropriate power criteria and so on.
Be aware that this will require that the user must have Google Play installed on their device, so Kindles and the like will be out of the picture. It also requires a minimum of Android 2.2.
Some more information about the location services provided by Google Play Services can be found here.