I have a text files with latitudes and longitudes for different points separated by commas as follows. I want to convert it into GPX file so that I can use this to send coordinates from this file to my emulator. How can do this through a java class? My text file is as follows. I made this file by manually marking points on this site - http://www.findlatitudeandlongitude.com/click-lat-lng-list/#.T-G4i7XztX8
28.499433450096404,77.4095070362091
28.49990488581077,77.40830540657043
28.500376319419054,77.40717887878418
28.50084775092117,77.40605235099792
28.5013191803171,77.40492582321167
28.501790607606893,77.40379929542542
28.502196033391538,77.40259766578674
28.502601457618425,77.40136384963989
28.503138878029674,77.40005493164062
28.503676295703638,77.39874601364136
28.504213710640236,77.39743709564209
28.504751122839448,77.39612817764282
28.505288532301247,77.39481925964355
28.505825939025602,77.39357471466064
28.50636334301247,77.39233016967773
28.506929028462302,77.39105343818665
28.507664415012268,77.39000201225281
28.50853178743081,77.38902568817139
28.509370869179346,77.38827466964722
28.510209944253397,77.38752365112305
28.511049012652865,77.38677263259888
28.51188807437762,77.3860216140747
28.512727129427535,77.38527059555054
28.513566177802456,77.38433718681335
28.51440521950231,77.38340377807617
28.515244254526948,77.38239526748657
GPX Sample:
<gpx xmlns="http://www.topografix.com/GPX/1/1"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd"
version="1.1"
creator="YourCompanyName">
<wpt lat="Your latitude" lon="Your longitude">
<time>Your Time</time>
<name>Your Location name.</name>
</wpt>
</gpx>
The gpx(GPS eXchange Format) file ends with .gpx extension
All you have to do is just read the text file line by line and create the tags and save the file as .gpx
I hope this helps