Remote Backup User Data on iPhone - objective-c

I wrote a few iPhone apps using Core Data for persistent storage. Everything is working great but I would like to add the ability for users to back up their data to a PC (via WiFi to a PC app) or to a web server.
This is new to me and I can't seem to figure out where to begin researching the problem. I don't want to overcomplicate the issue if there is an easy way to implement this.
Is anyone familiar enough with what I am looking to do to point me in the right direction or give me a high level overview of what I should be considering?
The data is all text and would be perfectly stored in .csv files if that matters.

Unfortunately, I don't think there's a good all-purpose solution under the current SDK. Here are some ideas:
If you only want backup, you could just back up the whole sqlite file to the server or over wifi, but you then can't really use it with anything other than Core Data (and you might even run into trouble with iPhone-Mac compatibility, e.g. between 32-bit and 64-bit types).
A very robust solution would be to implement cloud storage with a REST API and sync the iPhone and desktop app to the server (this is what the Evernote app does, for instance), but that is obviously much more work.
You could also manually convert your data to a .csv and send that to the server or desktop, but parsing it could be problematic (and you'd have to worry about the data getting corrupted). If you did want to go that route, here is a tutorial.

Related

Storing large data in react native for offline usage

For our app we need the app the work offline 100% with the most recent data.
Normally the app uses a symfony api platform API to fetch data paginated server side.
But when someone is using the app in a area without Internet he still need to be able to access all data to make a new job and que it for when he is online.
So our tough is to make a json that has all the data and send it to the phone when the phone has connection.
When the phone is using the app live, it will use pagination from server and fetch data.
And when offline it will use the local downloaded data file.
Problem is the data is large, so storing it is the problem.
We are now using redux persist and we see so many people have problems with crashes and mobile ram.
We also thought of using sqlite or just async to store a json file, or download a sqlite file from the app.
How do you guys feel about this
You can use react-native-local-mongodb. This can help you store a json database on your phone.
Other option is to have react-native-sqlite-storage in case your database has to be relational and requires table.
You will have to sync this local copy with the server once this user is online. This too can be done if you have the timestamp saved of the last sync. So after that, you ll just have to sync the data created after that timestamp.
However, I had also implemented react redux persist and it didnt crash. I suppose, the reason for crash must me something else.

Confused about data flow and parts involved in sending iOS push notifications through a database

I'm creating a college dining menu app, in which I need to send push notifications based on the daily menus.
I only know objective-c, so I'm inexperienced with concepts such as databases that are needed for this task.
What I understand:
I need to parse the data from the online dining menu and store it in
some database
I check daily if the current menu has what I'm looking for, and alert the Apple Push Notification service if it does
Above two points must be done without independently of my app, since the app won't be open at all times.
Resources I found:
Heroku -- a cloud platform where I can store the data
Helios -- "provides backend services" like push notifications and can be implemented w/ Heroku (not entirely sure what it does)
Ruby on Rails
What I'm confused about:
How do I store the data in the database? Do I have to write a program
with ruby on rails that scrapes the web data and then somehow add
this to Heroku?
What exactly does Helios help me with?
What is my actual objective-c app code responsible for doing?
Are there any other parts/better resources I left out?
Any pointers would help. Also, I'm trying to avoid using any paid services for server/database tools.
Let me explain it for you:
Heroku is just a way to host on the Amazon AWS cloud infrastructure. It doesn't store your DB - it provides access to db
infrastructure, but doesn't host the DB itself
If you want to store cross-platform data in your iOS application, you need to connect to a third-party db (this is how FB works)
This means if you want to keep up with menu updates on your phone, you'll need to firstly have a central db (hosted on Heroku's
recommended db infrastructure), and then use the iOS app to connect to
it
The trick will be to take any updates from the database & display them using a push notification. I don't know about this, but the Rails part I can tell you about:
If you want to store a menu in a db, you'll need a db. You can get one either at AWS or Heroku (notice how the db != rails)
Next, you need data in that db. This is where rails comes in - you'll be best using an infrastructure such as Rails or CakePHP to manage the data
If you create a simple Rails app with admin backend, you'll be able to upload as much data as required to your db. If you need to "scrape" the data, you can create a simple script & cronjob to get it & put into the db
Finally, each time the db updates, you need to send the update to your iOS app. I don't have much experience with this, but it seems you need to use the pub/sub programming pattern to send the updates to your device (displaying them on screen as a result)
Answers
To answer your questions directly:
You store data in a db through Rails or another framework
Helios looks like it will connect your iOS app to your backend db infrastructure. Don't know how it works, but it looks pretty good
Your objective-C code gets the iOS app running natively on iPhone / iPad
I think you'll be okay with what you have here

win8 store app access local storage

I am developing a Win8 Store app which allows users to download different types of files from an online learning platform and store them locally. I am also considering the function to help users organize these downloaded files by placing them in different folders (based on course name and etc.).
I was using Documents Library previously. But for every type of file that the user could download, I need to add a file type association, which does not make a lot of sense since my app would be able to open such files. So which local storage should my app use?
Many thanks in advance.
Kaizhi
The access to storage by Windows Store apps is quite restrictive, especially the DocumentsLibrary.
As you have noticed, you need to declare a file type association for every file type you want to read from or write to the DocumentsLibrary. This means your app need to handle file activations for these types in a meaningful way, which your app probably should not do.
But even if you jump through this hoop, there is another one that is not documented on the MSDN page of the DocumentsLibrary, but "hidden" in a lengthy page about app capability declarations: According to the current rules, you are not allowed to use the DocumentsLibrary for anything but offline access to SkyDrive! Bummer...
So what's left?
You can use SkyDrive or another cloud storage to put files in a well known place (which might or might not be somewhere on the hard disk). This is probably both overkill and undesirable in your case.
Or you save the files in the local app storage, provide your own in-app file browser and open the files with their default app. Seems viable to me.
Or, maybe, you can do something with share contracts or other contracts. I don't know much about these yet, but I doubt that they are helpful in your situation.
And that's it...
(Based on my current experience. No guaranty for correctness or completeness)

Dropbox API - Using Dropbox as a server

I was wanting to use a file sharing server to keep certain files up-to-date and constant across multiple instances of my application across multiple computers - like (for example) writing a multiplayer game, which stores all the player's positions in a text file, and uses something like Dropbox to keep the text file constant across all the applications, and each application instance can change the file with that application's player's position, and then the rest of the applications can update accordingly. This is only an example, and is not what I intend to do using this technology. What I want to do does not rely on fast sharing of data very quickly - but only periodically downloading and updating the text file.
I was wondering how I might be able to do this using the Dropbox API for Objective-C without prompting the user for any Dropbox username/password - just store a single Dropbox account's login information, log into it automatically and update/download the file stored on it?
From what I have found out from experimenting, Dropbox prompts users for their passwords via a web-broswer, and is designed to accommodate multiple accounts, whereas I only need to accommodate the 'Server' account.
So, is there anyway to do this sort of thing using the Dropbox API, or should I use something else. Or do I need to find out how to write my own server. Using some sort of file sharing API seems a lot easier to me than writing an actual server.
Thanks for any help,
Ben
You might think about using Google App Engine (GAE). I had a similar requirement recently and I'm thinking this is a good option when you want centralized data. Plus you can do the no-browser account login by using your own custom authentication, or I think it's even possible via OAuth? Depends on how sensitive the data is I guess. I just rolled my own.
From my research I found that using Dropbox as a server has some issues with scalability, since you'll be limited to maybe 5,000 calls per day. source It's built on Amazon S3, so you could also look at using that directly.
GAE lifts that limit up to 675,000, but can be increased up to 91 million for free.
https://developers.google.com/appengine/docs/quotas
I did find an open-source project for doing this with Java, alternative you could look at Python example
I've written a daemon that continuously checks for updated files and syncs them. I wrote it for my own file manager iOS app. You can find the implementation here:
https://github.com/H2CO3/MyFile/tree/master/DropboxDaemon
I'm personally not an iOS developer but I came across this question while looking for something else and thought I would offer up another potential solution to the OP's question.
Microsoft just released something called Azure Mobile Services which supports iOS development (among other platforms). It's basically a convenient way to set up a back end system complete with push notifications, authentication, etc. without rolling your own. You don't need to know anything about Azure or servers as the setup process walks you through most of it. It is new so keep that in mind, but it looks promising for situations like this.
Here's a 10 minute video explaining how to use it with an iOS developed app along with links to more documentation:
http://channel9.msdn.com/posts/iOS-Support-in-Windows-Azure-Mobile-Services/
Hope this helps.

Adobe AIR for an offline application: is this the best option?

I'm looking to develop an offline version of an application that still needs to connect to the live site to retrieve the information and store results.
The application is for an online course system, that now needs to work when an internet connection is either unavailable or flaky. The system currently tracks each page viewed of the course (with flash and video content) and then also displays and tracks the taking of multiple choice exams. This all needs to be provided offline. I'm thinking that the program will connect through the users account at the start to download either a portion or all of the course, including exams and then at the end connect again to upload the results. (It'd be cool if it could do the process automatically when a connection is available.) The application needs to look similar to the online version and needs to be easy to use (easy install, little user input required for upload/download of results).
I have done a bit of research and it looks like Adobe AIR might be a good middle ground between the online version and an offline version.
My biggest issue is that I don't have experience developing desktop applications as I am a PHP developer, so I'm looking for something like AIR that bridges the gap. (The online version is a LAMP application.)
Has anyone used Adobe AIR for this type of offline application? How easy and secure was it?
Are there other solutions out there?
I think AIR is a great choice for this. I use AIR all the time now for in house utilities I write.
The built-in database and persistent store are great.
From your description, it sounds like Google Gears is a little closer to what you're looking for.
Adobe AIR is a great solution for this. We are building something similar. But we are facing problems in resuming downloads if the download process gets broken.