How to send GPS data from android to a website?

梦想的初衷 提交于 2019-12-21 21:54:01

问题


I'm new to Android and web service development! currently I'm working in developing Android program that will send longitude and latitude information to asp.net website (to show the location change the website map) the questions are - how to send this data to the website (the best practice)! - any suggestions for a suitable framework starting from the android application itself , inserting to database , client/server connection !!

I've read a lot about web services specially REST ..but didn't find tutorials

Appreciate your kind help..


回答1:


I would suggest that you use JSON to encode your data and this will allow you to use any implementation (pretty much) on a server to receive it. I prefer Java/Servlets but you can most certainly find a JSON library for ASP.net etc. Using something "standard" like JSON allows you more flexibility in the long run than doing something custom.

Have a look at this question for some example code to get started (for lat/long): Passing GPS LonLat from Android GPS to WebPage (javascript)

I also suggest that you use POST instead of GET when using HTTP, there is some example Android code here: http://www.anddev.org/doing_http_post_with_android-t492.html and http://www.androidsnippets.org/snippets/36/

Lastly if you need security and you are using HTTP, simply add an SSL certificate to your server and you will then have HTTPS.



来源:https://stackoverflow.com/questions/2707501/how-to-send-gps-data-from-android-to-a-website

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!