{"id":353,"date":"2011-01-10T23:07:00","date_gmt":"2011-01-10T23:07:00","guid":{"rendered":"http:\/\/www.javacodegeeks.com\/2012\/10\/android-proximity-alerts-tutorial.html"},"modified":"2012-10-21T19:33:45","modified_gmt":"2012-10-21T19:33:45","slug":"android-proximity-alerts-tutorial","status":"publish","type":"post","link":"https:\/\/www.javacodegeeks.com\/2011\/01\/android-proximity-alerts-tutorial.html","title":{"rendered":"Android Proximity Alerts Tutorial"},"content":{"rendered":"<p>Smart-phones are taking over the mobile world, this is a fact. Since GPS devices are usually found embedded in those phones, there is already a notable rise in applications that take advantage of the offered geographical positioning functionality. A type of those applications is the one of <a href=\"http:\/\/en.wikipedia.org\/wiki\/Location-based_service\">Location Based Services<\/a>, where the service exploits knowledge about where the mobile user is globally positioned at. Pretty common are also the applications that use <a href=\"http:\/\/en.wikipedia.org\/wiki\/Geocoding\">geocoding<\/a> (finding associated geographic coordinates from geographic data, such as a street address) and <a href=\"http:\/\/en.wikipedia.org\/wiki\/GIS#Reverse_geocoding\">reverse geocoding<\/a> (providing information based on given coordinates). One other aspect of that type of applications is the creation of proximity alerts. As their name suggests, these are alerts that get generated when the user is physically located near a specific <a href=\"http:\/\/en.wikipedia.org\/wiki\/Point_of_interest\">Point Of Interest (POI)<\/a>. Proximity alert are going to be a \u201chot\u201d thing the following years, since a lot of applications are going to make use of them, with the most prominent example being targeted advertising. In this tutorial I am going to show you how to take advantage of Android&#8217;s built-in proximity alert capabilities.<\/p>\n<p>Before we begin, it would be helpful to have read introductory articles about location based application and\/or geocoding. You might want to take a look at some previous tutorials of mine, such as <a href=\"http:\/\/www.javacodegeeks.com\/2010\/09\/android-location-based-services.html\">\u201cAndroid Location Based Services Application \u2013 GPS location\u201d<\/a> and <a href=\"http:\/\/www.javacodegeeks.com\/2010\/09\/android-reverse-geocoding-yahoo-api.html\">\u201cAndroid Reverse Geocoding with Yahoo API \u2013 PlaceFinder\u201d<\/a>. One other thing to note is that this tutorial was inspired by a very cool tutorial named <a href=\"http:\/\/blog.brianbuikema.com\/2010\/07\/part-1-developing-proximity-alerts-for-mobile-applications-using-the-android-platform\/\">\u201cDeveloping Proximity Alerts for Mobile Applications using the Android Platform\u201d<\/a>. This is a four part tutorial, which gets a little complicated at some points and might intimidate a beginner. For that reason, I decided to provided a shorter and more straightforward tutorial.<\/p>\n<p>What we will build is a simple application that stores the user&#8217;s coordinates for a point that interests him and then provide a notification when the user is near that point. The coordinates are retrieved on demand when the user is located at that point.<\/p>\n<p>We begin by creating a new Eclipse project, named \u201cAndroidProximityAlertProject\u201d in our case. We also create a main activity for our application under the name \u201cProxAlertActivity\u201d. Here is what the application&#8217;s main page will look like:<\/p>\n<p><a href=\"http:\/\/1.bp.blogspot.com\/_piNjpdpJZXA\/TR9Fu4swvyI\/AAAAAAAAAP8\/vDTcCoPSyio\/s1600\/01-main-ui.png\"><img decoding=\"async\" alt=\"\" border=\"0\" src=\"http:\/\/1.bp.blogspot.com\/_piNjpdpJZXA\/TR9Fu4swvyI\/AAAAAAAAAP8\/vDTcCoPSyio\/s320\/01-main-ui.png\" style=\"cursor: pointer;height: 279px;margin: 0px auto 10px;text-align: center;width: 320px\" \/><\/a><\/p>\n<p>Here is the declaration file for the main UI layout, named \u201cmain.xml\u201d:<\/p>\n<pre class=\"brush:xml\">&lt;?xml version=\"1.0\" encoding=\"utf-8\"?&gt;\r\n\r\n&lt;LinearLayout xmlns:android=\"http:\/\/schemas.android.com\/apk\/res\/android\"\r\n    android:orientation=\"vertical\"\r\n    android:layout_width=\"fill_parent\"\r\n    android:layout_height=\"fill_parent\"\r\n&gt;\r\n\r\n    &lt;EditText \r\n        android:id=\"@+id\/point_latitude\" \r\n        android:layout_width=\"fill_parent\" \r\n        android:layout_height=\"wrap_content\"\r\n        android:layout_marginLeft=\"25dip\"\r\n        android:layout_marginRight=\"25dip\"\r\n    \/&gt;\r\n    \r\n    &lt;EditText \r\n        android:id=\"@+id\/point_longitude\" \r\n        android:layout_width=\"fill_parent\" \r\n        android:layout_height=\"wrap_content\"\r\n        android:layout_marginLeft=\"25dip\"\r\n        android:layout_marginRight=\"25dip\"\r\n    \/&gt;\r\n        \r\n    &lt;Button \r\n        android:id=\"@+id\/find_coordinates_button\" \r\n        android:text=\"Find Coordinates\"\r\n        android:layout_width=\"wrap_content\" \r\n        android:layout_height=\"wrap_content\" \r\n    \/&gt;\r\n    \r\n    &lt;Button \r\n        android:id=\"@+id\/save_point_button\" \r\n        android:text=\"Save Point\"\r\n        android:layout_width=\"wrap_content\" \r\n        android:layout_height=\"wrap_content\" \r\n    \/&gt;\r\n    \r\n&lt;\/LinearLayout&gt;\r\n<\/pre>\n<p>Let&#8217;s now get started with the interesting stuff. First of all, we need a reference to the <a href=\"http:\/\/developer.android.com\/reference\/android\/location\/LocationManager.html\">LocationManager<\/a> class, which provides access to the system location services. This is done via a call to the <a href=\"http:\/\/developer.android.com\/reference\/android\/content\/Context.html#getSystemService%28java.lang.String%29\">getSystemService<\/a> method of our activity. We can then use the <a href=\"http:\/\/developer.android.com\/reference\/android\/location\/LocationManager.html#requestLocationUpdates%28java.lang.String,%20long,%20float,%20android.location.LocationListener%29\">requestLocationUpdates<\/a> method in order to request notifications when the user&#8217;s location changes. This is not strictly required when developing proximity alerts, but I will use it here in order to calculate the distance between the point of interest and the current user location. At any given time, we can call the <a href=\"http:\/\/developer.android.com\/reference\/android\/location\/LocationManager.html#getLastKnownLocation%28java.lang.String%29\">getLastKnownLocation<\/a> method and retrieve the last known location of a specific provider, in our case the GPS device. Finally, we will make use of the <a href=\"http:\/\/developer.android.com\/reference\/android\/location\/LocationManager.html#addProximityAlert%28double,%20double,%20float,%20long,%20android.app.PendingIntent%29\">addProximityAlert<\/a> method that can be used to set a proximity alert for a location given by specific coordinates (latitude, longitude) and a given radius. We can also optionally define an expiration time for that alert if we wish to monitor the alert for a specific time period. A <a href=\"http:\/\/developer.android.com\/reference\/android\/app\/PendingIntent.html\">PendingIntent<\/a> can also be provided, which will be used to generate an <a href=\"http:\/\/developer.android.com\/reference\/android\/content\/Intent.html\">Intent<\/a> to fire when entry to or exit from the alert region is detected.<\/p>\n<p>All these are translated into code as follows:<\/p>\n<pre class=\"brush:java\">package com.javacodegeeks.android.lbs;\r\n\r\nimport java.text.DecimalFormat;\r\nimport java.text.NumberFormat;\r\n\r\nimport android.app.Activity;\r\nimport android.app.PendingIntent;\r\nimport android.content.Context;\r\nimport android.content.Intent;\r\nimport android.content.IntentFilter;\r\nimport android.content.SharedPreferences;\r\nimport android.location.Location;\r\nimport android.location.LocationListener;\r\nimport android.location.LocationManager;\r\nimport android.os.Bundle;\r\nimport android.view.View;\r\nimport android.view.View.OnClickListener;\r\nimport android.widget.Button;\r\nimport android.widget.EditText;\r\nimport android.widget.Toast;\r\n\r\npublic class ProxAlertActivity extends Activity {\r\n    \r\n    private static final long MINIMUM_DISTANCECHANGE_FOR_UPDATE = 1; \/\/ in Meters\r\n    private static final long MINIMUM_TIME_BETWEEN_UPDATE = 1000; \/\/ in Milliseconds\r\n    \r\n    private static final long POINT_RADIUS = 1000; \/\/ in Meters\r\n    private static final long PROX_ALERT_EXPIRATION = -1; \r\n\r\n    private static final String POINT_LATITUDE_KEY = \"POINT_LATITUDE_KEY\";\r\n    private static final String POINT_LONGITUDE_KEY = \"POINT_LONGITUDE_KEY\";\r\n    \r\n    private static final String PROX_ALERT_INTENT = \r\n         \"com.javacodegeeks.android.lbs.ProximityAlert\";\r\n    \r\n    private static final NumberFormat nf = new DecimalFormat(\"##.########\");\r\n    \r\n    private LocationManager locationManager;\r\n    \r\n    private EditText latitudeEditText;\r\n    private EditText longitudeEditText;\r\n    private Button findCoordinatesButton;\r\n    private Button savePointButton;\r\n    \r\n    @Override\r\n    public void onCreate(Bundle savedInstanceState) {\r\n        \r\n        super.onCreate(savedInstanceState);\r\n        setContentView(R.layout.main);\r\n        \r\n        locationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE);\r\n\r\n        locationManager.requestLocationUpdates(\r\n                        LocationManager.GPS_PROVIDER, \r\n                        MINIMUM_TIME_BETWEEN_UPDATE, \r\n                        MINIMUM_DISTANCECHANGE_FOR_UPDATE,\r\n                        new MyLocationListener()\r\n        );\r\n        \r\n        latitudeEditText = (EditText) findViewById(R.id.point_latitude);\r\n        longitudeEditText = (EditText) findViewById(R.id.point_longitude);\r\n        findCoordinatesButton = (Button) findViewById(R.id.find_coordinates_button);\r\n        savePointButton = (Button) findViewById(R.id.save_point_button);\r\n        \r\n        findCoordinatesButton.setOnClickListener(new OnClickListener() {            \r\n            @Override\r\n            public void onClick(View v) {\r\n                populateCoordinatesFromLastKnownLocation();\r\n            }\r\n        });\r\n        \r\n        savePointButton.setOnClickListener(new OnClickListener() {            \r\n            @Override\r\n            public void onClick(View v) {\r\n                saveProximityAlertPoint();\r\n            }\r\n        });\r\n       \r\n    }\r\n    \r\n    private void saveProximityAlertPoint() {\r\n        Location location = \r\n            locationManager.getLastKnownLocation(LocationManager.GPS_PROVIDER);\r\n        if (location==null) {\r\n            Toast.makeText(this, \"No last known location. Aborting...\", \r\n                Toast.LENGTH_LONG).show();\r\n            return;\r\n        }\r\n        saveCoordinatesInPreferences((float)location.getLatitude(),\r\n               (float)location.getLongitude());\r\n        addProximityAlert(location.getLatitude(), location.getLongitude());\r\n    }\r\n\r\n    private void addProximityAlert(double latitude, double longitude) {\r\n        \r\n        Intent intent = new Intent(PROX_ALERT_INTENT);\r\n        PendingIntent proximityIntent = PendingIntent.getBroadcast(this, 0, intent, 0);\r\n        \r\n        locationManager.addProximityAlert(\r\n            latitude, \/\/ the latitude of the central point of the alert region\r\n            longitude, \/\/ the longitude of the central point of the alert region\r\n            POINT_RADIUS, \/\/ the radius of the central point of the alert region, in meters\r\n            PROX_ALERT_EXPIRATION, \/\/ time for this proximity alert, in milliseconds, or -1 to indicate no expiration \r\n            proximityIntent \/\/ will be used to generate an Intent to fire when entry to or exit from the alert region is detected\r\n       );\r\n        \r\n       IntentFilter filter = new IntentFilter(PROX_ALERT_INTENT);  \r\n       registerReceiver(new ProximityIntentReceiver(), filter);\r\n       \r\n    }\r\n\r\n    private void populateCoordinatesFromLastKnownLocation() {\r\n        Location location = \r\n            locationManager.getLastKnownLocation(LocationManager.GPS_PROVIDER);\r\n        if (location!=null) {\r\n            latitudeEditText.setText(nf.format(location.getLatitude()));\r\n            longitudeEditText.setText(nf.format(location.getLongitude()));\r\n        }\r\n    }\r\n    \r\n    private void saveCoordinatesInPreferences(float latitude, float longitude) {\r\n        SharedPreferences prefs = \r\n           this.getSharedPreferences(getClass().getSimpleName(),\r\n                           Context.MODE_PRIVATE);\r\n        SharedPreferences.Editor prefsEditor = prefs.edit();\r\n        prefsEditor.putFloat(POINT_LATITUDE_KEY, latitude);\r\n        prefsEditor.putFloat(POINT_LONGITUDE_KEY, longitude);\r\n        prefsEditor.commit();\r\n    }\r\n    \r\n    private Location retrievelocationFromPreferences() {\r\n        SharedPreferences prefs = \r\n           this.getSharedPreferences(getClass().getSimpleName(),\r\n                           Context.MODE_PRIVATE);\r\n        Location location = new Location(\"POINT_LOCATION\");\r\n        location.setLatitude(prefs.getFloat(POINT_LATITUDE_KEY, 0));\r\n        location.setLongitude(prefs.getFloat(POINT_LONGITUDE_KEY, 0));\r\n        return location;\r\n    }\r\n    \r\n    public class MyLocationListener implements LocationListener {\r\n        public void onLocationChanged(Location location) {\r\n            Location pointLocation = retrievelocationFromPreferences();\r\n            float distance = location.distanceTo(pointLocation);\r\n            Toast.makeText(ProxAlertActivity.this, \r\n                    \"Distance from Point:\"+distance, Toast.LENGTH_LONG).show();\r\n        }\r\n        public void onStatusChanged(String s, int i, Bundle b) {            \r\n        }\r\n        public void onProviderDisabled(String s) {\r\n        }\r\n        public void onProviderEnabled(String s) {            \r\n        }\r\n    }\r\n    \r\n}\r\n<\/pre>\n<p>In the <a href=\"http:\/\/developer.android.com\/reference\/android\/app\/Activity.html#onCreate%28android.os.Bundle%29\">onCreate<\/a> method we hook up the location manager with a custom class that implements the <a href=\"http:\/\/developer.android.com\/reference\/android\/location\/LocationListener.html\">LocationListener<\/a> interface and allows to get notified on location changes via the <a href=\"http:\/\/developer.android.com\/reference\/android\/location\/LocationListener.html#onLocationChanged%28android.location.Location%29\">onLocationChanged<\/a> method. We will see how to handle the updates later. We also find the various UI widgets and attach <a href=\"http:\/\/developer.android.com\/reference\/android\/view\/View.OnClickListener.html\">OnClickListener<\/a>s to the buttons. <div style=\"display:inline-block; margin: 15px 0;\"> <div id=\"adngin-JavaCodeGeeks_incontent_video-0\" style=\"display:inline-block;\"><\/div> <\/div><\/p>\n<p>When the user wants to find his current coordinates, the \u201cpopulateCoordinatesFromLastKnownLocation\u201d method is invoked. Inside that, we use the <a href=\"http:\/\/developer.android.com\/reference\/android\/location\/LocationManager.html#getLastKnownLocation%28java.lang.String%29\">getLastKnownLocation<\/a> method and retrieve a <a href=\"http:\/\/developer.android.com\/reference\/android\/location\/Location.html\">Location<\/a> object. The <a href=\"http:\/\/developer.android.com\/reference\/android\/widget\/EditText.html\">EditText<\/a>s are then populated with the retrieved location information.<\/p>\n<p>Similarly, when the user wants to save the point and provide alerts for that (\u201csaveProximityAlertPoint\u201d), the location info is first retrieved. Then, we save the <a href=\"http:\/\/developer.android.com\/reference\/android\/location\/Location.html#getLatitude%28%29\">latitude<\/a> and <a href=\"http:\/\/developer.android.com\/reference\/android\/location\/Location.html#getLongitude%28%29\">longitude<\/a> information as preference data using the <a href=\"http:\/\/developer.android.com\/reference\/android\/content\/SharedPreferences.html\">SharedPreferences<\/a> class and more specifically the <a href=\"\/programs\/android-sdk-windows\/docs\/reference\/android\/content\/SharedPreferences.Editor.html\">SharedPreferences.Editor<\/a>. Finally, we create a <a href=\"http:\/\/developer.android.com\/reference\/android\/app\/PendingIntent.html\">PendingIntent<\/a> by using the <a href=\"http:\/\/developer.android.com\/reference\/android\/app\/PendingIntent.html#getBroadcast%28android.content.Context,%20int,%20android.content.Intent,%20int%29\">getBroadcast<\/a> static method. For the encapsulated <a href=\"http:\/\/developer.android.com\/reference\/android\/content\/Intent.html\">Intent<\/a>, we create an <a href=\"http:\/\/developer.android.com\/reference\/android\/content\/IntentFilter.html\">IntentFilter<\/a> and use the <a href=\"http:\/\/developer.android.com\/reference\/android\/content\/ContextWrapper.html#registerReceiver%28android.content.BroadcastReceiver,%20android.content.IntentFilter%29\">registerReceiver<\/a> method to associate a custom <a href=\"http:\/\/developer.android.com\/reference\/android\/content\/BroadcastReceiver.html\">BroadcastReceiver<\/a> with the specific intent filter. Note that this binding could alternatively be achieved in a declarative way using the manifest file.<\/p>\n<p>Now let&#8217;s examine how we handle user&#8217;s location changes. In the implemented method of the \u201cMyLocationListener\u201d class, we extract the stored location info (\u201cretrievelocationFromPreferences\u201d) from the <a href=\"http:\/\/developer.android.com\/reference\/android\/content\/SharedPreferences.html\">SharedPreferences<\/a> class. Then, we use the <a href=\"http:\/\/developer.android.com\/reference\/android\/location\/Location.html#distanceTo%28android.location.Location%29\">distanceTo<\/a> method to calculate the distance between the two locations, the current one and the one corresponding to the point of interest. This is done for debugging purposes, so that we know if we have actually entered the area around the point.<\/p>\n<p>The final step is to handle the events of entering the area of the point of interest. This is done inside the \u201cProximityIntentReceiver\u201d class that extends the <a href=\"http:\/\/developer.android.com\/reference\/android\/content\/BroadcastReceiver.html\">BroadcastReceiver<\/a> and responds to the custom intent that we attached to the location manager when adding the proximity alert. The handling occurs inside the <a href=\"http:\/\/developer.android.com\/reference\/android\/content\/BroadcastReceiver.html#onReceive%28android.content.Context,%20android.content.Intent%29\">onReceive<\/a> method, which gets invoked upon event. Inside that, we retrieve the value of the <a href=\"http:\/\/developer.android.com\/reference\/android\/location\/LocationManager.html#KEY_PROXIMITY_ENTERING\">KEY_PROXIMITY_ENTERING<\/a> key from the associated intent, which indicates whether a proximity alert is entering (true) or exiting (false). The code is the following:<\/p>\n<pre class=\"brush:java\">package com.javacodegeeks.android.lbs;\r\n\r\nimport android.app.Notification;\r\nimport android.app.NotificationManager;\r\nimport android.app.PendingIntent;\r\nimport android.content.BroadcastReceiver;\r\nimport android.content.Context;\r\nimport android.content.Intent;\r\nimport android.graphics.Color;\r\nimport android.location.LocationManager;\r\nimport android.util.Log;\r\n\r\npublic class ProximityIntentReceiver extends BroadcastReceiver {\r\n    \r\n    private static final int NOTIFICATION_ID = 1000;\r\n\r\n    @Override\r\n    public void onReceive(Context context, Intent intent) {\r\n        \r\n        String key = LocationManager.KEY_PROXIMITY_ENTERING;\r\n\r\n        Boolean entering = intent.getBooleanExtra(key, false);\r\n        \r\n        if (entering) {\r\n            Log.d(getClass().getSimpleName(), \"entering\");\r\n        }\r\n        else {\r\n            Log.d(getClass().getSimpleName(), \"exiting\");\r\n        }\r\n        \r\n        NotificationManager notificationManager = \r\n            (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);\r\n        \r\n        PendingIntent pendingIntent = PendingIntent.getActivity(context, 0, null, 0);        \r\n        \r\n        Notification notification = createNotification();\r\n        notification.setLatestEventInfo(context, \r\n            \"Proximity Alert!\", \"You are near your point of interest.\", pendingIntent);\r\n        \r\n        notificationManager.notify(NOTIFICATION_ID, notification);\r\n        \r\n    }\r\n    \r\n    private Notification createNotification() {\r\n        Notification notification = new Notification();\r\n        \r\n        notification.icon = R.drawable.ic_menu_notifications;\r\n        notification.when = System.currentTimeMillis();\r\n        \r\n        notification.flags |= Notification.FLAG_AUTO_CANCEL;\r\n        notification.flags |= Notification.FLAG_SHOW_LIGHTS;\r\n        \r\n        notification.defaults |= Notification.DEFAULT_VIBRATE;\r\n        notification.defaults |= Notification.DEFAULT_LIGHTS;\r\n        \r\n        notification.ledARGB = Color.WHITE;\r\n        notification.ledOnMS = 1500;\r\n        notification.ledOffMS = 1500;\r\n        \r\n        return notification;\r\n    }\r\n    \r\n}\r\n<\/pre>\n<p>The code is pretty straightforward. After we determine whether we have an entering or exiting proximity alert, we are ready to provide a custom notification. To do so, we first take reference of the appropriate service, i.e. the <a href=\"http:\/\/developer.android.com\/reference\/android\/app\/NotificationManager.html\">NotificationManager<\/a>. Through that service, we may send alerts to the user, wrapped around <a href=\"http:\/\/developer.android.com\/reference\/android\/app\/Notification.html\">Notification<\/a> objects. The notifications can be customized upon will and may include <a href=\"http:\/\/developer.android.com\/reference\/android\/app\/Notification.html#vibrate\">vibration<\/a>, <a href=\"http:\/\/developer.android.com\/reference\/android\/app\/Notification.html#ledARGB\">flashing lights<\/a> etc. We also added a specific icon that will appear to the status bar. The <a href=\"http:\/\/developer.android.com\/reference\/android\/app\/Notification.html#setLatestEventInfo%28android.content.Context,%20java.lang.CharSequence,%20java.lang.CharSequence,%20android.app.PendingIntent%29\">setLatestEventInfo<\/a> is preferred when we just want  to add a basic title and text message. You can find more about notifications <a href=\"http:\/\/developer.android.com\/guide\/topics\/ui\/notifiers\/notifications.html\">here<\/a>. Additionally, we can use a <a href=\"http:\/\/developer.android.com\/reference\/android\/app\/PendingIntent.html\">PendingIntent<\/a> in order to define an activity to be invoked when the user acknowledges the notification by clicking on it. However, to keep things simple, I do not use an intent to be launched in my example.<\/p>\n<p>Finally, let&#8217;s see what the Android manifest file looks like:<\/p>\n<pre class=\"brush:xml\">&lt;?xml version=\"1.0\" encoding=\"utf-8\"?&gt;\r\n\r\n&lt;manifest xmlns:android=\"http:\/\/schemas.android.com\/apk\/res\/android\"\r\n      package=\"com.javacodegeeks.android.lbs\"\r\n      android:versionCode=\"1\"\r\n      android:versionName=\"1.0\"&gt;\r\n      \r\n    &lt;application android:icon=\"@drawable\/icon\" android:label=\"@string\/app_name\"&gt;\r\n        \r\n        &lt;activity android:name=\".ProxAlertActivity\"\r\n                  android:label=\"@string\/app_name\"&gt;\r\n            &lt;intent-filter&gt;\r\n                &lt;action android:name=\"android.intent.action.MAIN\" \/&gt;\r\n                &lt;category android:name=\"android.intent.category.LAUNCHER\" \/&gt;\r\n            &lt;\/intent-filter&gt;\r\n        &lt;\/activity&gt;     \r\n\r\n    &lt;\/application&gt;\r\n    \r\n    &lt;uses-sdk android:minSdkVersion=\"3\" \/&gt;\r\n   \r\n    &lt;uses-permission android:name=\"android.permission.ACCESS_FINE_LOCATION\" \/&gt;\r\n    &lt;uses-permission android:name=\"android.permission.ACCESS_MOCK_LOCATION\" \/&gt; \r\n    &lt;uses-permission android:name=\"android.permission.ACCESS_COARSE_LOCATION\" \/&gt;\r\n    &lt;uses-permission android:name=\"android.permission.VIBRATE\" \/&gt;\r\n\r\n&lt;\/manifest&gt; \r\n<\/pre>\n<p>Nothing special here, just remember to add the necessary permissions, i.e.<\/p>\n<ul>\n<li><a href=\"http:\/\/developer.android.com\/reference\/android\/Manifest.permission.html#ACCESS_FINE_LOCATION\">ACCESS_FINE_LOCATION<\/a> <\/li>\n<li><a href=\"http:\/\/developer.android.com\/reference\/android\/Manifest.permission.html#ACCESS_MOCK_LOCATION\">ACCESS_MOCK_LOCATION<\/a><\/li>\n<li><a href=\"http:\/\/developer.android.com\/reference\/android\/Manifest.permission.html#ACCESS_COARSE_LOCATION\">ACCESS_COARSE_LOCATION<\/a><\/li>\n<li><a href=\"http:\/\/developer.android.com\/reference\/android\/Manifest.permission.html#VIBRATE\">VIBRATE<\/a><\/li>\n<\/ul>\n<p>We are now ready to test our application. Launch the Eclipse configuration. Then, go to the <a href=\"http:\/\/developer.android.com\/guide\/developing\/tools\/ddms.html\">DDMS<\/a> view of Eclipse and look for the \u201cEmulation Control\u201d tab. There, among other things, you will find the \u201cLocation Controls\u201d section, which can send mock location data to the emulator. In the \u201cManual\u201d tab, just hit the \u201cSend\u201d button, there are already some coordinates set up.<\/p>\n<p><a href=\"http:\/\/2.bp.blogspot.com\/_piNjpdpJZXA\/TR92S7vV2SI\/AAAAAAAAAQE\/QerJRvVJpJg\/s1600\/02-location-controls.png\"><img decoding=\"async\" alt=\"\" border=\"0\" src=\"http:\/\/2.bp.blogspot.com\/_piNjpdpJZXA\/TR92S7vV2SI\/AAAAAAAAAQE\/QerJRvVJpJg\/s320\/02-location-controls.png\" style=\"cursor: pointer;height: 186px;margin: 0px auto 10px;text-align: center;width: 281px\" \/><\/a><\/p>\n<p>After that, the GPS provider will have a last known location that can provide upon request. So, hit the \u201cFind Coordinates\u201d button and this is what you will get:<\/p>\n<p><a href=\"http:\/\/2.bp.blogspot.com\/_piNjpdpJZXA\/TR92gNo48cI\/AAAAAAAAAQM\/BYKtNNOiqxQ\/s1600\/03-coordinates.png\"><img decoding=\"async\" alt=\"\" border=\"0\" src=\"http:\/\/2.bp.blogspot.com\/_piNjpdpJZXA\/TR92gNo48cI\/AAAAAAAAAQM\/BYKtNNOiqxQ\/s320\/03-coordinates.png\" style=\"cursor: pointer;height: 245px;margin: 0px auto 10px;text-align: center;width: 320px\" \/><\/a><\/p>\n<p>Then, hit the \u201cSave Point\u201d in order to declare the current location as a point of interest. The location coordinates will be saved in the preferences and the proximity alert will be added to the location manager.<\/p>\n<p>Next, let&#8217;s simulate the fact that the user leaves the location. Change the value of the coordinates, for example change latitude as follows: 37.422006 ? 37.522006. We are now quite far from the point of interest. Let&#8217;s suppose now that we are approaching it, thus change the latitude to a closer value, for example:  37.522006 ? 37.423006.<\/p>\n<p><a href=\"http:\/\/1.bp.blogspot.com\/_piNjpdpJZXA\/TR92rk5FWOI\/AAAAAAAAAQU\/IbIbID7L63U\/s1600\/04-point-approached.png\"><img decoding=\"async\" alt=\"\" border=\"0\" src=\"http:\/\/1.bp.blogspot.com\/_piNjpdpJZXA\/TR92rk5FWOI\/AAAAAAAAAQU\/IbIbID7L63U\/s320\/04-point-approached.png\" style=\"cursor: pointer;height: 320px;margin: 0px auto 10px;text-align: center;width: 245px\" \/><\/a><\/p>\n<p>This is inside the radius of the point (this was set to 1000 meters) thus the alert is triggered and our receiver gets notified. There, we create our notification and send it via the notification manager. The notification appears at the status bar as follows:<\/p>\n<p><a href=\"http:\/\/2.bp.blogspot.com\/_piNjpdpJZXA\/TR92wey_HyI\/AAAAAAAAAQc\/nOo5qlkgIno\/s1600\/05-notification.png\"><img decoding=\"async\" alt=\"\" border=\"0\" src=\"http:\/\/2.bp.blogspot.com\/_piNjpdpJZXA\/TR92wey_HyI\/AAAAAAAAAQc\/nOo5qlkgIno\/s320\/05-notification.png\" style=\"cursor: pointer;height: 256px;margin: 0px auto 10px;text-align: center;width: 320px\" \/><\/a><\/p>\n<p>That&#8217;s it, a quick guide on how to implement proximity alerts with the Android platform. You can find <a href=\"http:\/\/dl.dropbox.com\/u\/7215751\/JavaCodeGeeks\/AndroidProximityAlertsTutorial\/AndroidProximityAlertProject.zip\">here<\/a> the Eclipse project created for the needs of this tutorial.<\/p>\n<div style=\"margin: 0px\"><strong><i>Related Articles :<\/i><\/strong><\/div>\n<ul>\n<li><a href=\"http:\/\/www.javacodegeeks.com\/2010\/09\/android-location-based-services.html\">Android Location Based Services Application \u2013 GPS location<\/a><\/li>\n<li><a href=\"http:\/\/www.javacodegeeks.com\/2010\/09\/android-reverse-geocoding-yahoo-api.html\">Android Reverse Geocoding with Yahoo API &#8211; PlaceFinder<\/a><\/li>\n<li><a href=\"http:\/\/www.javacodegeeks.com\/2010\/10\/android-full-application-tutorial.html\">\u201cAndroid Full Application Tutorial\u201d series<\/a><\/li>\n<li><a href=\"http:\/\/www.javacodegeeks.com\/2010\/11\/boost-android-xml-parsing-xml-pull.html\">Boost your Android XML parsing with XML Pull<\/a><\/li>\n<li><a href=\"http:\/\/www.javacodegeeks.com\/2010\/09\/android-text-to-speech-application.html\">Android Text-To-Speech Application<\/a><\/li>\n<li><a href=\"http:\/\/www.javacodegeeks.com\/2010\/06\/install-android-os-on-pc-with.html\">Install Android OS on your PC with VirtualBox<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Smart-phones are taking over the mobile world, this is a fact. Since GPS devices are usually found embedded in those phones, there is already a notable rise in applications that take advantage of the offered geographical positioning functionality. A type of those applications is the one of Location Based Services, where the service exploits knowledge &hellip;<\/p>\n","protected":false},"author":3,"featured_media":46,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11],"tags":[83,94,134],"class_list":["post-353","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-android-core","tag-android-tutorial","tag-location-based-services","tag-proximity-alerts"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Android Proximity Alerts Tutorial - Java Code Geeks<\/title>\n<meta name=\"description\" content=\"Smart-phones are taking over the mobile world, this is a fact. Since GPS devices are usually found embedded in those phones, there is already a notable\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.javacodegeeks.com\/2011\/01\/android-proximity-alerts-tutorial.html\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Android Proximity Alerts Tutorial - Java Code Geeks\" \/>\n<meta property=\"og:description\" content=\"Smart-phones are taking over the mobile world, this is a fact. Since GPS devices are usually found embedded in those phones, there is already a notable\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.javacodegeeks.com\/2011\/01\/android-proximity-alerts-tutorial.html\" \/>\n<meta property=\"og:site_name\" content=\"Java Code Geeks\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/javacodegeeks\" \/>\n<meta property=\"article:published_time\" content=\"2011-01-10T23:07:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2012-10-21T19:33:45+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/android-logo.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"150\" \/>\n\t<meta property=\"og:image:height\" content=\"150\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Ilias Tsagklis\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:site\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Ilias Tsagklis\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"12 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2011\\\/01\\\/android-proximity-alerts-tutorial.html#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2011\\\/01\\\/android-proximity-alerts-tutorial.html\"},\"author\":{\"name\":\"Ilias Tsagklis\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/person\\\/9a83496b285d30c61e8a674625c1350e\"},\"headline\":\"Android Proximity Alerts Tutorial\",\"datePublished\":\"2011-01-10T23:07:00+00:00\",\"dateModified\":\"2012-10-21T19:33:45+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2011\\\/01\\\/android-proximity-alerts-tutorial.html\"},\"wordCount\":1420,\"commentCount\":36,\"publisher\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2011\\\/01\\\/android-proximity-alerts-tutorial.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/android-logo.jpg\",\"keywords\":[\"Android Tutorial\",\"Location Based Services\",\"Proximity Alerts\"],\"articleSection\":[\"Android Core\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.javacodegeeks.com\\\/2011\\\/01\\\/android-proximity-alerts-tutorial.html#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2011\\\/01\\\/android-proximity-alerts-tutorial.html\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2011\\\/01\\\/android-proximity-alerts-tutorial.html\",\"name\":\"Android Proximity Alerts Tutorial - Java Code Geeks\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2011\\\/01\\\/android-proximity-alerts-tutorial.html#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2011\\\/01\\\/android-proximity-alerts-tutorial.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/android-logo.jpg\",\"datePublished\":\"2011-01-10T23:07:00+00:00\",\"dateModified\":\"2012-10-21T19:33:45+00:00\",\"description\":\"Smart-phones are taking over the mobile world, this is a fact. Since GPS devices are usually found embedded in those phones, there is already a notable\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2011\\\/01\\\/android-proximity-alerts-tutorial.html#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.javacodegeeks.com\\\/2011\\\/01\\\/android-proximity-alerts-tutorial.html\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2011\\\/01\\\/android-proximity-alerts-tutorial.html#primaryimage\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/android-logo.jpg\",\"contentUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/android-logo.jpg\",\"width\":150,\"height\":150},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2011\\\/01\\\/android-proximity-alerts-tutorial.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Android\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/category\\\/android\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Android Core\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/category\\\/android\\\/android-core\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Android Proximity Alerts Tutorial\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#website\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\",\"name\":\"Java Code Geeks\",\"description\":\"Java Developers Resource Center\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\"},\"alternateName\":\"JCG\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.javacodegeeks.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\",\"name\":\"Exelixis Media P.C.\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/exelixis-logo.png\",\"contentUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/exelixis-logo.png\",\"width\":864,\"height\":246,\"caption\":\"Exelixis Media P.C.\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/javacodegeeks\",\"https:\\\/\\\/x.com\\\/javacodegeeks\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/person\\\/9a83496b285d30c61e8a674625c1350e\",\"name\":\"Ilias Tsagklis\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/43505f28bb49f6e290c24be0b209ccc1af350f0f6587025ffd4847ef44bf6b78?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/43505f28bb49f6e290c24be0b209ccc1af350f0f6587025ffd4847ef44bf6b78?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/43505f28bb49f6e290c24be0b209ccc1af350f0f6587025ffd4847ef44bf6b78?s=96&d=mm&r=g\",\"caption\":\"Ilias Tsagklis\"},\"description\":\"Ilias is a software developer turned online entrepreneur. He is co-founder and Executive Editor at Java Code Geeks.\",\"sameAs\":[\"http:\\\/\\\/www.iliastsagklis.com\\\/\",\"https:\\\/\\\/www.linkedin.com\\\/in\\\/iliastsagklis\"],\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/author\\\/ilias-tsagklis\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Android Proximity Alerts Tutorial - Java Code Geeks","description":"Smart-phones are taking over the mobile world, this is a fact. Since GPS devices are usually found embedded in those phones, there is already a notable","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.javacodegeeks.com\/2011\/01\/android-proximity-alerts-tutorial.html","og_locale":"en_US","og_type":"article","og_title":"Android Proximity Alerts Tutorial - Java Code Geeks","og_description":"Smart-phones are taking over the mobile world, this is a fact. Since GPS devices are usually found embedded in those phones, there is already a notable","og_url":"https:\/\/www.javacodegeeks.com\/2011\/01\/android-proximity-alerts-tutorial.html","og_site_name":"Java Code Geeks","article_publisher":"https:\/\/www.facebook.com\/javacodegeeks","article_published_time":"2011-01-10T23:07:00+00:00","article_modified_time":"2012-10-21T19:33:45+00:00","og_image":[{"width":150,"height":150,"url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/android-logo.jpg","type":"image\/jpeg"}],"author":"Ilias Tsagklis","twitter_card":"summary_large_image","twitter_creator":"@javacodegeeks","twitter_site":"@javacodegeeks","twitter_misc":{"Written by":"Ilias Tsagklis","Est. reading time":"12 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.javacodegeeks.com\/2011\/01\/android-proximity-alerts-tutorial.html#article","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/2011\/01\/android-proximity-alerts-tutorial.html"},"author":{"name":"Ilias Tsagklis","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/person\/9a83496b285d30c61e8a674625c1350e"},"headline":"Android Proximity Alerts Tutorial","datePublished":"2011-01-10T23:07:00+00:00","dateModified":"2012-10-21T19:33:45+00:00","mainEntityOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/2011\/01\/android-proximity-alerts-tutorial.html"},"wordCount":1420,"commentCount":36,"publisher":{"@id":"https:\/\/www.javacodegeeks.com\/#organization"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/2011\/01\/android-proximity-alerts-tutorial.html#primaryimage"},"thumbnailUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/android-logo.jpg","keywords":["Android Tutorial","Location Based Services","Proximity Alerts"],"articleSection":["Android Core"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.javacodegeeks.com\/2011\/01\/android-proximity-alerts-tutorial.html#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.javacodegeeks.com\/2011\/01\/android-proximity-alerts-tutorial.html","url":"https:\/\/www.javacodegeeks.com\/2011\/01\/android-proximity-alerts-tutorial.html","name":"Android Proximity Alerts Tutorial - Java Code Geeks","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/2011\/01\/android-proximity-alerts-tutorial.html#primaryimage"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/2011\/01\/android-proximity-alerts-tutorial.html#primaryimage"},"thumbnailUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/android-logo.jpg","datePublished":"2011-01-10T23:07:00+00:00","dateModified":"2012-10-21T19:33:45+00:00","description":"Smart-phones are taking over the mobile world, this is a fact. Since GPS devices are usually found embedded in those phones, there is already a notable","breadcrumb":{"@id":"https:\/\/www.javacodegeeks.com\/2011\/01\/android-proximity-alerts-tutorial.html#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.javacodegeeks.com\/2011\/01\/android-proximity-alerts-tutorial.html"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.javacodegeeks.com\/2011\/01\/android-proximity-alerts-tutorial.html#primaryimage","url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/android-logo.jpg","contentUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/android-logo.jpg","width":150,"height":150},{"@type":"BreadcrumbList","@id":"https:\/\/www.javacodegeeks.com\/2011\/01\/android-proximity-alerts-tutorial.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.javacodegeeks.com\/"},{"@type":"ListItem","position":2,"name":"Android","item":"https:\/\/www.javacodegeeks.com\/category\/android"},{"@type":"ListItem","position":3,"name":"Android Core","item":"https:\/\/www.javacodegeeks.com\/category\/android\/android-core"},{"@type":"ListItem","position":4,"name":"Android Proximity Alerts Tutorial"}]},{"@type":"WebSite","@id":"https:\/\/www.javacodegeeks.com\/#website","url":"https:\/\/www.javacodegeeks.com\/","name":"Java Code Geeks","description":"Java Developers Resource Center","publisher":{"@id":"https:\/\/www.javacodegeeks.com\/#organization"},"alternateName":"JCG","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.javacodegeeks.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.javacodegeeks.com\/#organization","name":"Exelixis Media P.C.","url":"https:\/\/www.javacodegeeks.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","contentUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","width":864,"height":246,"caption":"Exelixis Media P.C."},"image":{"@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/javacodegeeks","https:\/\/x.com\/javacodegeeks"]},{"@type":"Person","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/person\/9a83496b285d30c61e8a674625c1350e","name":"Ilias Tsagklis","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/43505f28bb49f6e290c24be0b209ccc1af350f0f6587025ffd4847ef44bf6b78?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/43505f28bb49f6e290c24be0b209ccc1af350f0f6587025ffd4847ef44bf6b78?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/43505f28bb49f6e290c24be0b209ccc1af350f0f6587025ffd4847ef44bf6b78?s=96&d=mm&r=g","caption":"Ilias Tsagklis"},"description":"Ilias is a software developer turned online entrepreneur. He is co-founder and Executive Editor at Java Code Geeks.","sameAs":["http:\/\/www.iliastsagklis.com\/","https:\/\/www.linkedin.com\/in\/iliastsagklis"],"url":"https:\/\/www.javacodegeeks.com\/author\/ilias-tsagklis"}]}},"_links":{"self":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/353","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/comments?post=353"}],"version-history":[{"count":0,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/353\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/media\/46"}],"wp:attachment":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/media?parent=353"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/categories?post=353"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/tags?post=353"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}