Thursday, June 27, 2013

[android help] how to use android geofencing api?


how to use android geofencing api?



who may concern,


i tested new google play service api.


That is geofencing. i downloaded the sample code from android developers site(http://developer.android.com/shareables/training/GeofenceDetection.zip).


i ran this code on android device(galaxy note2).


i placed my office geo-position and radius to 10m.


when i was walking to my office, nothing happened.


while running the sample code, one thing i have noticed is when I am already placed inside the geofence range and add the geofence to LocationClient at the moment.


so i read LocationClient class document(http://developer.android.com/reference/com/google/android/gms/location/LocationClient.html#addGeofences(java.util.List, android.app.PendingIntent, com.google.android.gms.location.LocationClient.OnAddGeofencesResultListener)).


i found the following paragraph.


"In case network location provider is disabled by the user, the geofence service will stop updating, all registered geofences will be removed and an intent is generated by the provided pending intent. In this case,hasError(Intent) returns true and getErrorCode(Intent) returns GEOFENCE_NOT_AVAILABLE."


so i turned on wi-fi. and was walking to my office(geofence), then i got notification "geofence entered".


i have some question.



  1. does geofencing only work with wi-fi?




  2. why not happened in 3g network?




  3. is that a sample code bug?




  4. is that my mistake?



I'm waiting for your urgent reply..


anyone help me..please.



.

stackoverflow.comm



No comments:

Post a Comment

Google Voice on T-Mobile? [General]

Google Voice on T-Mobile? So I recently switched from a GNex on Verizon to a Moto X DE on T-Mobile. I had always used Google Voice for my v...