Domanda

I'm new to Android, but I'm ultimately hoping to create a social networking app. I'm trying to figure out the best way to store user data (profile field responses, etc). I'm planning to use Google App Engine for data storage. Very generally, how do I take data gathered from, for example, an "Edit Profile" page and (a) store it in the GAE datastore and (b) make it show on the user's profile? For example, what methods would I use, and how would I set up user data? Also, I know there are more user-friendly interfaces for GAE datastore like Objectify and Slim3; can these be used with Android? I apologize if these are general questions, but it would be great if you could point me in the right direction!

È stato utile?

Soluzione

GAE is a Server side platform while Android is a client side platform. Both of them while using Java as their base language have different SDKs. So you cannot mix them.

The approach that you will need to take is the following:

  • Build a simple REST Web Services layer for your Server side application that is hosted on GAE.
  • The Android client will make a REST call to send and get data from the Server.

On the Server side Java application that you host in App Engine, you can use the Datastore API. If you want to be a bit more productive you can look at libraries like Objectify.

On Android, I suggest that if you are going to store preferences/profile details for the user, you should use the following: a) Use Android Preferences. This will save the preferences data on the device itself and will not need network calls to happen between the device and server just for the sake of getting preferences. b) Any data that you really need to save on the Server, you should as mentioned earlier make a REST Web Server in GAE and invoke it via HTTP Networking on Android.

Hope this helps.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top