If you do this "Maybe I can show the map and then to get the distance and time?" in your app (display a Google Map) then it appears you satisfy one of the requirements for using their API.
Can you calculate distance and time without the Google API? Yes, however the math can be very complicated. You can calculate a straight-line distance using the Haversine formula :
Here is a Haversine formula in Java code:
var rad = function(x) {
return x * Math.PI / 180;
};
var getDistance = function(p1, p2) {
var R = 6378137; // Earth’s mean radius in meter
var dLat = rad(p2.lat() - p1.lat());
var dLong = rad(p2.lng() - p1.lng());
var a = Math.sin(dLat / 2) * Math.sin(dLat / 2) +
Math.cos(rad(p1.lat())) * Math.cos(rad(p2.lat())) *
Math.sin(dLong / 2) * Math.sin(dLong / 2);
var c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));
var d = R * c;
return d; // returns the distance in meter
};
The Java code provides a result in meters or perhaps kilometers that is only reliable over relatively small distances. The problem is, this algorithm does not calculate the path of a car, it calculates a point to point distance.. You can calculate driving time by calculating the distance and dividing by your average anticipated driving speed.
Google's API is remarkable, to duplicate that performance in code only on an Android device with AI2? Possible but improbable.
Regards,
Steve