Android Social Game implementation - Data storage and sharing - android

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?
P.S. 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

Related

Music App and database accessing

I'm kinda stuck on the implmentation phase of my app. It's a music app that asks a user how he's feeling - sorrow, happiness, heartbreak, nervousness, etc., and it then inputs what it already knows of the user to a database of all songs. The app then chooses and shortlists and plays whatever it sees fit to the situation.
I've already created the music app and the GUI for it, but I'm really stuck at how to access a music database, whether it be online or offline. I've read about Musicbrainz, and I did download the databse although it is actively available online. I do not know how to ask my app to look into it and interact with it, or any other online database for that matter.
Please do provide me with any help if its possible.
You want to use an API. Udacity does a pretty good job of teaching this. You have to sign up for an account but it's all free. Lesson 2 here will teach you all about with example code. Then you'll just have to find an API for music.
A little too much information given, try to be more concise. There are a bunch of different ways about going about this. You can connect to a database directly through SQL or MySQL but you would need access to the DB creds. Best option is to use an API. There will be plenty of information on music APIs if you google it.
P.S. Only ask a question if you can't find an answer elsewhere and this type of question has been asked countless times.

What services could be used as back-end for a mobile app?

I have an idea for a mobile app that I would like to make. I am experienced in programming locally on the device, but not so much at making something that has a server in it.
I have (rather hastily) rented a server at HostGator and rented the domain name.
I made a project for university before and did the server-side scripting, but it had flaws, wasn't well polished and took a lot of time. So I'd like to avoid it as much as possible.
I have been searching the internet from morning till night for services that would take the load of server-side from my bac.
I'm planning to build an iPhone and an android app that will actually be "wrappers" to my data on the server. I will need user accounts and databases in general. The app will basically connect the users in some way and organize events for them. I saw a lot of names like "Parse" and "Kinvey" but I'm not really sure if that's what I'm looking for or not. Would I need to build an API myself, put it on the server, and wrap the apps around it? Or is there (hopefully) another solution? I'm looking for general guidance and what to research exactly.
What you're looking for are BaaSs (Backend-as-a-Service) and there are plenty to choose from. I highly recommend Firebase as a starting point as it's pretty easy to work with and pretty fast to get up and running, though there may be a learning curve in grasping how you should define your data in an efficient way. Parse is now defunct and you'll probably still have to wrangle with trying to get it deployed to a server, which may be a daunting task if you don't have experience with that kind of stuff as it's now just an open source project that doesn't give you any server infrastructure to work with out of the box like they use to. Other promising BaaSs is Realm's mobile platform which I haven't tried yet.

Download sync magic in android app

I am working on an android app for displaying certain blogs of various categorization.
I am done with the app and now recently I came across OB Programming Interviews app which display various programming interview questions on the basis of algorithmic categorization.
This app contain a feature of downloading the entire question database for offline usage. I want to implement a similar functionality in my app. Can anybody suggest me something or give me a direction to proceed as after some hours of google search I am still clueless about the idea of the implementation.
Thanks in advance!

Android two-player game, online play

I have a simple two-player android game (like Chess), and I want to add some functionality for users to play against each other online. I would prefer to make this as simple as possible (so no complex website where users meet each other and maintain a rating, etc.; instead, just the ability to somehow "look-up" your buddy and have a quick game against him or her).
First of all, is there any way to do this peer-to-peer? From my research, it looks like no, or at least there is no "easy" peer-to-peer method. Admittedly, I haven't looked much into p2p for Android in a while...
The other way then, would be to set up a server, but I have no idea how to do this. Does anyone have some links, info, etc. about how to set up a simple server for enabling online gaming like this?
Thanks!
The problem with p2p is going to be discovery i.e how do players discover each other or their address for communication. The other problem with p2p is that players phones are often going to be behind NATs and if both are behind a NAT then they will need a intermediary between them for communication. These are two common reasons why a server is required even for the simplest of multiplayer games.
Is your game an asynchronous turn based game like words with friends?
There are options of using cloud service for such a game as well so that you just do Android development and access a webservice for storing game data and sending push notifications to update the other player of his/her turn. You can take a look at this https://github.com/shephertz/App42-Tic-Tac-Toe sample on how to do it.

Please give me a 'kick-start' to build an app to log into a web site

Never built an app before.
Downloaded & installed SDK & Eclipse.
For my 'learning experience' I would like to build an app for my Galaxy S II (4.0.4) that will take me to a web site and then log me in, eg: my Gmail Account or my Voip.ms Account
Can someone point me to a tutorial or suggest how I should start such an app?
Is this too complicated to begin with?
Personally, I think this is way too complicated to start as a learner. You may end up spending a lot more time in debugging some code which does not work because of some silly stuff rather than "learning" how to code Android.
I started with a simple app that has few screens, stores some info in local SQLite DB and sends some across to an remote SQL Server over internet. I managed to complete this in 2 weeks and got quite a good hold on Android basics. Now I am working on a much complex app and am not getting stuck in fundamental issues.
Developer.android.com offers some good app examples and tutorials and is the first go-to location when you want to see how to do something Android-related.
As for what you want to do, it will really depend on the website. Going to the website in question, searching for a developer section is the way to go.
There they will explain which API they offer to devs. OAuth + REST are widely adopted but there is no universal solution, it really depends on the website.
A final note : embedding a webpage in an Android app is a very bad idea from an user-experience perspective, Using an API to offer a native app will always result in a better experience.

Categories

Resources