how to upload Sqlite database file to server from iphone application in ios - iphone

In my iphone application i used sqlite3 for creating database.
Now i want to take backup of a database file on my server.
so how to upload my sqlite db file to server from my application in iphone?

I would read the sql database into a JSON object, then upload it to a server via a URL that calls a PHP script along the lines of this stack overflow answer!
Here's an example of some mySQL data wrapped into JSON:
{database:{"col1":"56","col2":"85","col3":"some_text"},
{"col1":"57","col2":"86","col3":"next row"} }
More about JSON payloads in Apple dev docs here JSON
As of iOS5.x, Apple now includes some JSON helper classes, see NSJSONSerialization class reference along with the Twitter example app.
I have used this the SBJson framework in the past for iOS SBJson

Related

Where to put server address where data will store?

I am creating an app that capture video and upload it to server i have create the code for capture video ,and for upload I am studying this code but I did not understand to where to put my server address to store data there.
And also is there posible to store video using FTP because in my company PHP and .NET guys use FTP and i want to know that i am able to upload video using FTP in my iPhone app.
In the WebService.m file, there's a placeholder that says "your URL string", replace that with your actual server.
If you want to use FTP, you can do that as well using a networking library that supports FTP, one in particular is the very popular libcURL library.

Customizable iOS Message Composer

I'm trying to replicate the iOS SMS Composer, but I need to change the data source for the contacts that are recognized and that are converted into the little blue things. They shouldn't be loaded from the phone's contacts, and I'm retrieving that data via JSON.
Are there any libraries out there that do this?
I don't think this is possible.
However, there is a library called Three20 which has a custom Message Composer (TTMessageController). That allows pointing the data source to a JSON data.
http://three20.info/

Communication Of iPhone and Google App Engine

How can I get a pdf data (stored in datastore as blob) from iphone if i make a request to google app engine?
When I use
self.response.out.write('asadasd');
in google app engine code
I can see this 'asadasd' in iPhone.
But i don't know how to set this communication so that i can get a pdf data from i phone.
Thanks in advance!
If I understand corretly, you want to send an pdf file to a webapplication, right?
I think it would be a solution to base64 code the binary data of the pdf on the iphone (that comes from your blob) and then send it via http post to the webapplication.
You should set the proper headers before writing to the output stream:
self.response.headers['Content-Type'] = 'application/pdf'
self.response.headers['Content-Disposition'] = 'attachment;filename=filename.pdf'
self.response.out.write(...)

iOS: migration form plist to SQLite data store

I'm using the plist for storing data in iphone application, but now there is a need to upgrade to more powerful data warehouse. Can I upgrade the application to implement migration from plist to sqllite without losing data? Thank you.
Probably.
When your app launches, if it doesn't have a database file (because it's the first time being run with updated app), read in the plist data, and write it out to your new database file.
You will have to handle translating between the format of the plist and the structure of your database.

how to get data from web server to iphone or ipod

I'm quite new in iPhone development and I need to develop an app.
I must get mp3 data from a web server, which provides a simple saving the mp3 in my app document or folder
and use it in an application, which should also dislpay a table with rows like:
song1
song2
song3
But at present I don't know at all how to get this web page, parse it and store into an array in the application.
Please do you have any suggestion / hint / sample code ?
Thank you in advance,
There is a tutorial on the apple developer site on how to make a http request and receive data here. Should get you going on how to fetch the web page.
For parsing you can use the NSScanner or a XML/HTML parser library like TouchXML depending on your needs.
I used web services to communicate with web server, the following tutorial helped me a lot.
http://icodeblog.com/2008/11/03/iphone-programming-tutorial-intro-to-soap-web-services/
I was able to send and retrieve binary content using web service but I had to encode it first to be able to send it through Soap request and decode back Soap Response.
Hope that can help you,