DPSD - Android Project 2
Write an App that is location aware.
It should continually display the lat/long coordinates of where you are.
For ideas:
Follow the example described in "Location without Maps" starting on Page 422 of your
Programming Android
book.
Make sure you can update the emulated location using geo.
Follow the training at:
http://developer.android.com/training/building-location.html
Pressing a button labelled "Map Me" should show the current location in Google Maps.
Pressing a button labelled "Text Me" should send a text to another device with the current location (you can hard-code the number to text).
For texting, use the
SmsManager
.
Create and register a
BroadcastReceiver
to handle the result when the text is sent.
Create and register a
BroadcastReceiver
to handle the result when text is delivered.
For your BroadcastReceivers, you will override
public void onReceive(Context c, Intent in)
To register your receivers, use
registerReceiver()
and the
IntentFilter
class.
Be sure to unregister your receiver in onReceieve().
Use
smsManager.sendTextMessage()
to send the text and setup the
PendingIntents
. (Look at PendingIntent.getBroadcast()).
Print a toast message to show the result from when the text message was sent.
Print a toast message to show the result from when the text message was delivered.
Use at least one one fragment in the UI. Suggested: for displaying the GPS coordinates.