How to implement and create a central Scoring server using iPhones to send updates - iphone

I have been searching and googling different ways to build a central scoring server for a golf tournament but have not found any dead set answers on how I can do this. What I'm looking for is some advice on how I should implement this. I do have a background in programming in Objective-C as I have created a couple of iPhone apps and I'm not afraid of trying and learning new things. I will explain what I envision and if I could get some suggestions on how to start, that would be great.
a. My golf tournament would have about 80 people playing in it.
b. I would have 5 volunteers with iPhones stationed around the golf course to collect scores from the players as they finish a couple of holes.
c. The volunteer would enter the scores into an app on the iPhone. The app would then send the scores to the central scoring server to update a giant leader board at the clubhouse.
My questions are what kind of database should I use? I'll need something that is very user friendly as I'll need to be able to make quick changes to the database on the fly if required. The iPhones will not share the same network as the central server as they would most likely be on 3G out on the golf course. For now, the iPhone app that is sending scores to the server, will not be in the app store as I will build the app through an ad Hoc profile.
Any help, suggestions or advice would greatly be appreciated.

You would presumably need a hosted service of some sort that each instance of your iPhone app would send its data to. Typically those hosted services are implemented in other languages/technology stacks like Java, PHP, or Ruby/Rails. The server app would then persist data into a database: MySQL is a commonly used solution, but there are a lot of options with different strengths and weaknesses depending on your specific requirements.
If a hosted server application isn't somewhere you want to go, and if your requirements are simple enough, you could look into a file-based server solution. For example, you could build your iPhone app to place scores in a small file on a Dropbox folder and then write a standalone app that collects those small files and does whatever you want with the data.
Hope that helps

If you have little experience with servers, you might also consider one of the new server-in-a-can services like parse, stackmob, or kinverse. There's quite a bit involved in building/maintaining a server, especially if you need it to scale.

Related

SWIFT: Controlling a view on another users device

This is a simple question on a (probably) complicated topic.
I'm in the process of trying to build an app in which multiple users are invited into a session by a single user.
If they accept, I would like the session admin/host's device to control the views on the devices of all the users in that session.
I have searched high and low, Google, StackOverflow, Treehouse etc. but whenever I suggest multiple users or type the question as I have here I get responses that demonstrate how to make an app capable of supporting multiple users on one device, or similar.
The question is simply: is what I want to do possible? Is it safe? Does anyone have a resource that would get me started in learning about how to code this scenario.
Thanks in advance,
Kyle.
Easy as pie - you use PubNub for exactly that.
demo similar to your problem:
https://www.pubnub.com/developers/demos/codoodler/
(That demo is in-browser, but it's equally easy to do inside an app - assuming you're an experienced app developer of course!)
more demos:
https://www.pubnub.com/developers/demos/
I can tell you're new at mobile development. Do understand that:
A) In general programming is extremely difficult. Programming mobiles in particular has a lot of fussy knowledge needed as well as broad general engineering skills.
B) We really live in the "age of BAAS" - "platforms" such as PubNub, FireBase, Parse, Realm, Couchbase and so on. (These days you can't really be an "app programmer" .... you can't get a job "programming an iPhone". You get a job doing Firebase development, happening to be on iPhone - you know?)
I believe Apple has documentation on this very topic:
https://developer.apple.com/reference/multipeerconnectivity
The trickier part will be how do you send back and forth data that allows the host to "control" the views of the other devices. If by "control" you want to let the host control things that are outside of your app (like a screen share) I don't believe that will be possible.

Web service/api for iPhones app

I am hiring a freelancer to develop a social networking app for iPhones with event creation, messaging, etc. He asked me if I was going to provide web services/api. I am completely new to app and web development so I am not sure how to answer. If I provide those things, what do I need to do?
Thanks.
you need to get it very clear in your head what you want to build before you hire a freelancer. If you don't you'll be in a costly world of pain very quickly.
So, sit down and think, if you have a friend developer maybe you can have a chat with him and decide the architecture of the product.
What that guy asked you is if you need an API to provide data which is a fair question. Think of a source of your data where other applications can connect and interact with it.
The answer is yes you will need an api because all the mobile clients need to connect to something and that something will be an Api. The Api will be the bridge between your data and your clients. The data will reside into a database so that's another thing to consider.
As I said, think very well what you want because the quality of what any freelancer will build, depends on the quality of information you provide. If it's not clear in your head then it won't be pretty.

Roll your own Multiplayer iPhone setup?

I've been looking into the various options for implementing multiplayer (internet) in iPhone games. Game Center, OpenFeint etc are obviously very good, stable and feature-rich. But I can't help thinking my needs are a lot simpler than what they provide.
If I wanted to put together a simple 2d tank game, could I not just..
setup a mysql server on the web, with some get/set php scripts to actas 'web services'.
when you open the game, a call is made to the server, to log that you're 'available'.
when you select Play, a call is made to retrieve a list of 'available' IP's.
you select an opponent, remote IP is stored locally.
game starts, UDP handles the data between your IP and your opponent's IP.
..or would that never work? apologies, I'm very much a n00b at gaming/networking dev!
thanks in advance!
In addition to the complexities that dtuckernet points out, there are few other things to consider:
You need to think about the cost of running and supporting the web server. Can you maintain the same or better uptime than Apple and OpenFeint?
GameCentre promotes games that support it. The App Store adds an icon, and Game Centre itself lists games that your friends own. Don't underestimate the effect of free advertising!
Even if the code it easy (which I suspect isn't true), why take the risk of developing your own when there is well-tested code available for free?
Incidentally, depending on your requirements, you may want to use a hybrid approach. For example, Game Centre has a maximum of four players per game when Apple hosts it. You can find players using GC and then run the games itself on your own server.
That would certainly work, but implementing this can be a bit harder than it seems initially. You have to handle things like NAT/Firewall traversal and if you are using UDP you need to implement some type of a heartbeat to ensure you know when devices have disconnected (and handle it accordingly).
In most all cases, you would be better off working with a solution that already has these problems solved.

Database driven ios app - first steps

I'm about to start work on my first app which will be an internal release to gather customer information at a trade show.
I'm hopefully looking into using air for ios or maybe one of the various html/js frameworks to develop this app as an alternative to learning C.
ideally I would do it with some server based php > sql to store and share gathered information between a fleet of iPads, unfortunately due to the population of this trade show there will be no guarantee that i can maintain a wireless connection so need to prepare for these apps all being local access only.
in which case, how would you recommend going about the saving/reading of the stored data, and also how to sync it up with a sql server and then back to the iPads each night.
Did you try PhoneGap? It is an HTML5 app platform that allows you to author native applications with web technologies, in other words it will let you make an iphone app without having to learn C.
People have written tutorials and plugins for storing data locally.
PhoneGap basically wraps a web app hence you can use AJAX for sync with server as and when needed. This article might help.
We explored PhoneGap and found it very useful. and easy too. hope this helps you.

iPhone app with a RoR 3 web service

I am in the process of building an iPhone app with a RoR 3 web service on the back end. The app is a fairly simple peer-to-peer game. I would really appreciate it if someone could share some pointers and tips on how to best divide the operations between the web service and locally on the iPhone.
For example, chess or backgammon, is the current state of the game being constantly saved and retrieved from the server? or is it stored locally on the iPhones of the players?
Thanks!
This will vary wildly depending on how you want to program the application and what your needs are. You could constantly save and retrieve game state from the server, you could synchronize game state at certain intervals determined by game play, or you could run mostly local. It all depends on your requirements. In general cell networks should be considered slow and unreliable (even though this isn't always true). Keeping data transfer to the minimum required to accomplish your goals makes your app feel more responsive and users happier (especially those in poor coverage areas and those who do not have unlimited data plans).
That depends on whether it's a game against another player or against a computer opponent. If it's against another player, then the state would be updated on and retrieved from the server. If it's against a built-in AI, there would be no reason to send that state to the server, unless your AI is inside your webservice instead of including it in the actual application. It's really a design decision based on what you're trying to accomplish. Generally I would recommend keeping as much as possible local to the app, unless there's a reason to do it on the server, but if there's any competitive aspect to your game, you definitely want to keep control of any calculations on your server. Keep in mind that someone can always try to decompile your application or call your webservices directly passing in false data.