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.