Computing Distance from GPS points in App Inventor

With App Inventor, you can create apps that use the LocationSensor to get the phone’s GPS coordinates. Some of my students have been writing apps to perform such public services as finding the closest pub from their current location. To compute this, they need to convert to GPS lat/long coordinates into a distance in miles.

To help them, I created these quick and dirty screencasts demonstrating how to find a formula on the web then convert it into an app inventor program:

PART II

About these ads

7 Responses

  1. Dave:

    Trust that your weekend is sailing along.

    Thanks a mil, for doing the tutorial on distance calculation!!!

    To leverage what your tutorial teaches, by a factor of 5-10 (5-10 different locations), it appears that an AI user would have to:

    a) identify the long/lat of the given locations
    b) create a separate calculation block for each location
    c) have the single long/lat2 plug into each of calc block
    d) return the distance answer for each location

    ———–

    The biggest challenge it seems, will be the UI: returning the various distances in a way, that is engaging to the app’s user.

    Thanks, again, for the tutorial. It was a great resource.

    In Service of THE ONENESS,
    Rafiki “The Digital Doctor” Cai

  2. how about an app that does this

    find the zip code of your current location using your web and GPS enabled mobile device
    By pghboemike

    http://pghboemike.wordpress.com/2011/05/17/29/

    • This is a nice example of a simple app that’s real easy to create in app inventor. In this case, you’d drag a LocationSensor.LocationChanged event into the blocks editor. This event will be triggered when you get a reading of your current location. The LocationSensor.CurrentAddress can be called within that event handler to give you your current street address. Remember to plug in LocationSensor.CurrentAddress into some label.text so the address (and zip code) will appear.

  3. Hi,

    Is there any way of integrating this into a Twitter app? I’m trying to develop a simple one using App Inventor but also would like to have the ‘Who Is Tweeting Nearby’ option available to users.

    Any help would be much appreciated.

  4. “Students have been writing apps to perform such public services as finding the closest pub from their current location.”

    Useless in the UK or Manhattan, I’m afraid… just turn around XD

  5. so hoe does it work if i am travelling along in a car? to calculate car journey do i need to keep calculating distance based on time? i.e gps coordinate every 5 seconds or something? also i would like to collect the data of my mileage and add it to my google calendar with the address’s to and from is this possible?

  6. How do you you calculate the driving distance?

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 63 other followers

%d bloggers like this: