简体   繁体   English

将数据从android应用程序传输到服务器上的数据库的最佳方法是什么?

[英]what is the best way to transfer data from android app to a database on server?

I have a game for Android device and I want to upload highscore to a server. 我有一个适用于Android设备的游戏,我想将高分上传到服务器。 So far I am using url to transfer data to a php file on server which puts data to db, this is not secure as anyone can change url and make highscore . 到目前为止,我正在使用url将数据传输到服务器上的php文件中,该文件将数据放入db,这并不安全,因为任何人都可以更改url并获得高分。 What is the most common way to do so , is direct db connection in app secure ?? 最常见的方法是在应用程序中直接建立数据库连接安全? Thanks 谢谢

-----edit----- What if I want to upload large amount of data for example I want to backup sms nd contacts on a server, and I want the sms to be uploaded as soon as it arrives. -----编辑-----如果我想上传大量数据,例如,我想在服务器上备份短信和联系人,并且希望短信到来就立即上传。

If you do not care the delay between sending data and storing to database you can use Google's GCM service. 如果您不在乎发送数据和存储到数据库之间的延迟,则可以使用Google的GCM服务。 Then all the security issues are handled by Google: You send a GCM Bundle to your server via Google Cloud. 然后,所有安全问题都由Google处理:您将GCM捆绑包通过Google Cloud发送到您的服务器。 But there might be a delay between sending on the device and receiving the data on the server. 但是在设备上发送和在服务器上接收数据之间可能会有延迟。

Some links that will help you: 一些链接将帮助您:

http://developer.android.com/google/gcm/ccs.html http://developer.android.com/google/gcm/ccs.html

http://javapapers.com/android/google-cloud-messaging-gcm-ccs-with-xmpp/ http://javapapers.com/android/google-cloud-messaging-gcm-ccs-with-xmpp/

But you need a server with a running GCM server programm (Java but also possible in Python and even PHP). 但是,您需要一台运行GCM服务器程序的服务器(Java,但在Python甚至PHP中也可以)。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 使用MicrosoftAzure /类似服务将数据从在线数据库传输到android应用的最佳方法是什么? - What is the best way to transfer data from an online database into an android app using MicrosoftAzure/similar services? 用户将数据从 Android 应用程序上传到 Web 服务器数据库的最佳方式 - Best Way For Users To Upload Data From Android App To Web Server Database 从数据库android显示数据的最佳方法是什么? - What is the best way to display data from database android ? 从Android AutoCompleteTextView的数据库中检索JSON数据的最佳方法是什么? - What is the best way to retrieve JSON data from database for Android AutoCompleteTextView? 将数据从MySql Server传输到Android App - Transfer of data from MySql Server to Android App 有没有更简单的方法在android应用程序和服务器数据库之间传输数据? - Is there a simpler way to transfer data between an android application and a server database? 如果服务器是apollo graphql server,从android应用程序上传文件的最佳方法是什么? - What is the best way to upload a file from android app if server is apollo graphql server iOS / Android到服务器的传输:确保传输安全的最佳方法? - iOS/Android to server transfer : Best way to keep transfer secure? 从手表向手机Android Wear传输数据的最快方法是什么 - What is the fastest way to transfer data from watch to phone Android wear 使用来自科尔多瓦服务器的大型json数据将数据插入android sqlite数据库的最佳方法 - best way to insert data into android sqlite database using large json data coming from server using cordova
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM