Hi,
I’m starting work on a new app which is a native app version of an existing client project
My clients current process is when they are working in the field they use safari on an ipad to load and login to a php/mysql web-app. The remote staff team then works on the job filling in simple form inputs, taking photos and writing a short final report statement before submitting the form and it does a set of writes to the mysql tables which are then turned into a pdf report by the office admin team.
I’m looking to develop the native app in Corona and build an app to do this. Obviously the form fields etc are straightforward and I can save the images and form contents locally to the device using the standard Corona methods. I will then need to sync this information to a MySQL database on a server. I have a few quick (hopefully simple questions?) - I’m a reasonably proficient PHP/MySQL dev and have picked up the basics of Corona by doing the tutorials and some reading but I’m still a bit green on the whole app dev side.
- Can Corona talk directly to a MySQL database?
I’ve done some digging on this since writing this first post and realising I needed to wait for it to be approved and I think I’d need to write a PHP middleware script which does the database querying, converting from and back to JSON - I’m happy with this approach.
- Is this wise? I’m currently reading/writing to tables on my VPS as I have a secure login process for the web-app, if I put a user/pass in the LUA code can this be exposed by “opening/cracking” the .apk? (or .ipa)
Using the middleware solution from (1) the user/pass is less of a concern however I’d want to pass a ‘token’ or similar to the script so that only app installations I permit can run the scripts - should I assume basically anything I write into the LUA source code can be read as plain text when extracted from the .apk/.ipa? Or is there something basic I’m missing which I can pass to the script as a identifier?
- Should I use a plugin for this? I’ve seen an S3 plugin and a Coronium Core plugin in the store? I’m not sure if these are more secure than a DIY solution and worth pursuing or whether they would be a sledgehammer to crack a nut so to speak?
I suppose this is really the core question - does my use case match the delivery of either of these? Or am I better writing my own php middleware?
- The web-app is clearly a “live” connection, some of the form selection contents are loaded on the fly as per the clients customers instructions, as the native app is offline some of the time I’ll need to sync the data before creating a “job card” for the field team - is there a recommended plugin or some sample code for this process? I’ve looked around and some of the older forum posts refer to it but I’m not sure if they are still relevant to the latest versions of the SDK.
Thanks for any advice/help - it’d be much appreciated.