Skip to Main Content
App Inventor 2, 2nd Edition
book

App Inventor 2, 2nd Edition

by David Wolber, Hal Abelson, Ellen Spertus, Liz Looney
October 2014
Beginner to intermediate content levelBeginner to intermediate
360 pages
9h 3m
English
O'Reilly Media, Inc.
Content preview from App Inventor 2, 2nd Edition

Chapter 7. Android, Where’s My Car?

You parked as close to the stadium as you possibly could, but when the concert ends, you don’t have a clue where your car is. Your friends are equally clueless. Fortunately, you haven’t lost your Android phone, which never forgets anything, and you remember you have the hot new app, Android, Where’s My Car? With this app, you click a button when you park your car, and the Android uses its location sensor to record the car’s GPS coordinates and address. Later, when you reopen the app, it gives you directions from where you currently are to the saved location—problem solved!

Android, Where’s My Car

What You’ll Learn

This app covers the following concepts:

  • Determining the location of the Android device by using the LocationSensor component.
  • Persistently recording data in a database directly on the device by using TinyDB.
  • Using the WebViewer component to open Google Maps from your app and show directions from one location to another.

Getting Started

Connect to the App Inventor website and start a new project. Since project names can’t have spaces, name it “AndroidWhere”. Set the screen’s title to “Android, Where’s My Car?” Connect your device or emulator for live testing.

Designing the Components

The user interface for Android, Where’s My Car? consists of labels to show your current and remembered locations, and buttons to record a location and show directions to ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

App Inventor 2 Essentials

App Inventor 2 Essentials

Felicia Kamriani, Krishnendu Roy
App Inventor

App Inventor

David Wolber, Hal Abelson, Ellen Spertus, Liz Looney
Hello App Inventor!

Hello App Inventor!

Carl Simmons, Paula Beer

Publisher Resources

ISBN: 9781491907214Errata Page