如何从Android的网站发送GPS数据? [英] How to send GPS data from android to a website?

查看:162
本文介绍了如何从Android的网站发送GPS数据?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚接触Android和网络服务开发!
目前我正在开发Android程序,将发送经度和纬度信息到asp.net网站(以显示位置更改网站地图)
的问题是
- 如何发送这个数据到网站(最好的做法)!
- 从Android应用程序本身开始,插入数据库,客户端/服务器连接的任何建议适当的框架!

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 !!

我已经阅读了很多关于Web服务,特别是REST ..但没有找到教程

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

欣赏你的帮助..

推荐答案

我建议你使用JSON来编码你的数据,这将允许你使用任何实现(几乎)在服务器上接收它。我喜欢Java / Servlets,但你可以找到一个JSON库为ASP.net等。使用标准像JSON允许你更多的灵活性长期比做自定义的东西。

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.

看一下这个问题的一些例子代码开始(对于纬度/长):将GPS LonLat从Android GPS传递到WebPage(javascript)

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)

我还建议您使用POST GET使用HTTP时,此处有一些Android代码示例: http://www.anddev.org /doing_http_post_with_android-t492.html http://www.androidsnippets.org/snippets/ 36 /

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/

最后,如果您需要安全性并且正在使用HTTP,只需向您的服务器添加SSL证书,然后即可拥有HTTPS。

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

这篇关于如何从Android的网站发送GPS数据?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆