@@ -0,0 +1,2178 @@
+package org.shokai.gmapstars.lib;%0A%0Aimport android.app.PendingIntent;%0Aimport android.content.Context;%0Aimport android.content.Intent;%0Aimport android.util.Log;%0A%0Aimport com.google.android.gms.common.api.GoogleApiClient;%0Aimport com.google.android.gms.common.api.ResultCallback;%0Aimport com.google.android.gms.common.api.Status;%0Aimport com.google.android.gms.location.Geofence;%0Aimport com.google.android.gms.location.GeofencingRequest;%0Aimport com.google.android.gms.location.LocationServices;%0A%0Aimport org.shokai.gmapstars.GeofenceReceiveService;%0A%0Apublic class GeofenceManager %7B%0A%0A    private final static String TAG = %22GeofenceManager%22;%0A    private GoogleApiClient client;%0A    private Context context;%0A%0A    public GeofenceManager(GoogleApiClient client, Context context)%7B%0A        this.client = client;%0A        this.context = context;%0A    %7D%0A%0A    public void add(GMap.Location location, ResultCallback callback)%7B%0A        Log.i(TAG, %22add %22 + location.toString());%0A        Geofence fence = new Geofence.Builder()%0A                .setRequestId(location.url.toString())%0A                .setCircularRegion( // 500%E3%83%A1%E3%83%BC%E3%83%88%E3%83%AB%E4%BB%A5%E5%86%85%0A                        location.latitude, location.longitude, 500)%0A                .setExpirationDuration( // %E6%9C%9F%E9%99%90%E3%82%92%E6%8C%87%E5%AE%9A%E3%81%A7%E3%81%8D%E3%82%8B%0A                        Geofence.NEVER_EXPIRE)%0A                .setTransitionTypes(%0A                        Geofence.GEOFENCE_TRANSITION_ENTER)%0A                .build();%0A%0A        GeofencingRequest request = new GeofencingRequest.Builder()%0A                .setInitialTrigger(GeofencingRequest.INITIAL_TRIGGER_ENTER)%0A                .addGeofence(fence) // Geofence%E3%82%921%E3%81%A4%E7%99%BB%E9%8C%B2%0A                .build();%0A%0A        // IntentService%E3%81%A7%E5%8F%97%E3%81%91%E5%8F%96%E3%82%8B%0A        Intent intent = new Intent(context, GeofenceReceiveService.class)%0A                .putExtra(%22URL%22, location.url.toString())%0A                .putExtra(%22NAME%22, location.name);%0A%0A        PendingIntent pIntent = PendingIntent.getService(context, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT);%0A%0A        LocationServices.GeofencingApi%0A                .addGeofences(client, request, pIntent)%0A                .setResultCallback(callback);%0A    %7D%0A%0A    public void remove(GMap.Location location, ResultCallback callback)%7B%0A%0A    %7D%0A%0A%7D%0A

add class GeofenceManager