Everyone in this world needed to know where is the family member and the most common way is Make A Call To Each One Is this a feasible way of doing What if someone is busy, or driving a vehicle, or he she not able to take that call right now, so in t
User Tracking Using Smartphone
Android User
.
Self driving vehicles are one of the most useful technologies in many applications such as bomb disposal, underwater exploration, industrial transport etc. Control and guidance are important aspects of research and many techniques have been proposed
Site LocationFull description
Using Vuejs or Firebase because of the ease of use and simplicity. Building a real-time guestbook app where user can post their name and URL live on our web-app. Feel free to contact us if you hav...
Nowadays, Android is the newest mobile device Operating System OS , which is the more popular in mobile device field than any other mobile OS such as i Phone OS, Windows mobile OS and so on. This has been designed to the best first step toward the ex
Its a mobile healthcare solution for rural India. Its done using android and java.Full description
Paper Title Single Object Tracking System By Using Labview Authors Divya M, Dr. Ravi kumar A V Abstract Moving object detection is an interesting area in the field of video tracking. Wh…Full description
Descripción completa
Panduan Umum tentang langkah-langkah membuat, mengompilasi dan mengunggah aplikasi Android (APK) yang dibangun dengan Delphi XE5, Delphi XE6, Delphi XE7, Delphi XE8 dan Delphi XE10 Seattle k…Full description
Descrição: Mini curso de introdução ao Google Android
Chapter No. 1 Setting Up the Development Environment Integrate Google Maps with your Android application to offer feature-rich and interactive maps For more information: http://bit.ly/1FEMBFC
the selected object can be tracked using RBF classifiers. the algorithm was implemented using OpenCV libraries.Full description
coursework for the university of manchester, not specially well doneFull description
Autocad Map 3d 2011 - User Guide
cscscscascascascascascFull description
Now a days, filtering the students for the placement drive is too difficult task to manage the student's record. To overcome these difficulties the concept CAREER TRACKING is implemented. It is to track the student's eligibility to attend the Recruit
9/12/2016
Andr oi oi d R ea eal -t -ti me me U se ser Locati on on Tr ac acki ng ng Usi ng ng Googl e M ap ap API v2
P DEVE DEVELOPM NOW LOPMENT TRENDING: ENT CHAL CHALLENG LENGE E FOR BEGI BEGINNER NNERS S
AND AN DROID
IOS (SWIFT)
STU ST UDENT HOMEWORK HELP
ANDROID ANDR OID RECO RECORD RD AND UPLO UPLOAD AD VIDEO TO SERV SERVER ER USING RETRO RETROFIT FIT 2
TIPS
ANDROID STUDENT STUDENT PROJECT IDEAS
APPS FROM $1
FORUM
Search the the site
Home Android
Android Real-time User Location Trac Tracking king Using Google Map API v2
ANDROID REAL-TIME USER USER LOCATION LOCA TION TRACKING USING GOOGLE MAP API V2 H Hen enry ry Se Sept ptem embe berr 26 26,, 2016
Andr Android oid
6 Comments Comments
In this tutorial, we we are going to to learn how to implement Android Realtime user
EMAIL SUBSCRIPTION Enter your email address:
location tracking using Google Map API v2. Tracking user
Subscribe Delivered by FeedBurner
location can be beneficial when you want to record the distance and route a user has gone through during exercise or other activities. Based on the distance, you can calculate other parameters and present a
LIKE US ON FACEBOOK
meaningful and concise result to the user. https://i nd nduc es esm ilil e. e.c om om /a /andr oi oi d/ d/andr oi oi dd- re real -t -ti me me- us user -l -l oc ocati on on- tr tr ac ac ki ki ng ng- us usi ng ng- go googl ee- ma map- ap api -v -v2/
1/23
9/12/2016
Andr oi oi d R ea eal -t -ti me me U se ser Locati on on Tr ac acki ng ng Usi ng ng Googl e M ap ap API v2
Android real-time user location tracking using Google Map API v2 are usually use in sports and social networking apps.
Induce smile Me gusta esta página
If you are looking for a way to draw path between two points on Google Map or to measures the distance and duration between
Sé el prime primero ro de tus tus amigos amigos en en indi gusta esto.
two points, I will suggest you first read my posts on these topics.
WHAT WE ARE GOING TO ACHIEVE 1. Create and load a Google Map 2. Create a Background Service that will listener to onLocationChange events 3. Send the location data to a Local Broadcast Receiver 4. Update the UI Map View using the overlay Polyline to draw route path. Before we start it is important that that we understand what we are planning to achieve in this tutorial. I have add some screen-shot from this tutorial
APP SCREENSHOT
RECENT POSTS Android Mobile Food Ordering App For Restaurant – Student’s Project Idea Exception raised during rendering: Unable to locate mode 0 Android EventBus Library Example Day 3 of the 100 Days Android App Development Challenge for Beginners Day 2 of 100 Days Android App Development Challenge for Beginners Day 1 of 100 Days Android App Development Challenge for Beginners Welcome to 100 Days Android App Development Challenge for Beginners Android Record and Upload Video to Server Using Retrofit 2 How to Program with your Android Phone Using Aide IDE Environment Android Upload Image to Server using Retrofit 2
https://i nd nduc es esm ilil e. e.c om om /a /andr oi oi d/ d/andr oi oi dd- re real -t -ti me me- us user -l -l oc ocati on on- tr tr ac ac ki ki ng ng- us usi ng ng- go googl ee- ma map- ap api -v -v2/
2/23
9/12/2016
Andr oi d R eal -ti me U ser Locati on Tr acki ng Usi ng Googl e M ap API v2
Contact me for code services
CREATE NEW ANDROID PROJECT Lets start to soil our hands in code. Start up your IDE. For this tutorial, I am using the following tools and environment, feel free to use what works for you. Windows 10 Android Studio https://i nduc esm il e.c om /andr oi d/andr oi d- real -ti me- user -l ocati on- tr ac ki ng- usi ng- googl e- map- api -v2/
3/23
9/12/2016
Andr oi d R eal -ti me U ser Locati on Tr acki ng Usi ng Googl e M ap API v2
Sony Xperia ZL Min SDK 14 Target SDK 23 To create a new android application project, follow the steps as stipulated below. Go to File menu Click on New menu Click on Android Application Enter Project name: AndroidRealtimeLocationTracking Package: com.inducesmile.androidrealtimelocationtracking Select Map Activity Name your activity: MapsActivity Keep other default selections Continue to click on next button until Finish button is active, then click on Finish Button. Since we selected default android Map Activity template, Android Contact me forthe code services
Studio will add an xml file name google_maps_api.xml. This file is stored in the values folder inside the res folder of your android project. When you open the file, it contains instruction on how to obtain a Google Map Key. Every request your application send to Google Map Server requires a unique key that will be used to identify your application. Also, there is a limit to the number of request you can send in a day if your are using the free service. Your Google map key also helps Google to keep track of the number of request coming from your app. Copy for creating a Google Map Key and paste it in a web browser and hit enter. You will see a page like this.
https://i nduc esm il e.c om /andr oi d/andr oi d- real -ti me- user -l ocati on- tr ac ki ng- usi ng- googl e- map- api -v2/
4/23
9/12/2016
Andr oi d R eal -ti me U ser Locati on Tr acki ng Usi ng Googl e M ap API v2
You can create a new project or use an existing project. Click the continue button to proceed. Click the Create AOI Key button that will appear in the next page to move over to Google API Manager page. In the Google API Manager page, click on credentials and the key link to open the page.
Contact me for code services
Add a name for your key. Select Android apps to restrict all the request from android apps Add the your application package name https://i nduc esm il e.c om /andr oi d/andr oi d- real -ti me- user -l ocati on- tr ac ki ng- usi ng- googl e- map- api -v2/
5/23
9/12/2016
Andr oi d R eal -ti me U ser Locati on Tr acki ng Usi ng Googl e M ap API v2
You can generate a SHA-1 certificate fingerprint. You will find the process on the page. Click the Save button when you are done. Finally, copy your application Google map key to the generated google_maps_api.xml as shown.
1. 2.
13.
YOUR GOOGLE MAP API KEY HERE
14.
BUILD.GRADLE In android, since we are going to make use of user location in drawing path between two points in Google Map API, we are going to use Google Play Services. Android Location Service API is part of Google Play Services. Since the library is too big and to avoid going beyond 64000 methods which will force use to multiDexEnabled true in the defaultConfig, we will use Location and Map libraries alone. https://i nduc esm il e.c om /andr oi d/andr oi d- real -ti me- user -l ocati on- tr ac ki ng- usi ng- googl e- map- api -v2/
6/23
9/12/2016
Andr oi d R eal -ti me U ser Locati on Tr acki ng Usi ng Googl e M ap API v2
Inaddition to these libraries, we are going to make use of Volley network library and Gson library. Open your application build.gradle and add the code below. 1.
ANDROIDMANIFEST.XML We are going to update our application androidmanifest.xml. Using Android Location requires that our application must request for user permission before it can access their location. Starting from android 6, location request are run time permission which the user will grant or deny while using the app. Open your AndroidManifest.xml file and add the code below. https://i nduc esm il e.c om /andr oi d/andr oi d- real -ti me- user -l ocati on- tr ac ki ng- usi ng- googl e- map- api -v2/
7/23
9/12/2016
Andr oi d R eal -ti me U ser Locati on Tr acki ng Usi ng Googl e M ap API v2
The meta-data retrieves the Google Map Key that we obtained before.
STRINGS.XML https://i nduc esm il e.c om /andr oi d/andr oi d- real -ti me- user -l ocati on- tr ac ki ng- usi ng- googl e- map- api -v2/
8/23
9/12/2016
Andr oi d R eal -ti me U ser Locati on Tr acki ng Usi ng Googl e M ap API v2
We are going to update our project strings.xml file located in the values folder inside the res folder. Open the file and add the code below to it. 1.
2.
Android Real-time Location Tracking
3.
Map Route Tracking
4.
Walk and route your path on map
5.
Please note that your location permission is important if you want to draw your route on map while walking or running
6.
Location Permission Denied
7.
Wow, please come back again when you need it and grant the permission
8.
COLORS.XML Open the colors.xml file in the same location as the strings.xml file and add the code below to the file. 1.
2.
3.
#4CAF50
Contact me for code services #388E3C 4. 5.
#C8E6C9
6.
#4CAF50
7.
#212121
8. 9. 10. 11.
#757575#FFFFFF#BDBDBD
ACTIVITY_MAP_TRACKING.XML The MapTracking class main layout file consist of a Framelayout ViewGroup with a Fragment and Button as children. Open the layout file and add the code below. 1.
MAPTRACKINGACTIVITY CLASS The MapTrackingActivity class will implement the GoogleApiClient.ConnectionCallback interface. We will create an instance of the GoogleApiClient which we will use to connect to Google Play Services and interact with the Location Service API. In the onConnection() callback method, we will create a location request and check if the our device has the right location settings before we can obtain the device current location. The GoogleApiClient object is released in the onStop() callback method. We have also created an inner RouteBroadCastReceiver class which will receive intent from the background service to update the Map route UI.
https://i nduc esm il e.c om /andr oi d/andr oi d- real -ti me- user -l ocati on- tr ac ki ng- usi ng- googl e- map- api -v2/
10/23
9/12/2016
Andr oi d R eal -ti me U ser Locati on Tr acki ng Usi ng Googl e M ap API v2
Open the MapTrackingActivity class and add the code below to it. 1.
https://i nduc esm il e.c om /andr oi d/andr oi d- real -ti me- user -l ocati on- tr ac ki ng- usi ng- googl e- map- api -v2/
15/23
9/12/2016
Andr oi d R eal -ti me U ser Locati on Tr acki ng Usi ng Googl e M ap API v2
189.
mGoogleApiClient.disconnect();
190.
super.onStop(); }
191. 192.
}
ROUTESERVICE CLASS The RouteService class is an android service class that runs in the background. The service starts when a user toggle the start tracking button and you can as well stop it with the button is the button uses a flag to tracking the state of the service class. The RouteService class implements the GoogleApiClient OnConnectionCallbacks, OnConnectionFailedListener and LocationListener. The LocationListener overrides the onLocationChange() method which pass the current location as parameter. The location is stored in SQLite database and the Service class will notify the Local Broadcast Receiver class of the location update. Open the RouteService.java file and add the code below. 1.
import android.Manifest;
2.
import android.app.Service;
3.
import android.content.Intent;
Contact me for code services import android.content.pm.PackageManager; 4. 5.
public class RouteService extends Service implements GoogleApiClient.ConnectionCallbacks, GoogleApiClient.OnConnectionFailedListener, LocationListener {
27.
private static final String TAG = RouteService.class.getSimpleName();
28.
public static final String ACTION = "com.inducesmile.androidlocationtracking.RouteServi ce";
LocationServices.FusedLocationApi.requestLocationUp dates(mGoogleApiClient, mLocationRequest, RouteService.this); https://i nduc esm il e.c om /andr oi d/andr oi d- real -ti me- user -l ocati on- tr ac ki ng- usi ng- googl e- map- api -v2/
18/23
9/12/2016
Andr oi d R eal -ti me U ser Locati on Tr acki ng Usi ng Googl e M ap API v2
}
87. 88.
}
89.
break;
90.
case LocationSettingsStatusCodes.SETTINGS_CHANGE_UNAVAIL ABLE: break;
91.
}
92.
}
93.
});
94. 95.
}
96.
@Override
97.
public void onConnectionSuspended(int i) {
98.
}
99.
@Override
100.
public void onConnectionFailed(@NonNull ConnectionResult connectionResult) { }
// send local broadcast receiver to application components
123.
Intent localBroadcastIntent = new Intent(ACTION);
124.
localBroadcastIntent.putExtra("RESULT_CODE", https://i nduc esm il e.c om /andr oi d/andr oi d- real -ti me- user -l ocati on- tr ac ki ng- usi ng- googl e- map- api -v2/
19/23
9/12/2016
Andr oi d R eal -ti me U ser Locati on Tr acki ng Usi ng Googl e M ap API v2
Log.d(TAG, "SERVICE STATE " + customSharedPreference.getServiceState());
146.
return customSharedPreference.getServiceState();
Contact me for code services }
147.
148.
@Override
149.
public void onDestroy() {
150.
mGoogleApiClient.disconnect();
151.
super.onDestroy(); }
152. 153.
}
This brings us to the end of this tutorial. I hope that you have learn something. Run your app and take a work around you will see how your location is being drawn on the map. You can download the code for this tutorial below. If you are having hard time downloading the tutorial, kindly contact me. Remember to subscribe with your email address to be among the first to receive my new android blog post once it is published.
OTHER INTERESTING POSTS: https://i nduc esm il e.c om /andr oi d/andr oi d- real -ti me- user -l ocati on- tr ac ki ng- usi ng- googl e- map- api -v2/
20/23
9/12/2016
Andr oi d R eal -ti me U ser Locati on Tr acki ng Usi ng Googl e M ap API v2
Android HTML Parser Using JSOUP Tutorial
How to Create Android Splash Screen
Android ToolBar With Tab and Horizontal Swipe View
Download Remote Audio File in Android Application
Contact for code Android Jsonme Parsing using Gson and RecyclerView
services Android Camera2 API Example Tutorial
Tags: Android Real-time User Location Tracking Using Google Map API v2, location tracking in android, location tracking with Google Map
ABOUT THE AUTHOR Henry I like Java. I breath Android and iOS. I love Yii and Javascript
https://i nduc esm il e.c om /andr oi d/andr oi d- real -ti me- user -l ocati on- tr ac ki ng- usi ng- googl e- map- api -v2/
21/23
9/12/2016
Andr oi d R eal -ti me U ser Locati on Tr acki ng Usi ng Googl e M ap API v2
6 COMMENTS
roger
October 27, 2016
Log in to Reply
Hi Henry, This is very useful tutorial. I just wonder if you can also post class source code of LocationObject as well as the database source code so that to make it as a complete example that I can learn and try. Thanks a lot Ling View Comment
Henry Author
October 27, 2016
Log in to Reply
Thanks, I will do that when time permits me. Kindly keep checking back View Comment
Contact me for code services akhil
October 27, 2016
Log in to Reply
how would i save the data travelled in sqlite and use it when i click button reroute ??? View Comment
Henry Author
October 27, 2016
Log in to Reply
I will soon provide more information with regards to saving real-time location data in SQLite database. View Comment
https://i nduc esm il e.c om /andr oi d/andr oi d- real -ti me- user -l ocati on- tr ac ki ng- usi ng- googl e- map- api -v2/
22/23
9/12/2016
Andr oi d R eal -ti me U ser Locati on Tr acki ng Usi ng Googl e M ap API v2
roger
October 29, 2016
Log in to Reply
Thanks a lot! Look forward to see the SQLite database for location data View Comment
roger
October 29, 2016
Log in to Reply
By the way , what does RecordResultActivity.class do in this app? Is it a new activity class that record the data? How is it different fromMapTrackingActivity? View Comment
ADD A COMMENT You must be logged in to post a comment.