gps

Battery life if using GPS and background app ios/android

*爱你&永不变心* 提交于 2019-12-08 07:57:06
问题 I was wondering if anyone has created an app that starts in the background and utilizes the GPS to gather the current Lat and Long every minute or so? If you have, would you please provide your battery times? As in, how long does your phone last until its all out of juice from just running that background app with standard cell phone programs. I'm trying to see if it would be worth the time to create an app for myself but if i work for 8 hours and dont have a way of charging my phone during

Unity3D - Get smooth speed and acceleration with GPS data

左心房为你撑大大i 提交于 2019-12-08 07:56:29
问题 I'm using Unity3D and I created simple distance, speed and acceleration calculator using latitude and longitude of last position. I'm calculating last distance, speed and acceleration in each GPS update (approximately once per second). But sometimes (2-3 second interval) latitude and longitude values changes rapidly (in clear weather and no obstacles). That's why speed and acceleration values gets unreal results. For example, at stable 40 km/h speed, speed value becomes 60 km/h and returns to

Prevent app from crash when network unavailable

拜拜、爱过 提交于 2019-12-08 07:22:44
问题 I have an app which has a foreground notification started from a service. The service calls at each second a class which serves as a GPS connection. The GPS class uses NETWORK_PROVIDER and GPS_PROVIDER . All worked correct so far, except for today until something happened. At some point a message was displayed by Android system saying something like "Unless you connect to wifi network or mobile network, you will not be able to access email and internet". I don't remember well the message, but

How do you determine with CLLocationManager when a user denies access to location services?

∥☆過路亽.° 提交于 2019-12-08 07:09:27
With CLLocationManager I can use the following code to determine if I can access location services on the device. This is the master setting for all apps and can be turned on and off. if (self.locationManager.locationServicesEnabled) { [self.locationManager startUpdatingLocation]; } But a user can deny access to an individual app and in order to not execute the code to use the location manager I need to know if the user approved access to location services for this specific app. I saw that at one point there was a property called locationServicesApproved which appears it would indicate if the

Android LocationListener leave on while phone asleep

风流意气都作罢 提交于 2019-12-08 07:07:29
I set an alarm with the flag RTC_WAKEUP to run a IntentService every 30 seconds to transmit location updates to a server. I'm planning to change the flag to RTC so it won't wake up the phone and just run when another process wake ups the phone. If I leave a LocationListener registered, will it still listen for location updates while the phone is asleep? Yes - working location service has it's own wake lock. However better approach is manually set proper wake lock in your broadcast receiver. Please consider some optimization - sending data over network every 30s will drain battery. You have

Increasing Battery Life on Windows Mobile using GPS and Web updates

一笑奈何 提交于 2019-12-08 07:02:45
问题 I have an app that runs on Windows Mobile and uses the GPS to update its location at various intervals. As expected, enabling the GPS chip uses more battery power. (no duh..) So currently my technique has been to cycle the the GPS on/off at approx. every 4 minutes to acquire the location, do something if things changed, and update its location to the web only if necessary. Otherwise, shut it off again and wait. On my one year old HTC Touch Diamond phone, with a fresh charge, leaving the

Getting Android Location and return “unknown” or null when providers are unavailable

百般思念 提交于 2019-12-08 06:58:31
问题 I'm using this script by Fedor but I want a little difference: When both GPS and Network Provider is unavailable, I want to app to return null or "unknown" string. I modified the script, but when I run, it force closes, the logcat says: I have the following codes: MyLocation.java package com.example.GetALocation2; import java.util.Timer; import java.util.TimerTask; import android.content.Context; import android.location.Location; import android.location.LocationListener; import android

修改Android定位

≡放荡痞女 提交于 2019-12-08 06:50:09
更新 【2019.11.14】 增加了 Android10 的适配 修复了判断模拟位置权限出错的bug 修改了启动后crash的bug,其他没什么大的改动了 哦对了,有朋友反应说开启/关闭按钮遮挡比例尺了,我把按钮往中间移动了一点 下载地址: https://github.com/Hilaver/MockGPS/raw/dev/app/release/MockGPS_v1.9.6.191114_beta.apk 记录一个问题:open failed: EACCES (Permission denied) 日志模块读写文件的权限问题,但是怎么改都不对,总是permission denied 解决方案贴这里: https://stackoverflow.com/a/57653808/11497581 manifest中的application增加一行: <manifest ... > <!-- This attribute is "false" by default on apps targeting Android Q. --> <application android:requestLegacyExternalStorage="true" ... > ... </application> </manifest> 更新 【2019.05.14】 Version 1.9.5测试版 1

Problem in Getting the Current Location in Android

懵懂的女人 提交于 2019-12-08 06:32:42
问题 I want to display latitude and longitude my current location.. For this rather than searching in Google, i searched in SO. I just want to display my current location latitude and longitude. See my code below : public class LocationGetter extends Activity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); TextView tv = new TextView(this); LocationManager mlocManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE); LocationListener

Different GPS Location Reading Of Same Physical Location on Windows Phone GeoCoordinateWatcher

人走茶凉 提交于 2019-12-08 05:13:13
问题 I am getting coordinates with Windows Phone GeoWatcher like this private GeoCoordinateWatcher _watcher = new GeoCoordinateWatcher(GeoPositionAccuracy.High); _watcher.MovementThreshold = 2; // Threshold Value _watcher.PositionChanged += Watcher_PositionChanged; //Registering Watcher Position Change Event _watcher.Start(); // Starting Watcher //Watcher position Change Event private void Watcher_PositionChanged(object sender, GeoPositionChangedEventArgs<GeoCoordinate> e) { var coord = new