0

My plan is to make an app for iOS (and android when I've figured it out on iOS) in flash. I need to access data from an external mySQL-database that I will be putting on a webserver. I'm wondering what the correct way to go about this would be.

I've looked a little into AIR, Flex and JSON, but I need someone who knows what they're doing to put me on the right track. I don't need a super in-depth guide, just a hint in the general direction, I can do a lot of research myself, but I'm quite inexperienced in the whole accessing-external-databases-from- flash thing.

Thanks a bunch in advance!

-Flash Newbie

dsolimano
  • 8,870
  • 3
  • 48
  • 63
Benjamin
  • 13
  • 1

1 Answers1

0

To access an external database you wouldn't use Flash directly, you would need some sort of middle layer (like PHP or Node or Ruby, etc) to get results out of the database and return them to Flash in some format it can understand (like XML or JSON.) This is commonly referred to as an API - it's kind of like a web site but it returns data in code instead of user readable html.

So the flow would look something like this:

  1. Your iOS app would make a request for a url - something like this: http://myserver.com/users

  2. You would have a server-side app (let's say PHP) deployed to a server handle that request.

  3. PHP would query some database (like mySQL) and get the results. Those results would be formatted as JSON or XML and returned.

  4. Your iOS app would get the results, and then you could do whatever you needed with it.

This is super-rudimentary explanation but there is a lot going on with what you're trying to do. My recommendation would be to get really familiar with calling API's on the web (you could use something like https://developer.forecast.io/ to get familiar with working with JSON and web requests) and then when you're feeling comfortable with all of that you could looking into working on the server portion. I don't know what your comfort level is with all of this but a lot of people focus on just one or two of these area's and not the entire stack. It can get overwhelming rather quickly. I haven't even talked about security, authentication, performance, etc... :D

Hope this helps!

Community
  • 1
  • 1
Paul Mignard
  • 5,824
  • 6
  • 44
  • 60
  • This helps a lot! Exactly what I needed to get going, I'll definitely look into the developer-forecast site and learn how to call API's first, looks like a good way to start! – Benjamin Dec 11 '14 at 21:23