Android Application Development Using:550699

Question:

  1. Programming task (Group-based – max 3 per group) (50 marks)

You can choose only one of the two following tasks: programmable web or High Performance Computing.

 

1.A      Programmable Web task

The web is full of web services and restful services that can be used to build web applications by accessing their APIs. This directory allows searching among a wide list of RESTful service APIs http://www.programmableweb.com/

 

In the list there are documentation about Facebook API, Twitter, eBay, Amazon, location services, and many other web services that can be used. The goal of this task is to choose one of these service APIs and write a tutorial about the chosen API with a final presentation to the rest of the class. Each group has to choose a different API and the allocation will be on a First Come First Served policy. The tutorial will have to:

 

  1. Describe the chosen API

Google Maps

– Java Google Maps API

Create PP on API too

  1. Show how to connect to the web service with a Java client

Java Client

Create class which connects to the API / Show maps/ buttons allow directions to see go to directions / go to different locations/ use different functions

 

Android App Preferable !

  1. Show at least one existing web application using this API

https://www.lonelyplanet.com/guides

 

  1. Use the chosen API to implement a simple application of your choice: be creative!

E.g. Website or Phone app but what platform can we create It on ?

Java web application which creates a page / runs on server

Phone

Java Swing

 

 

  1. Combine the chosen API and one or more different APIs to implement a simple application of your choice: be creative!

Integrate with 1st app

Another API be Creative

 

 

 

 

 

  1. Research Presentation (max 2 per group) (50 marks)

The assignment consists in choosing one of the advanced topics in distributed systems and preparing a seminar/demonstration for the class.

The seminar will analyse and discuss the problem, tools, state of the art solutions, and current research in order to give a good overview of the chosen topic.  You are required to write a seminar/demonstration (with PowerPoint slides) lasting 20 minutes at most.

Seminars will be scheduled for the last week of the module on Wednesday 26th of April.

During the module, an example of past seminar will be provided by the lecturer.

The seminar on a particular topic should cover the following aspects:

  • Definition and explanation of the characteristics of the topic analysed
  • Description of current state of the art tools and technologies
  • Description of state of the art of research: references and brief description of recent papers from IEEExplore, ACM Digital Library, Springer, ScienceDirect.
  • Open Research Problems and Discussion

Answer:

Introduction

The API or the Application Programmer Interface is a tool that is used by the developers to submitting queries through their application and getting answers from Google against those quarries (Espinha, Zaidman and Gross 2014). This techniques is used by the developers for both the android applications and websites. This APIs can provide the developers to provide location based services through the Application and the websites by determining the location of the services.

About Google Map API

The Google Map API is one of the most popular APIs used by the developers. This API provides several utilities to the users to add individual contents to the available Google Map on their devices and various web application that can be easily explored based on this content.  It (Google Map API) is a JavaScript technology that helps the users to embed Maps in their web pages and android applications (Király and Abonyi 2015). This API is fully integrated with Google AJAX API and can be used with it efficiently. This API framework enables the developers to load one API key for all the supported Google AJAX APIs. In addition to that, it also provides a unique namespace for every API, which allows the multiple APIs to operate together on the applications.

. The Maps used by applications is encapsulated in the Map Fragment class. A MapFragment object helps the application to adjust the map rendering for different screen sizes of the different devices (Such as phone and tablets). Typically an Android application only have to extend the Activity rather than the MapActivity used in that particular version.

The Google Maps API utilizes different types of vector tiles (faster and smaller).  Using the API the caching functionality is improved, it helps the users to see the map without empty areas. In addition to that the tilting of the device can help the users to view the map displayed on 3D.

Tutorial for Googles maps API

In order to develop an android application using the Google Maps API we have to follow the following steps,

Obtaining a Google API key– In order to access the Google Map servers using the Maps API, a Maps API key is required to integrate with the application. For this, developer have to register with a project on the Google API Console (via console.developers.google.com), and acquire a signing certificate for their android application.

Downloading and configuring the Google Play Services SDK– Google Maps API is provided as a part of the Google play services SDK. The developed apps can have advantage of the latest and improved features such as Google+, Maps and many more (Doshi Jain and Shakwala 2014).

Specifying the settings in the Application Manifest– The settings for this android applications includes user permissions that is important for the application to access the Android system features of the device and to connect Google Maps servers (Király and Abonyi 2015).

Adding new map to an existing or new Android project– The maps API also enables the users to include many other features such as markers, captions, and routes.

Publishing the developed application– Finally the developed application is installed  in the devices or uploaded to the Internet for distribution in different app stores like the Google Play stores for public to use of the application.

Code examples and explanation

public class MapsActivity extends FragmentActivity implements OnMapReadyCallback {

private GoogleMap mMap;
LocationManager lctnmngr;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_maps);
// 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);
lctnmngr = (LocationManager) getSystemService(LOCATION_SERVICE);
if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
// TODO: Consider calling

return;
}
if(lctnmngr.isProviderEnabled(LocationManager.NETWORK_PROVIDER)){
lctnmngr.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, 0, 0, new LocationListener() {
@Override
public void onLocationChanged(Location location) {

double latitude= location.getLatitude();
double longitude=location.getLongitude();
LatLng ltln= new LatLng(latitude, longitude);
Geocoder gc= new Geocoder(getApplicationContext());

try {
List <Address> addressList= gc.getFromLocation(latitude, longitude, 1);
String st= addressList.get(0).getLocality()+“,”;
st+=addressList.get(0).getCountryName();
mMap.addMarker(new MarkerOptions().position(ltln).title(st));
mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(ltln, 5.2f));

} catch (IOException e) {
e.printStackTrace();
}

}

@Override
public void onStatusChanged(String provider, int status, Bundle extras) {

}

@Override
public void onProviderEnabled(String provider) {

}

@Override
public void onProviderDisabled(String provider) {

}
});
}
else if(lctnmngr.isProviderEnabled(LocationManager.GPS_PROVIDER)){
lctnmngr.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, 0, new LocationListener() {
@Override
public void onLocationChanged(Location location) {
double latitude= location.getLatitude();
double longitude=location.getLongitude();
LatLng ltln= new LatLng(latitude, longitude);
Geocoder gc= new Geocoder(getApplicationContext());

try {
List <Address> addressList= gc.getFromLocation(latitude, longitude, 1);
String st= addressList.get(0).getLocality()+“,”;
st+=addressList.get(0).getCountryName();
mMap.addMarker(new MarkerOptions().position(ltln).title(st));
mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(ltln, 5.2f));

} catch (IOException e) {
e.printStackTrace();
}
}

@Override
public void onStatusChanged(String provider, int status, Bundle extras) {

}

@Override
public void onProviderEnabled(String provider) {

}

@Override
public void onProviderDisabled(String provider) {

}
});
}

}


@Override
public void onMapReady(GoogleMap googleMap) {
mMap = googleMap;

// Add a marker in Sydney and move the camera
//LatLng sydney = new LatLng(-34, 151);
// mMap.addMarker(new MarkerOptions().position(sydney).title(“Marker in Sydney”));
// mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(sydney, 5.2f));
}
}

The above is the code segment of our developed android application that tracks the location of users of the android device.  The “LocationManager” class helps the application to access the system location services. The location services helps the android application to have periodic updates about the geographical location of the device either using the GPS_PROVIDER or the NETWORK_PROVIDER.   The “onLocationChanged” method helps the device to update the location information in the application by acquiring the latitude and longitude using the getLatitude() and   getLongitude() functions.

Conclusion

In this project we have developed an application that tracks the location of android device owner using the Google Maps API and another application integrating the Google Maps direction API.   The Google Maps direction API with Street View   helps the users to get a better overview of a certain area or locality.  The developers uses this APIs to provide  information about a  place as well as helps the users to explore the surrounding neighborhood  of that location or land mark by virtually wandering through the nearby streets. This leads to the improvement of the overall experience of finding and travelling any new city throughout the world.

 

References

Király, A. and Abonyi, J., 2015. Redesign of the supply of mobile mechanics based on a novel genetic optimization algorithm using Google Maps API. Engineering Applications of Artificial Intelligence38, pp.122-130.

Doshi, P., Jain, P. and Shakwala, A., 2014. Location based services and integration of google maps in android. Int J Eng Comput Sci3, pp.5072-5077.

Gunawan, K. and Purnama, B.E., 2015. Implementation of Location Base Service on Tourism Places in West Nusa Tenggara by using Smartphone. IJACSA) International Journal of Advanced Computer Science and Applications6(8).

Espinha, T., Zaidman, A. and Gross, H.G., 2014, February. Web API growing pains: Stories from client developers and their code. In Software Maintenance, Reengineering and Reverse Engineering (CSMR-WCRE), 2014 Software Evolution Week-IEEE Conference on (pp. 84-93). IEEE.