DB to run on OS X server that will sync nicely with Core Data on iOS? - iphone

I am trying to plan out a few iOS/server apps for internal use. On the iOS side I'll use Core Data, but I'm not so sure what many people do on the server side. I will be running a Mac Mini with OS X Server 10.6.X. This app will need to sync when the iOS device is on the internal WiFi as well as over 3G. Some of this data will need to be accessed by the company's external web site which is written in PHP, as well as by native apps on iMacs internally. Should I just use a MySQL db on the server, and expose a web service, or is there a better way by using Core Data on the server that would make syncing the iOS device easier? The data is not too relationally complex. I'm thinking tblClient 1->M tblJob 1->M tblImage/Drawing.

In most cases, the server side doesn't matter because your communicating with URLs and some standard data format like JSON.
You can connect to a remote Core Data store but it doesn't handle multiple access so there's seldom much point to doing so. You could write your own server that uses Core Data but usually its quicker and easier to use a preexisting package dedicated to server work.
My advice is to go with the server that is quickest and easiest for you to implement and maintain with the knowledge and tools you have on hand. It's easier to adapt the client side Core Data to inputs from the server than it is to attempt to integrate Core Data directly into the server.

Related

How to connect a C# Windows mobile 6.5 app to a Postgres database?

I'm developing an application for Windows Mobile 6.5 that needs to get and send data from a Postgres database within the network of the app.
I've googled it and read every page on the matter but haven't been able to find a solution.
The npgsql driver doesn't work on this sdk.
Much like for Android or iOS, I'd recommend that you build an intermediary web service that's provided by a server on the Internet that the phones talk to instead of talking directly to the database. The web service would accept REST+JSON, REST+XML, XML-RPC, SOAP, or whatever your preferred web service procotol is from the phone clients. It'd act on the requests from the phones, doing whatever is needed in the database to satisfy the request, and return any result via the web service protocol.
This means your individual phones don't need connections direct to PostgreSQL - a good thing, since phone network connections are flakey and the retry/re-establish logic can be hard to get right. You'd land up with lots of dangling connections to the Pg server. You're much better off with a stateless protocol like HTTP to talk to a web service that then does the real work.
Choose whatever web service protocol is easiest to work with on Windows Phone 6.5 and implement it using your preferred back-end server. In your case I imagine that's likely to be .NET on IIS.
Depending on the app, you might already have a web service protocol. If you have a modern web page version then it's fairly likely to use JavaScript with REST+JSON to call server endpoints, in which case you may just be able to extend and re-use those for the phone app.

Remote MS SQL or MySQL Database on iOS

I currently have a website that uses MS SQL and I am interested in creating an iOS client for that website. I would the app to connect to a remote SQL database that is hosted on my website and then I could pull information from that database and display it locally on the device. I would like to also publish information to the database. I am open to use MySQL.
Is this possible and if so does anyone know of any good tutorials that I could check out?
I'd highly recommend placing a thin web layer between your database and your iOS client. You don't want iOS apps connecting directly to your database (unless this is for your own personal use for limited to a handful of people you really trust).
You could write the web layer in PHP (or whatever you fancy). At that point you can use HTTP and JSON between your iOS app and your database.
Put a web service between the phone and the DB.
There are two options :
You can develop webservices/scripts or whatever server side solution that will make your database talk "publicly"
Use a third-party library (like this) that will make your app communicate with the MySQL database.

iphone XCode-Wifi connection

I am a beginner in iPhone development. I have a single static IP server in my company. I have one web service on that server which gets data from an intranet MSSQL server. I would like to get that data over WiFi to an iPad app, but only over our intranet.
Have any useful links or a sample project? I am using XCode 3.2.6.
It sounds like this is a simple web service consumption scenario, so I would start with consuming it using JSON as the transfer data format and using NSUrlRequest.
Here is an article that walks you through everything you need to know in almost painful detail. It should get you where you wish to go.

Can Core Data be used on Linux?

This might be a stupid question, but I was wondering whether or not you can use the Core Data libraries on Linux at all? I'm planning how to build the server side of an iPhone app that I'm working on, and have found that you can use PyObjC to get access to Core Data in a Python environment, e.g. use Core Data in a TurboGears web application.
At this point I'm thinking that you would have to run the web server on Mac OSX, because I can't find any evidence on the internet that you can access the Objective-C libraries on Linux. I've always written webapps on Linux but will obviously make the jump to an OSX server if it allows me to use the same datastore implementation on the iPhone and the server, the only job remaining being the Core Data <-> Web Services XML translation that has to happen on the wire.
Core Data is part of Cocoa, and Linux does not have Cocoa. Use SQLAlchemy instead.

How do I write a desktop application that syncs with the iPhone?

For example, how would I write a program like senuti? Are there any libraries I can use for this? It would be ideal if I could do this in Python or .Net, but I'm open to other things as well.
There are three things you can do:
Add some code to your iPhone application which acts as some kind of server (http, SMB, etc). Then your mac/windows full client application can connect to this server over wifi. This is safe and reliable, but unfortunately the app will have to be running on the iPhone at the time of sync.
Sync to the "cloud". EG: Have your iPhone app save some data to a web server on the internet (you could use amazon EC2, windows Azure, or even just a PHP script running on a cheap hosting account), and then have your windows/mac client also connect to this web server to retrieve the data. This is the most user-friendly, but it requires you to pay for the hosting of the web server, and will be unsuitable for large amounts of data
Violate the EULA and try to reverse engineer the way iTunes communicates with the iPhone.
This is how senuti works, but I wouldn't recommend it, as they're constantly having to play catchup with apple changing the format underneath them, and they are probably exposed to some kind of legal action, if apple ever bothered to sue them.
i believe Version 3.0 will resolve this as it allows you to program apps to the USB interface. check out some of the documentation for that in the External Accessory framework.
it would still require the app to be open, so essentially would mean two syncs (or more if you have multiple apps)
There is no legal / official way of doing this. Creating a program that would sync with an iPhone would violate the EULA you agree to when using the iPhone and iTunes.
Not only is it illegal, but it's also impossible to do this reliably. Apple could break the method at any time without any notice, and it would pretty much be a cat-and-mouse game.
I only know of one application that something of the kind, and it is the iToner application which synchronizes ringtones.