1 person found this helpful
Yes, that's very much doable. Checkout http://www.adobe.com/devnet/air/flex/articles/creating_socket_server.html
Note that this functionality came into picture AIR 2 onwards.
I don't have experience programming sockets, but I will try it.
It would be great an example from Adobe showing how to use SQLite with a LAN.
well... I don't know!
that's why I'm supplicating for help
SQLite is a local DataBase, so I thought two options:
1 - The client sent the query to the server and the server execute that query, maybe synchronous so we avoid multiple connections, and before executing maybe we can stop the client from the server side.
2 - The client access directly to the .db file, and before tells the server so it can lock the DB access from the other clients until the first client ends.
I really don't know, I don't like any solution, and I'm very new with this, that because I think would be great an example from Adobe (or somebody else).
You can easily integrate to a remote db through flex. I would recommend to use a db on a remote m/c i.e. the server in your case & all clients interact on a single database. That would be much simpler to manage & a cleaner approach. Let the server deal with the concurrency part. See this http://www.sephiroth.it/tutorials/flashPHP/as3flexdb/
OK, but I think that solution has several problems:
1 - I need mySQL and PHP, so I need a server (maybe Apache) installed on the server machine, that's a lot of extra work for a simple DB I think...
2 - writing our query and login access inside our SWF is not secure, I was reading and many people noticed this too, they proposed some solutions (like hardcode the login inside the PHP not the SWF, and encrypt our querys inside AS3) but I think if I have mySQL PHP and a server ready I can just write my query in PHP.
I need to work in a LAN, without Internet (at really there is an internet connection but I don't want my app be accesible by internet)
I need my app to be accesible from all the computers in the LAN, and at the same time.
Every user (with their own user and pass) can read and write on the DB, and print too...
I can install Apache,mySQL and PHP on the "server" computer, I can write my application in C++ with FireBird too... but I was looking for the simplest solution. I'm very familar with AS3 right now (my C++ skills should be dusted before...), is not possible to make a simple DB app that works on a LAN with AIR and SQLite?
PS: An extra problem is arising to me now too... AIR does AIR protect our code? or anyone can decompile our application as easy how our SWF files?
It is possible to write a simple multi-user database with AIR 2, but is it simple? I would expect that following the herd by using established server and database software would be simpler in the end. You could use your AS3 skills for the client.
OK, so are you saying AIR is not the best option for a server application, just for client?
It's a pity, because installing a server like apache just for a simple database with a few users on a LAN looks like an exaggeration. I was trying to avoid that.
I think the Flash team should put a sample code or classes for a simple multi-user database with AIR 2.
Anyway, I think I can't use AIR for this then