简体   繁体   English

从Android应用程序将数据存储在App Engine数据存储区中

[英]Store data in App Engine datastore from an Android app

I have created an AppEngine connected Android application, and I'm trying to modify it to be able to store some user data on the server. 我已经创建了一个AppEngine连接的Android应用程序,我正在尝试修改它以便能够在服务器上存储一些用户数据。 I do not know what's the easiest way to do so, because I want it to be as simple as possible. 我不知道最简单的方法是什么,因为我希望它尽可能简单。 I just want to store some basic data for every user. 我只想为每个用户存储一些基本数据。 This data is: Name, Email, and some other Strings. 这些数据是:姓名,电子邮件和其他一些字符串。 I have created a form in the android side which will allow the user to type all the requested data, but I do not know how to send this information to the GAE server and store it in the datastore. 我在android端创建了一个表单,允许用户输入所有请求的数据,但我不知道如何将这些信息发送到GAE服务器并将其存储在数据存储区中。 I guess I will have to use a Servlet and some kind of RPC service to call the methods. 我想我将不得不使用Servlet和某种RPC服务来调用这些方法。 I'm really lost because it is my first time doing this. 我真的输了,因为这是我第一次这样做。 I'm not experienced neither in android nor in web apps. 我在Android和Web应用程序中都没有经验。 I hope you can help me. 我希望你能帮助我。

Update 更新

Well, maybe I did not explain myself well. 好吧,也许我没有很好地解释自己。 The system I've been asked to build consists on a web service that store your personal login credentials for most common sites (facebook, gmail, etc). 我被要求构建的系统包含一个Web服务,用于存储大多数常见站点(facebook,gmail等)的个人登录凭据。 Using a chrome extension, you ask the server for the credentials on the website you are navigating, and then the server asks to your phone for authorization. 使用chrome扩展程序,您要求服务器提供您要导航的网站上的凭据,然后服务器会要求您的电话进行授权。 It will ask (do you give me permission to send your credentials to "some user"), and you have to ansewer yes or no and then the server will act in consequence. 它会询问(你是否允许我将你的凭证发送给“某个用户”),你必须接受是或否,然后服务器将采取行动。 The point is that you have to store your credentials in the server in some way, maybe from the android app (which is what I was trying) or from somewhere else. 关键是你必须以某种方式将你的凭证存储在服务器中,可能来自android应用程序(这是我正在尝试的)或来自其他地方。 I will also need authentication. 我还需要身份验证。

Pd: I use java for the server side. Pd:我在服务器端使用java。

Since you already started with AppEngine connected Android application , it makes sense to continue customizing it: App Engine Data Access: Adding Entities and RPC . 由于您已经开始使用AppEngine连接的Android应用程序 ,因此继续自定义它是有意义的: App Engine数据访问:添加实体和RPC

Update: 更新:

There are of course many ways to exchange data between client and server. 当然有很多方法可以在客户端和服务器之间交换数据。 The most simple would be a servlet handling GET and POST requests with some query parameters. 最简单的是使用一些查询参数处理GET和POST请求的servlet。

Also, most popoular lately is REST: 最近,最流行的是REST:

  1. Android REST client: http://appfulcrum.com/2010/08/20/android-how-to-call-rest-service-using-asynctask/ (try using GSON instead to parse JSON) Android REST客户端: http//appfulcrum.com/2010/08/20/android-how-to-call-rest-service-using-asynctask/ (尝试使用GSON代替解析JSON)

  2. Server: use a REST framework. 服务器:使用REST框架。 My personal choice is RESTEasy . 我个人的选择是RESTEasy An example: http://ankiewsky.blogspot.com/2010/08/resteasy-on-googleappengine-corerest.html 一个例子: http//ankiewsky.blogspot.com/2010/08/resteasy-on-googleappengine-corerest.html

Update 2: 更新2:

The simplest possible way - making/handlin a simple POST request: 最简单的方法 - 制作/处理简单的POST请求:

  1. Android client - making POST request with parameters: http://www.androidsnippets.com/executing-a-http-post-request-with-httpclient Android客户端 - 使用参数发出POST请求: http//www.androidsnippets.com/executing-a-http-post-request-with-httpclient

  2. Server handling POST (or GET) and extracting parameters: http://www.exampledepot.com/egs/javax.servlet/GetReqParam.html 服务器处理POST(或GET)并提取参数: http//www.exampledepot.com/egs/javax.servlet/GetReqParam.html

Find and follow thoroughly the Topic Index on this page . 此页面上查找并完整地查看主题索引 Gud luck Gud运气好

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

相关问题 从谷歌应用引擎数据存储区获取数据到Android应用程序 - Getting data to Android app from google app engine datastore 如何在Google App Engine数据存储区中存储来自Android的用户特定数据。 祖先与否? - How to store user-specific data from Android in Google App Engine Datastore. Ancestor or not? 如何从Android中的Google App Engine数据存储区中获取数据 - how to fetch data from google app engine datastore in android 从Android访问数据存储App引擎 - Access data store App engine from Android 使用 Android、App 引擎 + 数据存储存储个人资料图片的最佳方式 - Best way to store profile images with Android, App engine + datastore 从 App Engine 和 Android Studio 连接到数据存储 - Connecting to Data Store from App Engine and Android Studio 如何将数据从Android移动设备发送到Google App Engine数据存储区? - How to send data from Android mobile devices to the Google App Engine datastore? 如何使用带有云端点的Google App Engine从Android设备上的数据存储中检索数据? - How to retrieve data from the datastore on Android device, using Google App Engine with Cloud Endpoints? 带有Cloud SQL或数据存储的Android App Engine - Android App Engine with Cloud SQL or Datastore Android studio App引擎数据存储集成 - NoSuchMethodError - Android studio App engine datastore integration - NoSuchMethodError
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM