views:

857

answers:

2

i am very new to Adobe Air and i am having a hard time with it.

i want to be able to create a desktop app for clients that communicates with a databse.

im currently used to writing everything in php, which then communicates with MySQL.

also, i plan on using Flex.

1: does Adobe Air communicate directly with the database? or does it communicate with PHP?

2: which is the prefered database: MySQL or SQLite? does it matter?

please help!

A: 

Adobe Air can communicate directly with LOCAL databases. There are some examples on accessing sqlite databases with adobe air here (http://www.adobe.com/devnet/air/flex/articles/sqlite%5Fdb%5Fapi%5Fin%5Fair.html) (http://seantheflexguy.com/blog/2007/06/14/super-simple-sqlite-example-for-adobe-air-1-beta/)

IMHO, if you access the database using Air, I would prefer SQLite. If you plan to use a Flex + PhP approach, MySql would be your choice

Diego Dias
thanks for the quick response!
mtokoly
+2  A: 

AIR can communicate directly with MySQL, but this is considered very risky from a security standpoint. You'd need to put the database credentials in the compiled swf. This is slightly more secure than putting the credentials in a plain text file, but only slightly. Consider everything you put into the swf to be free game. Every .air file is a .zip that contains a swf that is your application. It is much better to use a service tier (such as PHP) to access the MySQL database.

SQLite databases can be used on the client to provide a local database for your users. This database can ad should be accessed directly from the application without the need for a service layer.

Joel Hooks
thank you. i am eventually going to be working on an iphone app that performs relatively the same functions. to keep it simple, would php and mysql be a good choice? also, secuirty is important to me.
mtokoly
I hate PHP and use Python, but PHP is a could choice if you like it. JSON services are what I use for my iPhone apps, but for Flash/Flex you would want to check out AMFPHP (or ZendAMF), both of which provide excellent communication via typed objects to the service.
Joel Hooks
and yes, MySQL is an excellent choice.
Joel Hooks
i was about to switch from php to something else until i came across pdo. MUCH better than mysqli. thanks for the great responses!
mtokoly