locationmanager

Android: How to check that whether i reach/near my Destination?

北城余情 提交于 2019-12-13 04:35:57
问题 I am developing an application that wakeup to you when you reach/near your destination and send you notification like Alarm. Is it any way whether i check continuously user's current location and when user is near/reach destination? If it is possible than please give me sample/tutorial so that i can implement it easily. Till now,i implement below code that indicates "Notification". public class ProximityReceiver extends BroadcastReceiver { private static final int ALARM_DURATION = 6000;

android: can get location with LocationManager with Samsung Galaxy S2 in 30 seconds

…衆ロ難τιáo~ 提交于 2019-12-12 21:13:08
问题 I use LocationManager.requestLocationUpdates to request location for both GPS and network provider, and the location settings is selected in "Location and security" settings. But onLocationChanged is never called in 30 seconds. However, the code works well on other cellphone such as HTC desire. But i found there is other app such as Renren can get location in Samsung Galaxy S2. Could you anyone help to solve the problem? 回答1: You must be from china. And your galaxy S2 is sold only in china!

GPS update interval is faster with good signal?

你离开我真会死。 提交于 2019-12-12 13:53:11
问题 I'm trying to limit my program to take location updates every 10 seconds instead of constant updates in order to reduce battery drain. This works fine when i'm debugging indoors and the signal is weak (i.e. the GPS icon flashes), but if the phone gets a proper fix (i.e. the GPS icon is static) the update interval increases to roughly a second. I know that the code mLocationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, updateInterval*1000, 0, this); will not force the GPS to

onPause to stop LocationManager

倖福魔咒の 提交于 2019-12-12 11:25:13
问题 I think I’m doing this right? I have this code which starts looking for my GPS location via a MyLocationListener method not displayed here, that works but I want to stop the locationManager onPause, I think or whenever this activity is not current, but I can’t get the removeUpdates code to resolve. locationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE); locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, MINIMUM_TIME_BETWEEN_UPDATES, MINIMUM_DISTANCE

Android GPS Proximity Alert when starting within the set proximity

故事扮演 提交于 2019-12-12 10:19:54
问题 I would like to use Android's Proximity Alert for my garage door app. I have a button setup, that when pressed add's the proximity alert and starts tracking location. I want it to track indefinitely until I either enter or exit the proximity. If entering it will open the garage door, if exiting it will close the garage door after which I remove the proximity alert and GPS shuts off. I have it working close to perfectly. The problem is, when I press the button while in my driveway, hence in

How to? Listen for Location Setting being turned ON (Android App)

ⅰ亾dé卋堺 提交于 2019-12-12 07:52:30
问题 So I've spent the past few weeks working on my Android App and looking into the best way of implementing what I need to do, but still can't quite get it right.. Any/all help is greatly appreciated, as I am still getting the hang of things.. Task: (Assuming the "Location"/GPS Setting is currently off), I need to have my App constantly be listening for the "Location" Setting to be turned ON.. At this point, simply start an Activity. Ideas: These are all the different ways I think it could

Google map and passive provider

耗尽温柔 提交于 2019-12-12 03:16:17
问题 I'm working with passive provider, with this code. Intent intent = new Intent(PASSIVE_ACTION); PendingIntent pi = PendingIntent.getBroadcast(this, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT); mLocationManager = (LocationManager) getSystemService(LOCATION_SERVICE); mLocationManager.requestLocationUpdates(LocationManager.PASSIVE_PROVIDER, 0, 0, pi); and I define broadcast receiver in AndroidManifest.xml <receiver android:name="passiveLocationReceiver" android:enabled="true" > <intent-filter>

Android - Best Location Tracking Strategy

我是研究僧i 提交于 2019-12-12 01:05:58
问题 I am trying to write a location tracking service that starts as soon as the app is started, stops as soon as the app goes into the background, and restarts as soon as the app comes back to the foreground. The service should poll for a new location every 5 minutes while it is running (to conserve battery) and when a new location is found (onLocationChanged()) it updates a variable that I can retrieve from any Activity. I have tried binding a service in my custom Application class but the

LocationManager not working on Android phone

夙愿已清 提交于 2019-12-12 00:41:00
问题 I have a problem, The locationmanager is working perfectly fine when i test it in the emulator and edit the location in the DDMS screen, but when i test it on the Samsung Galaxy SII , its nog working.. Please help me. import android.app.Activity; import android.content.Context; import android.location.Location; import android.location.LocationListener; import android.location.LocationManager; import android.os.Bundle; import android.telephony.TelephonyManager; import android.view.View; import

iOS- How to avoid the dialog “Would like to use your current location”

半城伤御伤魂 提交于 2019-12-12 00:28:16
问题 In my app, one of my input is to get the location of the user as well as the contacts of the user. This is done from the code. When the user runs the app for the first time,they get a dialog "AppName" would like to use your current location. I wish to avoid this dialog since this is an important data and dont want the users to accidently press "Dont Allow" How to avoid this dialog. Could any one please let me know. Thanks 回答1: You cant make use of location services or contacts without