I am trying to develop an Android application to display a user location on a jpg image of a map which user insert. Using gps coordinates of two positions I calculate the distance between two positions. I need to set that distance on the map jpg image between two locations. I tried getting DPI of the image (which I assumed will be the same as Device's display DPI value) and calculate the pixel distance of the jpg image. But the out put seems wrong. The out put pixel distance is change every time. I assume this happens because the azimuth and DPI is wrong. Do you guys have any idea how to achieve this. Please if you have any sample code let me refer
Thank you very much