Our app will feature a map, because anytime you host an event, guests will need to know the address and it is helpful to provide the location via GPS. For the EventApp app to launch Google Maps when a user presses the Map button, we will use the ActivityStarter Component. Go to the Designer, and in the Connectivity Palette, drag ActivityStarter onto the Viewer and notice how it drops down below the Viewer (see the following screenshot) unlike all of the other components we have used so far. This is because ActivityStarter is a nonvisible component; the user won't see it on the screen or even know that they have launched it:
For the app to launch the correct map, you will need to input some instructions in the Properties panel. Insert the following text into the blank text boxes beneath each property heading Action
, ActivityClass
, ActivityPackage
, and DataUri
, as follows:
Action:
android.intent.action.VIEW
ActivityClass:
com.google.android.maps.MapsActivity
ActivityPackage...