ProductsLogo
LogoStudy Documents
LogoAI Grader
LogoAI Answer
LogoAI Code Checker
LogoPlagiarism Checker
LogoAI Paraphraser
LogoAI Quiz
LogoAI Detector
PricingBlogAbout Us
logo

MapLocationNTrack: A GPS-based Android App

Verified

Added on  2023/04/23

|19
|2830
|84
AI Summary
MapLocationNTrack is an Android app that enables people to track and locate their location during a trip using GPS and other location-based features. The app uses Google location-based services to enable the properties of Google Maps. The article discusses the app's specification, virtual demo, design, implementation, and testing observations and results. The app is aimed at geo-locating the user and supporting minor movement with directional information. The features of Maps, GPS, and compass are combined and used efficiently.

Contribute Materials

Your contribution can guide someone’s learning journey. Share your documents today.
Document Page
Running head: MapLocationNTrack: A GPS-based Android App
MapLocationNTrack: A GPS-based Android App
Name of the Student:
Name of the University:
Author Note

Secure Best Marks with AI Grader

Need help grading? Try our AI Grader for instant feedback on your assignments.
Document Page
1AppendixAppendix
Introduction
In this enormous world, it is important to geographically locate a person’s position in
the planet, without the person’s requirement to viable to be technically literate, and also the
feature should be free-to-all. As a reminder, all the printed maps need some sort of routes or
landmarks on the material for the usefulness of the reference, however, current location is an
absent feature. The feature is enabled by GPS receiver. It also ensures the security of humans
through tracking and encourages the explorative desires of humans. The possibility of a user
to locate themselves in a map and see their movement according to their destination is an
exciting feature.
With respect to the above described scenarios, an application has been created to meet
the requirements to geo-location tracking, using GPS and other location based features. The
name of the application is MapLocationNTrack. The following study consists the
application’s stages of specification, virtual demonstration, design, implementation and the
testing observations and results.
Specification
MapLocationNTrack, is an application which proposes an easy, simple and portable
solution to enable people track and locate their location during a trip. It uses Google location
based services to enable the properties of Google Maps. This is a web-based application and
is scoped to fulfil the criterions of-
1. Run a small Android application on a mobile phone.
2. Has a connection between GPS and the application.
3. Has Internet access.
Document Page
2AppendixAppendix
The focus of the project is moreover on “Where he/she is?” than “Where are we?”. The
idea is to use a mobile phone application, to accept the GPS co-ordinates, and show the user’s
location and, movement of users are determined by the compass directions. The whole
application is aimed to geo-locate the user and support minor movement with directional
information. The features of Maps, GPS and compass are combined, and used efficiently. The
location is tracked down using both GPS and network signals.
Document Page
3AppendixAppendix
Virtual Demo
Figure 1: Visual demonstration of MapLocationNTrack

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
4AppendixAppendix
Following images show the recorded events while the application was enabled. The
positions were exactly accurate. The location pin reacted to movements of the user. The
directional arrow can be observed via constant motion of the individual using the application,
at any instance.
Design
Figure 2: Design View
The following application was designed in the .xml files. The extraction of the unique
Google API key enabled the access of Maps SDK for android platform. The intent filters
created connection between the MapsActivity and the design of the application. The view is
Document Page
5AppendixAppendix
in 2D road map view and the satellite, hybrid and others are ignored due to complexity to
users. The whole layout is generated under MapsActivity layout.
In the Figure 2, the model shows the general idea of the MapLocationNTrack
application’s layout. After the user grants GPS access to the application, the application
directs to the current location of the individual. The current location is determined by the
‘Map-pin’ icon. Clicking on the Map-pin, further creates a pop-up comment box over the pin,
which says ‘My Location’ and defines the address as more zoom-in is applied. Also, compass
enables the directional movement of the user, which is denoted by the Arrow symbol (beside
the pin). The compass icon, at the top right centralizes the user location, if the user moves
around in the map application, and loses track of his location. The circling area designates the
signal range and how far the compass can move for a speculated amount of time. However,
an error was observed in the design mode of activity_maps.xml, which was hard to resolve.
Moreover, the goal of the app’s design was to be simple and easy to understand and, to be
used by any individual. It is rightfully fulfilled.
Implementation
MapLocationNTrack was coded on the Android Studio platform. It was configured in
Java Language. The selected activity was MapsActivity and Google API key gave access to
the maps platform. In the mapsactivity.java class:
public class MapsActivity extends FragmentActivity implements
OnMapReadyCallback, GoogleApiClient.ConnectionCallbacks,
GoogleApiClient.OnConnectionFailedListener, LocationListener {
private GoogleMap mMap;
private GoogleApiClient googleApiClient;
private LocationRequest locationRequest;
Document Page
6AppendixAppendix
private Location lastLocation;
private Marker currentUserLocationMarker;
private static final int Request_User_Location_Code = 99;
Following are the local variables that were passed and were frequently used in the
program interface.
public void onMapReady(GoogleMap googleMap) {
mMap = googleMap;
mMap.setMyLocationEnabled(true);
UiSettings settings = mMap.getUiSettings();
mMap.getUiSettings();
settings.setTiltGesturesEnabled(false);
settings.setCompassEnabled(true);
settings.setTiltGesturesEnabled(true);
settings.setMyLocationButtonEnabled(true);
settings.setMapToolbarEnabled(false);
The use of LocationListener function enabled use of GPS. The application accesses
the UI settings of the platform and also, the compass option is enabled through the passing of
‘settings.setCompassEnabled (true)’. The motion movements are also calculated via
‘settings.setTiltGesturesEnabled (true)’ command.
public boolean checkUserLocationPermission() {
if (ContextCompat.checkSelfPermission(this, permission.ACCESS_FINE_LOCATION) !=
PackageManager.PERMISSION_GRANTED)
{
if (ActivityCompat.shouldShowRequestPermissionRationale(this,
Manifest.permission.ACCESS_FINE_LOCATION))
{
ActivityCompat.requestPermissions(this, new String[]
{permission.ACCESS_FINE_LOCATION}, Request_User_Location_Code);
} else {

Secure Best Marks with AI Grader

Need help grading? Try our AI Grader for instant feedback on your assignments.
Document Page
7AppendixAppendix
ActivityCompat.requestPermissions(this, new String[]
{permission.ACCESS_FINE_LOCATION}, Request_User_Location_Code);
}
return false;
}
else {
return true;
}
}
The following commands were implemented to receive permission from the user’s
mobile device, which will further ask the location codes of the user and attach it to the map.
The enabling of GPS feature is authenticated in this part. The use of
ACCESS_FINE_LOCATION is to receive permissions from both the Network_Provider and
GPS_Provider.
public void onLocationChanged(Location location) {
lastLocation = location;
if (currentUserLocationMarker != null) {
currentUserLocationMarker.remove();
}
LatLng latLng = new LatLng(location.getLatitude(), location.getLongitude());
MarkerOptions markerOptions = new MarkerOptions();
markerOptions.position(latLng);
markerOptions.title("My location");
markerOptions.icon(BitmapDescriptorFactory.defaultMarker(BitmapDescriptorFactory.HU
E_MAGENTA));
currentUserLocationMarker = mMap.addMarker(markerOptions);
mMap.moveCamera(CameraUpdateFactory.newLatLng(latLng));
Document Page
8AppendixAppendix
mMap.animateCamera(CameraUpdateFactory.zoomBy(15));
if (googleApiClient != null) {
LocationServices.FusedLocationApi.removeLocationUpdates(googleApiClient,
this);
}
}
The settings from LocationListener class extends multiple subclasses.
Onlocationchanged is one of the subclasses. Here, the GPS commands are implemented to
locate the point according to the user location. The camera zoom is set to 15 for more
zooming in and out.
public void onConnected(@Nullable Bundle bundle) {
{
locationRequest = new LocationRequest();
locationRequest.setInterval(1100);
locationRequest.setFastestInterval(1100);
locationRequest.setPriority(LocationRequest.PRIORITY_BALANCED_POWER_ACCURACY);
if (ContextCompat.checkSelfPermission(this,
permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED) {
LocationServices.FusedLocationApi.requestLocationUpdates(googleApiClient,
locationRequest, this);
}
}
}
Document Page
9AppendixAppendix
This section initiates the time signalling and the movement sensing abilities.
OnConnected is also another subclass of the same LocationListener. After the map is
connected, the update feature of the currently running app is set accordingly.
Moreover, the implementation methods have been successful and, no such errors and
warnings (only one) have been observed to occur, in the process.
Testing
The application has been started and checked several times. Location tracking,
movement changes and drawing tracks were recorded in multiple periods. The system was
also challenged in conditions: low memory capacity, unstable server response and so on.
Moreover, the tests were executed under messy and complex developer environment, under
limitation of proper setup. Overall, the test results were successful. The major problems were
identified in few scenarios.
During testing period, some problems were experienced, yet they were not as many as
expected. The list of the most severely calculated problems were:
A serious corruption of Maps Location detection was experienced, as the location was
changing within 5-7 seconds of time span, with a great difference between the source
and the next modified location. The code was accordingly modified to remove the
issue.
At least two times, the application MapLocationNTrack was observed to crash, and
needed to be re-installed. However, this is only a free version software.
The design of the application was simple. However, professional officials may require
more services, such as searching nearby places, distance and time to other places and
so on. The additional features could be added in the future.

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
10AppendixAppendix
There was a minor network delay during the starting period of the application.
Conclusion
GPS is a wonderful tool. It provides endless possibilities to any individual through
navigation, instead of regular compass-chart usage. The confidence of exploring and going
places can be motivated by the use of such apps which provides the GPS features. Thus, the
proposed application (MapLocationNTrack) is a step forward to help support the goals of
GPS’s achievements. More improvements in the application would provide additional
features, which would create more excitement and opportunities to the lifestyles of the
people. The application is currently in its initial phase and has few limitation in offering to
users, however, is importantly build up to the mark and according to the specifications
defined. Moreover, the aim of the project has been met and therefore, the scope of future
work is to be examined.
Document Page
11AppendixAppendix
Bibliography
AlMajed, H. and Khamis, A., 2017. DEVELOPMENT OF ALocation-BASED
APPROACHING NOTIFICATION SYSTEM USING ANDROID
PLATFORM. Computer Science & Information Technology, p.107.
bin Aftab, M.U. and Karim, W., 2014. Learning android intents. Packt Publishing Ltd.
Darwin, I.F., 2017. Android Cookbook: Problems and Solutions for Android Developers. "
O'Reilly Media, Inc.".
Hellman, E., 2013. Android programming: pushing the limits. John Wiley & Sons.
Hohensee, B., 2014. Android For Beginners. Developing Apps Using Android Studio.
Babelcube Inc..
Kumar, G.K., Aishwarya, C.B. and Mounika, A.S., 2016. College bus tracking android
application using GPS. International Journal of New Innovations in Engineering and
Technology, 4(4), pp.40-44.
Lee, J.K. and Lee, J.Y., 2015, September. Android programming techniques for improving
performance. In 2015 3rd International Conference on Awareness Science and
Technology (iCAST) (pp. 386-389). IEEE.
Matthew, S. and Mill, I., 2014. Future practicability of Android application development with
new Android libraries and frameworks. International Journal of Computer Science
and Information Technologies, 5(4), pp.5575-5579.
Mithapelli, N., Chavan, S. and Kumari, J., 2016. Alumni Tracking Using Google Map API
and Social Media based on GPS and LBS. International Journal of Engineering
Science, 25(11).
Rogers, R., Lombardo, J., Mednieks, Z. and Meike, B., 2018. Android application
development: Programming with the Google SDK. O'Reilly Media, Inc..
Smyth, N., 2017. Android Studio 3.0 Development Essentials-Android 8 Edition. Payload
Media, Inc..
Zapata, B.C., 2013. Android studio application development. Packt Publishing Ltd.
Document Page
12AppendixAppendix
Appendix
package com.example.maplocationntrack;
import android.Manifest;
import android.content.pm.PackageManager;
import android.location.Location;
import android.os.Build;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.app.ActivityCompat;
import android.support.v4.app.FragmentActivity;
import android.os.Bundle;
import android.support.v4.content.ContextCompat;
import android.widget.Toast;
import com.google.android.gms.common.ConnectionResult;
import com.google.android.gms.common.api.Api;
import com.google.android.gms.common.api.PendingResult;
import com.google.android.gms.common.api.Status;
import com.google.android.gms.location.LocationListener;
import com.google.android.gms.common.api.GoogleApiClient;
import com.google.android.gms.location.LocationRequest;
import com.google.android.gms.location.LocationServices;
import com.google.android.gms.maps.CameraUpdateFactory;
import com.google.android.gms.maps.GoogleMap;
import com.google.android.gms.maps.OnMapReadyCallback;
import com.google.android.gms.maps.SupportMapFragment;
import com.google.android.gms.maps.UiSettings;

Secure Best Marks with AI Grader

Need help grading? Try our AI Grader for instant feedback on your assignments.
Document Page
13AppendixAppendix
import com.google.android.gms.maps.model.BitmapDescriptor;
import com.google.android.gms.maps.model.BitmapDescriptorFactory;
import com.google.android.gms.maps.model.LatLng;
import com.google.android.gms.maps.model.Marker;
import com.google.android.gms.maps.model.MarkerOptions;
import java.io.FileDescriptor;
import java.io.PrintWriter;
import java.util.concurrent.TimeUnit;
import static android.Manifest.*;
import static com.google.android.gms.maps.GoogleMap.*;
public class MapsActivity extends FragmentActivity implements OnMapReadyCallback,
GoogleApiClient.ConnectionCallbacks, GoogleApiClient.OnConnectionFailedListener,
LocationListener {
private GoogleMap mMap;
private GoogleApiClient googleApiClient;
private LocationRequest locationRequest;
private Location lastLocation;
private Marker currentUserLocationMarker;
private static final int Request_User_Location_Code = 99;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_maps);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
Document Page
14AppendixAppendix
checkUserLocationPermission();
}
// Obtain the SupportMapFragment and get notified when the map is ready to be used.
SupportMapFragment mapFragment = (SupportMapFragment)
getSupportFragmentManager().findFragmentById(R.id.map);
mapFragment.getMapAsync(this);
}
@Override
public void onMapReady(GoogleMap googleMap) {
mMap = googleMap;
mMap.setMyLocationEnabled(true);
UiSettings settings = mMap.getUiSettings();
mMap.getUiSettings();
settings.setTiltGesturesEnabled(false);
settings.setCompassEnabled(true);
settings.setTiltGesturesEnabled(true);
settings.setMyLocationButtonEnabled(true);
settings.setMapToolbarEnabled(false);
if (ContextCompat.checkSelfPermission(this, permission.ACCESS_FINE_LOCATION)
== PackageManager.PERMISSION_GRANTED) {
buildGoogleApiClient();
mMap.setMyLocationEnabled(true);
}
Document Page
15AppendixAppendix
}
public boolean checkUserLocationPermission() {
if (ContextCompat.checkSelfPermission(this, permission.ACCESS_FINE_LOCATION)
!= PackageManager.PERMISSION_GRANTED)
{
if (ActivityCompat.shouldShowRequestPermissionRationale(this,
Manifest.permission.ACCESS_FINE_LOCATION))
{
ActivityCompat.requestPermissions(this, new String[]
{permission.ACCESS_FINE_LOCATION}, Request_User_Location_Code);
} else {
ActivityCompat.requestPermissions(this, new String[]
{permission.ACCESS_FINE_LOCATION}, Request_User_Location_Code);
}
return false;
}
else {
return true;
}
}
@Override
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions,
@NonNull int[] grantResults) {
switch (requestCode) {
case Request_User_Location_Code:
if (grantResults.length > 0 && grantResults[0] ==
PackageManager.PERMISSION_GRANTED) {
if (ContextCompat.checkSelfPermission(this,
permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED)
{

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
16AppendixAppendix
if (googleApiClient == null) {
buildGoogleApiClient();
}
mMap.setMyLocationEnabled(true);
}
} else {
Toast.makeText(this, "PERMISSION DENIED",
Toast.LENGTH_SHORT).show();
}
return;
}
}
protected synchronized void buildGoogleApiClient() {
googleApiClient = new
GoogleApiClient.Builder(this).addConnectionCallbacks(this).addOnConnectionFailedListene
r(this).addApi(LocationServices.API).build();
googleApiClient.connect();
}
@Override
public void onLocationChanged(Location location) {
lastLocation = location;
if (currentUserLocationMarker != null) {
currentUserLocationMarker.remove();
Document Page
17AppendixAppendix
}
LatLng latLng = new LatLng(location.getLatitude(), location.getLongitude());
MarkerOptions markerOptions = new MarkerOptions();
markerOptions.position(latLng);
markerOptions.title("My location");
markerOptions.icon(BitmapDescriptorFactory.defaultMarker(BitmapDescriptorFactory.HUE
_MAGENTA));
currentUserLocationMarker = mMap.addMarker(markerOptions);
mMap.moveCamera(CameraUpdateFactory.newLatLng(latLng));
mMap.animateCamera(CameraUpdateFactory.zoomBy(15));
if (googleApiClient != null) {
LocationServices.FusedLocationApi.removeLocationUpdates(googleApiClient, this);
}
}
@Override
public void onConnected(@Nullable Bundle bundle) {
{
locationRequest = new LocationRequest();
locationRequest.setInterval(1100);
locationRequest.setFastestInterval(1100);
locationRequest.setPriority(LocationRequest.PRIORITY_BALANCED_POWER_ACCURA
CY);
Document Page
18AppendixAppendix
if (ContextCompat.checkSelfPermission(this,
permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED)
{
LocationServices.FusedLocationApi.requestLocationUpdates(googleApiClient,
locationRequest, this);
}
}
}
@Override
public void onConnectionSuspended(int i) {
}
@Override
public void onConnectionFailed(@NonNull ConnectionResult connectionResult) {
}
}
1 out of 19
[object Object]

Your All-in-One AI-Powered Toolkit for Academic Success.

Available 24*7 on WhatsApp / Email

[object Object]