top of page

DSL810

Special Topics in Design
Interface and application programming

Build a Mobile App that interacts with sensors from your smart phone. Document this work.

Here I have tried to make an application to record the location of my phone at a point and when required, use google maps to lead me back to the same location.

​

​

When you need to remember some random location, and you way to it, like where parked your car or where you dropped your friend or where a particular shop or place is, and it seems impossible to rememember that location, then this app helps you in such a situation.

Through this app I am trying to use the Android phone to remember the location for you. The Android uses its location sensor to record the GPS coordinates and address of the location you want to remember. Later, when you reopen the app, it shows you a map from where you are to the remembered location-- problem solved!

Components used

The app communicates with the Android location sensor, records data in the phone's long-term memory (database), and opens the Google Maps app to show directions from one location to another. It makes use of the following App Inventor components:

  • Location Sensor- to track the location

  • TinyDB- to store the data

  • ActivityStarter- to open a map

The User Interface

1.PNG

The user interface consists of labels to show location data and buttons to initiate events. Some labels just show static text, e.g., GPSLabel is the text "GPS:" that appears in the user interface. Others, such as CurrentLatLabel, will display dynamic data once the location sensor gets its readings. For these labels, a default value is set (0) here in the Component Designer.

App's Development Blocks

2.PNG

The four different event-handlers of the app, starting in the top-left and working around in counter-clockwise order-

LocationSensor1.LocationChanged: This event occurs when the phone's location sensor first gets a reading, or when the phone is moved to produce a new reading. The event-handler just places the readings--latitude, longitude, and current (street) address-- into the corresponding "Current" labels so that they appear on the phone. The Button1 is also enabled in this event-handler. Its enabled setting is unchecked in the Component Designer because there is nothing for the user to remember until the sensor gets a reading.

Button1.Click: When the user clicks the Button1 , the location sensor's current readings are put into the "remember" labels and stored to the database as well. The Button2 is enabled as it now makes sense for the user to click on it to see a map (though it will make more sense once the user changes location).

Button2.Click: When the user clicks the Button2 , the event-handler builds a URL for a map and calls ActivityStarter to launch the Maps application and load the map. join is used to build the URL to send to the Maps application. The resulting URL consists of the Maps domain along with two crucial parameters, saddr and daddr , which specify the start and destination for the directions. For this app, the saddr is set to the latitude and longitude of the current location, and the daddr is set to the latitude and longitude of the location that was "saved".

Screen1.Initialize: This event is always triggered when an app opens. When the app re-opens, the user expects that the location remembered earlier should appear on the phone. To facilitate this, the event-handler queries the database (call TinyDB.GetValue). If there is indeed a remembered address stored in the database- the length of the stored address is greater than zero-the remembered latitude, longitude, and street addres are placed in the corresponding labels.

Build a User Interface (Mobile App/ Desktop App) that interacts with an input and/or output device using a microcontroller. Document this work.

So this is basically my project, where I have used a GPS sensor to locate the position of a person, and transmit the data using a Bluetooth module to the app on my phone. So the app now tracks and saves the data from the GPS module and the give the direction to the saved location using the google maps.

final_sheet.jpg
4.PNG
3.PNG
bottom of page