BEGINNER’S GUIDE TO MOBILE APP DEVELOPMENT IN ANDRIOD STUDIO <action android:name="android.intent.action.MAIN"/> <category android:name="android.intent.category.LAUNCHER"/> </intent-filter> </activity> </application> </manifest>
Code 9.14 (cont‟d from the previous page)
The Internet and GPS permissions are added because the map uses both coarse and fine location tracking.
9.8. Running Our App and Sending Custom Coordinates to the Emulator Please hit the Run button in Android Studio to run our Show My Location app. You can run the app in an emulator or on an actual device. The app running in the Nexus 4 emulator is shown in Figure 9.10. If you cannot see the map on your app, most probably it‟s an error regarding the api key. Please review that section again. Please note that I have sent custom coordinates to the emulator using its options button as shown in Figure 9.11. The latitude and longitude of the coordinates I‟ve entered are 41.3809 N and 2.11287 E. Can you guess what this famous location is? Hint: You can zoom in and out on the emulator‟s map by double-clicking at a point and then moving the mouse up or down. It is worth noting that I‟ve tried the app on a real device and it works as expected.
182