简体   繁体   中英

Android Social Game implementation - Data storage and sharing

So, I'm reading this android game programming book , which is great, and I was wondering about how to implement the database of a social game.

Let me take a dummy example that fits the example purpose: there is a group of people playing a game, where everyday there is a question (generated by the app), and the first user to answer it wins.

So, basic questions: when someone answer the question, how the others players will know?

I imagine that when the winner answer the question, this would be stored in a database (the cloud?) and when the others users log into the game, the app would connect to the clound, synchronize all users update and display a message saying that there is a winner already for that question.

Is that in anyway correct? I have a fair/medium experience in developing in Android, but never worked much with storage/internet connection.

There is any specific API to deal with this task?

PS I'm aware of SharedPreferences, but I'm quite sure that's not I'm looking for. My main question is how to share data over the internet/users using and Android app.

Thanks

Android provide Game Services for this. I this APIs https://developers.google.com/games/services/android/realtimeMultiplayer are what you are looking for

Otherwise you may think to develop your own server logic for instance via Google App Engine

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM