6

I'm pretty new in the android world. I am wondering how can I get the position of my friends and display it on a map. More precisely, I don't know how to share the position of my friends and I. Maybe have to use a server or something like that ?

Is it hard to code ?

Thx,

Arnaud

ArnaudT
  • 93
  • 1
  • 1
  • 9

3 Answers3

10

You can look at existing open source solutions.

Here is a server side source code: https://github.com/tananaev/traccar/

And here is Android app: https://github.com/tananaev/traccar-client-android

Communication is done over TCP connection.

  • After establishing connection client sends identification message:

$PGID,123456789012345*0F\r\n where 123456789012345 is a unique device identifier, in this case IMEI

  • Then client sends location reports with selected interval in standard NMEA RMC format:

$GPRMC,123519,A,4807.038,N,01131.000,E,022.4,084.4,230394,003.1,W*6A

Anton Tananaev
  • 2,458
  • 1
  • 25
  • 48
1

Step-1 Create android app which will share required details like position and name etc and will request to the server for required information

Step-2 Create a server which will store the details sent by the user and sent necessary information to the appropriate client

Approach

When your friend will come online the app should send(installed in your friends device) the detail to the server whenever you want the information your app should request to the server for necessary information

Sunil Kumar Sahoo
  • 53,011
  • 55
  • 178
  • 243
  • Thx for replying. This is what I was thinking about. Is there any tool to do that or I have to code everything ? – ArnaudT Nov 11 '13 at 07:09
  • if you want to develop your own app then you have to develop. if you want to use any app then you can get so many similar aaps in google play store – Sunil Kumar Sahoo Nov 11 '13 at 07:26
  • If you are satisfied with the answer then accept the answer which will motivate others to help you – Sunil Kumar Sahoo Nov 11 '13 at 07:29
  • What do you mean by accept the answer ? Indeed, i'd like to develop my own app ! But i'd prefer spend my time on my app and not on setting up a server and everything :/ I'm ok to learn PHP but i'd like a direction or some help. – ArnaudT Nov 11 '13 at 07:43
  • there are online tutorials which can help you to learn PHP. Its not that difficult\ – Sunil Kumar Sahoo Nov 11 '13 at 07:52
1

Is it hard to code ?

No it is not hard to code.

how can I get the position of my friends and display it on a map. More precisely, I don't know how to share the position of my friends and I. Maybe have to use a server or something like that ?

Yes you need a web server. In order to send information between two mobiles you need a web server which can transfer your information. Now your Precise location can be found using GPS and also you can use cell tower location (but it is not precise). Now Gps will return Latitude and Longitude of any location, all you need to send these lat/longs over your web server to your respected mobile device and all you left with displaying them on map.

Tutorial on Maps.

Jitender Dev
  • 6,907
  • 2
  • 24
  • 35