iOS and Mac OSX communicating with MySQL database - mysql

I have a client who wants a control panel for the app I am developing them. The control panel is a Mac OSX application that allows the user to submit files (excel docs and such) to my MySQL database. Those files are then checked by the iOS app I have created for them.
I have no idea how to do this. I have the MySQL database all set up, and I have looked everywhere for a solution. Any help is appreciated.

I wouldn't try to connect to your MySQL database directly from your cell phone. It's a bad design for several reasons. Instead build a API on the same server as the MySQL database. It doesn't matter if you do it in java, php, c# or anything else. You might even find some product or open source project that can do this automatically. I've listed some benefits of doing it this way
It makes testing easier. You can write a test framework against your API that doesn't rely on or is using a phone.
It makes development faster. You don't need to emulate or use a phone to develop and test your table design and queries.
It gives you compatibility. When you need to change your database (and you do) you can create new APIs that the new version of the app uses while and old version still out there can continue to use the old API (that you might have to modify to still provide the same functionallity)
It gives you flexibility. If your user base grows and you might need to have replication for reads or sharded databases you build that into the API instead of into the app which is just a better way to do it.

One option would be to use PHP to handle all the database interaction.
Host the scripts on the server and just have the apps call them and get the scripts to return some sort of parseable response (I'd go for JSON).

I have never found a suitable Object-C based connector for MySQL. At this point I would suggest using a C/C++ connector. There's lots of examples of how to configure the connector for both C and C++. The hard part will be all of the data passed from the MySQL code and the Object-C code will that it will have to be in C types.
EDIT: An Example

Related

Windows phone 8.1: Need suggestion on what database should I use

For my Windows phone project (it's a Universal app), I have a set up that has a country and a phone number in one of the page. There are about 7 other pages that requests the user for additional information. But for starters, let's just stick with the first one, that asks for the country and the phone number.
I read through a million posts in Stackoverflow and other websites alike, to know what database system is best to implement with the sort of app I am going to be developing, or hoping to develop.
Here're my findings:
Azure SQL: I have an Azure account and I can use the Azure SQL service to store the user-input data directly to the database (when the app goes live), or while in the testing phase. But I got to know that feature isn't really working well as windows phone cannot readily update the data to Azure SQL, on realtime basis. Is it so?
MySQL: I thought I'd create a local MySQL database, for testing purposes, so as I input the data (in the emulator perhaps), the database saves it. I am unsure how I can implement this. I can't find any article I can read that can help me with this. There are with ASP.net, but it isn't what I am going to be using.
SQLite: I know for a fact the data can be stored locally, by using SQLite, but I could like to know if the locally stored data can be later updated on a server-side machine (i'd prefer Azure SQL, but MySQL is also OK with me). If it can be, i wouldn't mind settling with it. If it can't, what can I do?
It all boils down to this: What's the easiest way to store data entered in a textbox (lol, yeah!) to a database (locally or server-side)?
Your efforts to help me will be greatly appreciated!
Thanks!
You can stay on Azure SQL if you have an account.
It works fine and it updates database on the go (sends json as far as I remember), so you shouldn't worry about data being stored in a cloud. Moreover, it is super-easy to use it for your needs (store data from textbox).
Azure SQL will get your bootstrap the fastest for your application. There is no need to deploy MySQL or SQLite and managing your DB. There should not be any concern about updating the DB live from the app.

What database for Data Acquisition?

I have to develop a database that will be used for data acquisition, mainly measurements from micrometer which will be compared against a Reference Table inside the db. The platform is OS X. I have been looking at Valentina-DB, SQLite and even MySQL.
My main requirement is: The database will be used by factory workers which may not have a lot of experience in using software. Therefore, the front-end has to be extremely easy to use. This includes installation of the database and the front-end.
What are my options when it comes to custom GUI apps?
Most of databases have no GUI front-end to use "by factory workers for data acquisition" so you need to program it yourself.
One of the approaches would be to use Java Swing GUI and some Java-based database like Apache Derby maybe. You could put everything into runnable jars, talk to database exclusively directly (not network setup, no authentication) and Java is available on OS X form Oracle website. Seems relatively easy to setup and would also run under Windows if at the end desired. This is not the only possible approach but something that is likely to work.
There are many possible alternative approaches.

Connecting visual c++ to an online database

I am working on an app in visual c++ which requires data to be accessed from a database which can be edited so that every time there is a modification to the data I do not have to resend the app as it will automatically update, it is also required that this is a desktop app.
I am currently using MySql however for this to run constantly I will be needing a server which for a single simple app wont really be worth purchasing, so I started thinking of alternative methods and thought to myself there must be some method of reading directly from a website or online database, am I correct in thinking this? If so could someone please explain how I would achieve this?
Also, I have purchased phpmyadmin in the past so if there is any way I could connect my visual c++ app to a database from this then that would be great.
EDIT: Note, this app relies almost entirely on the database as it is just 3 combo box's and one text field all of that values for which come from the database.
The following response is assuming that by online you mean on the web.
You cannot exactly 'connect' to an online database with C++ (or anything outside of that server hosting the database).
What I would do is create some PHP API's that you can POST to with libcurl via C++. You can both send and receive data this way.

Desktop programming language to connect to remote MySQL

A customer of mine asked me a better and faster solution to update it's real estate web site as he and his employees don't want to connect to the web site and update one by one the ads as they don't want to loose time waiting the normal latency of the internet.
I firstly solved the issue by building a PHP script that imported an Excel file into the web site's MySQL database and it worked greatly. But the problem were pictures that have still to be uploaded separately. I then wrote a PHP script that uploaded the pictures using ajax and drag&drop so the user could select multiple pictures and upload them at once. And this worked too, but the customer is still not completely satisfied as he says this solution is quite 'patched'.
I then thought about a desktop application - a kind of local database (could be SQLite) - that the user keeps updated locally and only at the end of the day the app connects to the remote server and updates the db and uploads the pictures.
My question is: what EASY desktop high level programming language I could use to do the job? Do you know any RAD (visual IDE) programming language able to connect to a remote mySQL server and upload data via a simple custom GUI?
I tried RealBasic and PureBasic but I did not work it out. I thought about building the app in PHP and then convert it to EXE but I did not tried yet.
Please don't suggest me Java, C or Delphy as I'm looking for something very easy.
Thank you
Have you considered a client side javascript/html app that syncs with the server, since you're already familiar with the platform? If one browser better supports what you want to do (Firefox has some extension perhaps vs Chrome, or whatever), than mandate that to run this app (rather than worrying about being portable across browsers).
All of the browsers can have client side storage now, and you can just do things locally, and finally push them to the server "all at once".
If your client is using a Windows platform, you could use IronPython (.NET), VB.NET, or C#. These all allow you to create windows/forms visually in Visual Studio. If you're not already familiar with the .NET platform I'm not sure how 'easy' this will be, but I think that's going to be true for most other platforms as well.
That being said, it sounds like your existing solution is probably the best idea - perhaps if you can make your solution feel less like a "patch" they will be satisfied.
No reason you can't use Purebasic if that's what you're comfortable with. There are HTTP file upload examples on the PB forums.
I've used Purebasic for years but I'd recommend spending the time to get to know C#/.NET - it's a world of difference and once you learn it stuff like this is pretty easy.

Interface between CardDav server and MySQL database

My web app uses mysql to store contact data. I'd like to sync this data via carddav with mobile devices. I understand carddav is based on a file system, not a database. What software is available to act as an interface or wrapper to make the carddav server work with mysql? or other relational database?
You might want to take a look at Bedework.
Baikal just added this feature!!!
Most dav servers are file system based. If you use SabreDav you can build a virtual filesystem based on your own backend. Baikal is a project that uses sabredav, and a virtual file system. Until recently it stored its data in sqllite. Now it supports both mysql and sqlite.
Its still not 100% mature, but its a great starting point. Playing around with it, I have been able to create contacts directly in the DB (by uploading vcard blobs to a table) and then having them show on my ipad addressbook.
After evaluating many systems, ones built on sabredav like baikal tend to be the simplest to build on. Fruxx is something else you may also check out. Its a hosted system, but will soon have an api.
Last if you are looking for a very elaborate system, then take a look at tine20. It supports activesync (illegally in the usa), carddav, caldav, and has a decent extjs web ui. It natively stores contact information in its mysql store, which is nice since you can update a contact through a sql statement without having to build a vcf file. Where tine doesnt make sense is that it uses a bit more resources because of all the features it offers, and the complexity has ensured that it has a VERY complicated database schema. In other words, you are probably better off creating a rest api on the tine source code rather than doing bare sql inserts.
http://baikal-server.com/