Save data offline in a database - ios

I'm wondering whether there is a technology similar to SQLite that would allow me to save data offline on different platforms including iPhone.
I'm using Phonegap so I don't know what the limitations are there, and whether it'd okay to use SQLite, or is there something better?
It's now working fine with Android, but will it be the same with iOS?

See the PhoneGap Storage API that's based on the W3C Web SQL Database Specification and W3C Web Storage API Specification. It's implemented for Android, IOS, and Blackberry.

Related

Record audio in mobile Safari

I need to create an iOS app that just displays a website. The site allows users to record audio. The purpose is to let mobile Safari users to record audio (which is currently not supported). Are there any decent solutions for this or am I going to have to hack my way through? So far I have the following two ideas:
1) Build a native application that contains a WKWebView of the site. If the website detects mobile Safari it will launch some JavaScript that the app can respond to (or it will try to bring the user to the App Store using Universal Links). The native app will then record the audio and send it back to the website somehow (either through an external server, or perhaps through JavaScript, not sure how much data can be passed, but it could be up to 1MB).
2) Use an existing solution using perhaps Cordova/PhoneGap.
Hope to get some tips!
Build an hybrid application based on cordova/PhoneGap seems to be the best in my opinion. In addition you can build for iOS and Android (if you need later).
You can easily use this plugin to achieve your app.

iCloud for web application

Has Apple provided public API for web applications?
I want to build an application which will be similar to dropbox.
I want the user to be able to manage files and edit them from their devices (iphone/ipad/mac) and from website (any browser based) too.
Is this possible now to see the list of files using iCloud API?
Thanks.
As I just stumbled across this thread while searching for a solution for iCloud contacts in my web-app, I just wanted to add that nowadays CloudKit JS seems promising for this use case. It's a bit unfortunate it needs an app on its side, but it's still better than nothing :)
Can I use iCloud API in web application?
No, Apple only provides APIs that can be used within native apps on iOS or OS X devices. There's no documented API that could be used for a browser-based interface to a user's iCloud account (some API apparently exists, since Apple uses it, but third parties do not have access).

Best practice to sync webservice with offline storage on iOS

I have been working on a few iOS applications that talk to a REST API on the web server and than sync some data down for offline usage. The app then stores data locally if network connection is not available and than syncs with backend whenever the Internet connection is available.
I am wondering if there is a nice pattern or set of rules or library that can be used. I would rather not code this again and again. I know the business logic / sync logic would be different for each app but the rest of the work (ie. storing it locally, calling REST API) can be abstracted out.
Any ideas?
I use the RestKit framework in my app for the exact scenario you describe. The downloaded data are stored in a Core Data store for offline usage.

What is advantage of embedding HTTP server in iOS app?

In linked in implementation, they have HTTP server implemented in iOS app. What could be the reason behind this architecture, if uiwebview already handles the HTML loading and rendering.
I don't think they have a HTTP server embedded as much as they are just making very liberal use of UIWebView and the features of HTML5.
And the benefits of doing this are that they only have to write a relatively general implementation of the LinkedIn mobile interface in HTML5 and those changes get carried across to iOS, Android, Windows Mobile, and whatever other mobile platforms support HTML5.
I have a couple of apps with an embedded HTTP server. This is used as one possible method for importing/exporting data to/from the app. The user connects to the app from their computer's web browser to the server on their iOS device. The user can then download a file from or upload a file to the app. I added this feature before iOS supported file sharing via iTunes and the Documents directory. It's now one of several ways to get data to/from the app.

Is it possible to sync ios document using mobileme?

Just wondering if it is possible to use mobileme to sync application documents in ios?
If so, is there any sample code out there? Thanks.
I believe you can sync to MobileMe as a WebDAV server. Currently there is no built in support to sync app data to MobileMe, that is rumored to be part of iOS 5.
In regards to MobileMe as a WebDav server, the first search results on http://DuckDuckGo.com was this: http://www.chrisdanielson.com/2009/08/13/mounting-mobileme-idisk-using-webdav-and-linux/.

Resources