android-geofence

Find the closest point on polygon to user location

北城以北 提交于 2019-12-29 07:14:07
问题 I have an app that find the shortest distance between my user to a polygon. I want to convert the polygon to Geofence to check the distance between the user to the area to give mor accurate information to the user. how can I do that? this is the MapsActivity public class MapsActivity extends FragmentActivity implements OnMapReadyCallback, LocationListener, MinimumDistanceTask.GetMinimumDistanceListener { private GoogleMap mMap; private LocationManager manager; private double lat, lng; private

Android Geofence only works with opened app

萝らか妹 提交于 2019-12-29 03:23:40
问题 I'm doing a serious research on this topic for many days... I saw many topics here too... But unfortunately I couldn't find a solution.... I'm writing an app that uses the new Google API for Geofence... Well, I can handle "ins" and "outs" of a geofence, but only if my app is open! Even if I'm with wifi on, gps on, and 3G on, but the app, it does not trigger any event...Just if the app is open... I'm using exactly the same GeofenceRequester class of the documentation http://developer.android

Android : Geo Fencing Receiver not calling

北城以北 提交于 2019-12-25 07:06:30
问题 I just made a demo for the Geo Fencing in android as per the documentation but here Geo Fencing Broadcast Receiver is not calling when I go out from the fence area or entered into it. Guys look the code and try to catch the issue. Thanks Kingo SplashActivity.java public class SplashActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); List<Geofence> mCurrentGeofences = new ArrayList

create android geofence in background without crashing

喜夏-厌秋 提交于 2019-12-25 02:45:14
问题 I currently have an IntentService that receives gcm messages with lat,lng infos and I would like to register a geofence in the background without a foreground app. I already tried putting the working (in an activity) code into the IntentService but I get a nullpointerexception and I have no idea why. @Override protected void onHandleIntent(Intent intent) { Bundle extras = intent.getExtras(); GoogleCloudMessaging gcm = GoogleCloudMessaging.getInstance(this); String messageType = gcm

GeoFence alert does not show

邮差的信 提交于 2019-12-23 04:26:22
问题 After adding a geofence using below code, Notification is not showing.Even onResult callback is returing the success. Adding geofence in GoogleApiClientApi onConnected() callback method: public void onConnected(Bundle bundle) { LocationServices.GeofencingApi.addGeofences( googleApiClient, getGeofencingRequest(), getGeofencePendingIntent() ).setResultCallback(this); } Requesting Geofence: private GeofencingRequest getGeofencingRequest() { geoFenceList.add(new Geofence.Builder() .setRequestId(

Geofence Android isn't working (IntentService isn't called)

那年仲夏 提交于 2019-12-22 11:25:24
问题 Here are my code : Android Manifest <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="pounya.id.location3"> <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> <application android:allowBackup="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:roundIcon="@mipmap/ic_launcher_round" android:supportsRtl="true" android:theme="@style/AppTheme"> <meta-data android:name="com

Android : Difference between LocationManager.addProximityAlert() & LocationClient.addGeofences()

隐身守侯 提交于 2019-12-21 20:37:33
问题 Both of these serve as a mechanism to notify once the user enters/exits a given point of interest. What are the pros and cons of each ? 回答1: Coming from someone who switched over to Google Play Services a while ago, i can give you some experiences: I have an app, about 2,5 years old, that uses location services extensively. From the outset, of course, we used the LocationManager since that's what was available on the Android platform. We had a pretty bad experience with Location Services on

Unable to display notification when entering GeoFence in Android

大憨熊 提交于 2019-12-21 17:27:09
问题 I am working on GeoFencing in Android and I am stuck at one point. My task is to show notification to user when he enters/exits a Geofence area defined by me. Here is my code: Activity class public class TestMapActivity extends FragmentActivity implements OnMarkerDragListener,ConnectionCallbacks, OnConnectionFailedListener,OnAddGeofencesResultListener { private static GoogleMap map; private LocationClient mLocationClient; private PendingIntent mGeofencePendingIntent; private SimpleGeoFence

Geofences not working when app is killed

跟風遠走 提交于 2019-12-20 10:40:30
问题 I know similar questions have been asked before but answers were not perfect. I created an app with geofences using the sample code from android developer website. I did not use any shared preferences to store geofences as I am not removing the geofences. I am testing the app from within the geofence, but my smartphone receives notifications every time the app runs and no notifications are observed when the app is killed. Why does this happen? I think I am supposed to receive notifications

Android: How to get the list of users with in same geofence?

帅比萌擦擦* 提交于 2019-12-20 07:55:23
问题 I have 3 Geo-fence locations(circles) stored on Firebase like Geofence_location_1(lat,lng, radius). Geofence_location_2(lat,lng, radius). Geofence_location_3(lat,lng, radius). I am able to get the user's current location and store it in Firebase. Is there a way to figure out if users current location falls with in any of the saved Geo-fence locations? OR Is it possible to get the key of Geo-fence in which the user is present? OR Is there any way to show user the list of all other users