To calculate the driving distance as opposed to a straight line you will need to use either the google navigation api
or
the mapquest directions api.
Both are easy to work with,
Just use the web component to send a string including your start and destination lat/lngs
or this project will do it all for you, ( built with AI1/Classic, not Ai2) the return string from mapquest has the total distance as well as the navigation instructions etc
http://gallery.appinventor.mit.edu/#page%3DApp%26uid%3D1086001%26label%3DAI%20GPS%20NAVIGATION%20APP