Implement two way syncing with Mysql In Iphone - iphone

In my App I Want to implement two way syncing with My server. I want to work offline When I do not have internet. I have managed core data for that. But at starting of my app I want to load all my data(that contain text , images) to sqlite file.
Is it a good approach? I think It is not user friendly. After Offline work I need I want to sync the changed data with server. I achieved it with the CSV File(text in CSV file and all my images are going with NSURLSessionDataTask). But this work is so complex to handle. Can any one help me with a good solution. Every solution is welcome

Related

Manage downloaded contents in iPhone apps

I am writing an iPhone app which would download articles (UTF8 text files) from my server. The app is then supposed to produce a listing of the filenames. Upon clicking the filename, the file contents would be displayed. It is very similar to an email program or RSS reader.
My question is, what is the best way of saving / retrieving the content on the device? One option is to put it all into a sqlite db. The other option could be to download the contents and save it in a new file. Any other solutions?
Any advantages/disadvantages for these approaches?
Thanks in advance
For some rather small amount of data in a simple structure you could store it in an NSMutableDictionary and use its methods for writing the content to file and for reading from a file.
Your data structure seems to be simple enough for that. If the amount of data is small enough I cannot say. If your list may grow endless then you shoud go for sqlite or for core data rather than a simple dictionay. A dictionary will be stored completely in RAM. With sqlite ore core data you can utilize RAM more efficiently by loading not much more records as are curently displayed.

Xcode database usage confusion

I am new to iPhone app development and have a question about storing data. I've spent quite sometime learning about core data but still confused about the concept of persistence store.
What I understand is that core data is just a way of managing the data you downloaded from an external database. But given that core data is backed by SQLite, does that mean there exists a SQLite db in-memory while running? If so, does that mean when I use core data it will be more effective if I download a huge data set at start? But what about apps such as twitter or Facebook that require constant update of data, is a straight $NSURLConnection$ sufficient in these cases? If core data is used, will the extra overheads (i.e. data objects) be of any burden for such frequent request of update?
I would also like to find out some common ways of setting up an online database for iPhone app? Is it usually MySQL servers with a homemade Python wrapper that translates the data into JSON? Any standard server provider would provide the whole package? Or open source code?
Many many thanks!
I'm going to go through and try to address each of your questions, let me know if I missed one!
Firstly, Core Data can be used to store information generated in your app as well, there is nothing keeping you from using it in one way or another.
The way I understand it working is that the file, or other storage mechanism Core Data uses, exists regardless of whether or not your app is running. For a user to have to wait for a large database to be downloaded and loaded into a local database without being able to interact with your application is not the best way to do it in my opinion, people react negatively unresponsive UI. When a user may run your app for the first time, its possible you may need to get a larger set of data, but if any of it is generic and can be preloaded that is ideal, the rest should be downloaded as the user attempts to access it.
Facebook and Twitter applications work just as you understand in that a connection is established and the information is pulled from the appropriate site, the only thing they store is profile information, as far as I know. I would hesitate to use Core Data to store peoples information as eventually yes, there would be a significant amount of overhead caused by having to store peoples news feed or messages going back months on end.
As for setting up on online database that is something I'm unfamiliar with, so hopefully someone else can provide some insight on that, or if I find something I think may be of use, I will post back here for you. This part may actually merit its own separate question.
Let me know if you need to me elaborate on anything!

Simplest way to store and populate data for a demo application

I am currently creating an application that has a user, the user can follow others, post content, amongst a few other features and am wondering what would be the most ideal way to store and create data for a demo. I started building a rails site but felt that is becoming fairly time consuming for a demo application. Does anyone have any suggestions? pLists, JSON file, XML files?
What is the nature and size of the data?
pLists are convenient for a few dozen lines since they are easily converted into a dictionary at runtime.
If you have hundreds of items, you're probably better off writing an xml file and parsing it.
Simplest way is to way the object to FILE use Keyed Archiving. If you are bored about right almost same Keyed Archiving code each time. try to use Accessorizer

Data storage format for iPad app. Export to excel

I am fairly new to Objective C and iOS programming but am constantly trying to learn as much as I can.
I am about to start an iPad project which will involve storing large amounts of data which will need to be exported to one extremely large excel spreadsheet.(it's for a friend....they currently enter massive amounts of data into excel by hand so that they can analyze it).
This database contains over 400 names(this number is constantly growing) and the app will be very functionally similar to to built in contacts app, except that for each name there will be approximately 2,000 attributes. These attributes will be entered across tens, if not over a hundred views.
The excel file will be located on a local server and the database will be synced with it over wifi. If I have to write a server side application to handle this, I happily will.
My question is this:
What data storage method would serve best for my purpose accounting for the sheer size of the database and the need to export to excel? (i.e. CoreData?, SQLLite?, XML?)
I sincerely appreciate any help you might offer.
James
It'll be harder to create a CoreData store on the server end. I'd suggest using and SQLite DB. FMDB is decent frontend for using SQLite on the iPhone, but there are many others.
A framework for relational data such as Core Data or SQlite would work well for selecting and working with subsets of data. There's no innate export-to-Excel functionality but you could export a csv (comma-separated-value) file that Excel can import.

Import data from .xls File

I am developing an application in which i have to get data from .xls file. I am fairly new to iPhone development so any pointers in direction to getting started will be very much helpful.
The steps that i am thinking are :
1) First i need to convert from .xls to .csv Format.
2)Import the data from .csv file to SQlite Databse or Core Data.(I am not familiar with any one of them, so kindly suggest which one to choose. I am looking forward to use Core Data)
Am I thinking in the right direction? Will be greatful for any kind of assistance..
Thanks in advance.
While I cannot speak to the first part of your question, I can give you advice for the second. Because you are importing the data as opposed to writing back to the xls format, you want to go with Core Data. There is no reason to be using sqlite directly anymore.
I think sqlite is a good idea if you want to be able to use the same datastore with multiple different devices in the feature. If you are targeting iphone only then go with core data. Also a sqlite datastore can be loaded back in with core data on top at a latter date if you want all that caching ability.