user1424490
user1424490

Reputation: 61

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. 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. I guess I will have to use a Servlet and some kind of RPC service to call the methods. I'm really lost because it is my first time doing this. I'm not experienced neither in android nor in web apps. 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). 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. 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. I will also need authentication.

Pd: I use java for the server side.

Upvotes: 6

Views: 4217

Answers (2)

Husnain Iqbal
Husnain Iqbal

Reputation: 466

Find and follow thoroughly the Topic Index on this page. Gud luck

Upvotes: 1

Peter Knego
Peter Knego

Reputation: 80330

Since you already started with AppEngine connected Android application, it makes sense to continue customizing it: App Engine Data Access: Adding Entities and 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.

Also, most popoular lately is 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)

  2. Server: use a REST framework. My personal choice is RESTEasy. An example: http://ankiewsky.blogspot.com/2010/08/resteasy-on-googleappengine-corerest.html

Update 2:

The simplest possible way - making/handlin a simple POST request:

  1. Android client - making POST request with parameters: 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

Upvotes: 9

Related Questions