Starting from:

$30

LAB 1-Create an Android app which shows GPS location on the device screen Solved

Please view all videos and documents from Moodle first.

1. GPS Location
Create an Android app which shows GPS location on the device screen.

You have two possible apis which you could use to fetch the location (you can choose or do both ways)

Older API: https://developer.android.com/guide/ topics/location/strategies

Newer API: https://developer.android.com/training/ location/retrieve-current

Please note that you must declare permissions in the manifest file and also ask the permission runtime. More info from here: https://developer.android.com/training/permissions/ requesting#java

2. Reverse geocoding
Reverse geocoding is a way to get an address based on the latitude and longitude coordinates.

Modify previous assignment in a way that it will show the lat / lon coordinate + city and country for that location.

This class will help you: https://developer.android.com/reference/android/location/ Geocoder.html

                                                                                                                                                                

3. Simple HTTP
Create app that can be used to load textual content from network addresses. Please follow the ui style on the image.

You can use this class to fetch data: https://developer.android.com/reference/java/net/ HttpURLConnection

Remember to Add INTERNET permission to manifest file.

Also, because we have not yet studied thread programming you must add this code to make possible to load data from the network in the main (ui) thread.

StrictMode.ThreadPolicy policy = 

        new StrictMode.ThreadPolicy.Builder().permitAll().build();

StrictMode.setThreadPolicy(policy

More products