iOS file downloading library - ios

In my iOS app I use HTML5 files as game levels. New levels will be added in the future, so I need to create a smart solution that will sync files on device with files on the server each time a new file is added or an existing file is updated on the server. Ideally it should work like SVN update. Is there any existing library that solves this problem?

you can use a web service, you will have to implement it on your server [with your favorite language-framework ie: php-codeigniter, python-django, ruby-rails]
I recommend using JSON for simplicity.
on your iOS side, with iOS 5 you can use NSJSONSerialization

Related

Updating .stringsdict localization files over-the-air

I'm looking for a way to update stringsdict localization files over-the-air without having to release a new version in the appStore. So ideally I want my stringdict files on a webserver, and the iOS app should download these files from the website and update the local strings.
After doing some research, I realized that we cannot update files in the bundle it was shipped in however I found some reports saying we could store/load localizations in/from the application support folder.
source #1
source #2
source #3
Can this also be applied to stringsdict files because I'm trying but no success so far.
Basically you need to create a .bundle with your new strings and make your app download it. After that, I think it's possible to create a NSBundle object using your freshly downloaded translations and swizzle a couple of methods from the main NSBundle currently used by the system.
I've tried something similar, but found out that it's much easier to integrate an existing service such as Smartling or Lokalise. They already have an SDK that allows you to update your translation over the air.
Also I found it's much easier to manage all my translations there.

Fetch data from web service in ios

I am developing an iOS app that should pull data from a web service. Now i have developed a basic structure and layout and implemented it to show static content.
But when i try to load data from an api with the use SBJSON Lib, it gives a lot of errors as It dose not support Automatic reference counting (ARC) which is forced by xcode5.
I Found a solution to that by disabling ARC in the whole project, but again there were a lot of errors as i did not have ant data release mechanism to free the memory space.
So Now, my question is that is some lib that can be used with automatic reference counting or use any method to use SBJSON lib but not mess up my whole project.
I am quiet new to iOS development and don't know much about available options. I have googled the issue a lot but nothing worked in my case.
Also i read about an inbuilt json lib that can b used for development (introduced from ios5 , I think!). How to use it and is it any different/ better than other 3rd party lib available.
Technology
iOS : 7 or later
xcodeversion : 5.1.1
Application : universal
Any suggestion would be a great help.
Thanks in Advance!

Persistent storage (WebSQL and local storage) in iOS 6 w/ PhoneGap

The issue of iOS not persisting localStorage/WebSQL databases has been discussed frequently here and on other sites. The problem I am having is that the workarounds are so varied and have evolved over time. I have found 2 different PhoneGap plugins which use the native SQLite API, a plugin that periodically copies the SQL database to the documents directory,and even suggested settings in a Xcode .plist file that can be used to specify the location of SQL database. It's confusing because I'm not sure which solution applies best to the current point in time (iOS 6+ and Cordova 2.4+). Is this built in to Cordova now or do I still need a plugin. If so, which plugin? What about the setting the database location in an Xcode config file. Any help is deeply appreciated
Current versions of phonegap don't require a external plugin to use SQL with a sqlite database. The current code is compatible with iOS. You don't need to write/implement your own workaround, and you can be sure that phonegap will implement werever you need to get your app running (that's why the name phone-gap they will fill the GAP).
http://docs.phonegap.com/en/2.1.0/cordova_storage_storage.md.html#Storage

iOS 6 local storage file appears twice

I have an app that uses local storage (using sencha 'Ext.data.proxy.LocalStorage') to view some content offline. I was rejected by itunes for violating the iOS Data Storage Guidelines.
I thought it might be related to the localStorage being inside the /Documents folder in iOS before iOS 5.1. To confirm that in newer versions the document folder is empty I checked, but I still found a .file__0.localstorage.
The strange think is that the same file (but without the leading dot) also exists in the library/caches folder, where it should be.
Both have the same content.
Does anyone know how this can happen? I already asked in the Sencha Support but it does not seem to be related to the Sencha framework.
Note: I am not using PhoneGap, only Sencha.
Making a very small Hello World Application with Sencha that writes to local storage I could reproduce this behavior. It seems like on application exit, it will write a copy of the localstorage file to the /Documents folder.
This seemed suspicious to me and it reminded me of the PhoneGap patch for iOS 5.1 that backs up the localStorage file also.
With iOS 5.1 Apple started to put the localStorage file in the Library/Caches folder which broke many applications because the data was no longer reliable stored. So PhoneGap and others started to implement Workarrounds that backup the localStorage file to the documents folder and automatically restore it if needed.
Trying to find proof that Sencha does something similar, I opened up the resulting .app package and found a stbuild_template file that contains the native wrapper code. It is of course compiled, but searching for the string "localStorage" results in some interesting results like:
restoreLocalStorage
preserveLocalStorage
Could not remove source file while backing up localstorage Could not copy localstorage backup . Caches WebKit/LocalStorage .file__0.localstorage file__0.localstorage
SNLocalStoreageFix
Also I found a lot of references to NimbleKit which seems to be used internally for the packaging.
This thread also hints at a solution for the iOS 5.1 local storage problem in Sencha Touch 2.1 which is what the OP is using: http://www.sencha.com/forum/showthread.php?194674-Localstorage-and-native-iOS-5.1-apps&s=04149e771f9c4eea15cb6f6d97069ff6
All this is evidence for me that Sencha implemented a workarround for iOS 5.1 which will put the localStorage in the /Documents folder. Since you only use the localStorage file for caching, Apple rejected you because you store non-user data in /Documents.
I think using PhoneGap there is an option to disable this backup. So you might want to consider using this or ask Sencha if they have a similar option to disable it.

Phonegap + JQM - Phonegap.js?

I am just getting into building a basic app using JQM and Phonegap.
I am using the Phonegap Cloud Builder and so far everything is OK!
But now I want to try and use some of the phones features e.g. the camera. I have read about people doing this successfully using JQM, but the hurdle I am stumbling on involves 'phonegap.js'
As I understand, this file is created typically when a new project is created (using Eclipse of XCode etc). My 'app' is being created by hand (hence using the Cloud Builder) and therefore I have no access to phonegap.js.
All the documentation I find is old and says the files are in the zip download, but they are not. I also figured that the Cloud Builder creates this file, but no idea where it places it in relation to the index page for me to reference it.
So, how can I get hold of the phonegap.js library to use the phones camera, when I am not using an IDE (this is likely to change if there is no way to get the file without one)
Download PhoneGap here: http://phonegap.com/download/, depending on platform you are developing follow appropriate tutorial included in documentation. Ether way you will be having www folder inside your project with phonegap.js file in it. Copy your jQm web application to www and append phonegap.js file in of your index.html. Now you will be able to compile native application that can access phone resources.

Resources