Is there a way to overcome the 5MB storage limit on an iPhone WebApp hosted in an ObjectiveC native app? - iphone

We have a iPhone web application that uses WebSQL that is working fine. The amount of data downloaded depends on the user of the app. If the user has more than 5MB data, the user is prompted to increase the size of their database.
We then moved our application to run in an UIWebView hosted in a native ObjectiveC application. The application works fine if the user stays under the 5MB database limit. If the user has more than 5MB data, our application fails without prompting the user to increase their storage limit.
What are some alternatives to either pre-allocate the required database in the native app or somehow allow the user to be prompted to allow the database to grow to the required size?

You could write the html files to application documents directory and in database keep only the pats to the files.
Or you could use core data.

Related

Which database should I use for my flutter app using lots of images?

I want to build a flutter app which focuses on learning plant names with the help of a lot of pictures. In total there will be 600-800 pictures.
question: Do I store these pictures all in the app or in a database?
From what I read so far I guess the app would be too big if I store all these pictures in the app.
question: Which database should I use for storing such an amount of pictures?
I want to give the possibility to store a lection/course (containing 30-40 pictures) locally on the phone to be able to learn without internet connection.
question: Which database should I use for that?
Question #1: Do I store these pictures all in the app or in a
database?
You should not store all the images in your app. Use the Cloud Storage for Firebase service to store your pictures and download them to your app as desired.
Question #2: Which database should I use for storing such an amount of pictures?
You should use Cloud Storage for Firebase to store your pictures: "Cloud Storage for Firebase is built for app developers who need to store and serve user-generated content, such as photos or videos."
Question #3: I want to give the possibility to store a section/course (containing 30-40 pictures) locally on the phone to be
able to learn without internet connection. Which database should I use
for that?
You can save these pictures locally as explained here in the Firebase doc: "The writeToFile() method downloads a file directly to a local device. Use this if your users want to have access to the file while offline."
If in a database, get pic to many times, and much more than the free limit of database , we will prefer pic in app than in database.
But in app will never consider the cost, just keep the develop account. Maybe, a pic could compress down to 50kb each, and the app will not too big to download.
mongodb google-could amazon ... all database on the market can serve you.
above dbs are good. the more resourses on net, the better envirnment we like.

Is it safe to store senstive data in memory

I am planning to build a password manager in dart / flutter. For in app search reasons I would need to decrypt any data and store that and the master password in memory for the duration of the user session (they will be cleared as soon as the user is no longer on the app). Is that safe? the only issue would be the third party accessing the memory while the user is on the application, but I'm not sure how possible and easy that is.
I could use keystore/keychain and request the data when I need to access it (for search that would not make a huge difference). The only issue with this is the efficiency and the numerous number of keychain requests
Target OS: iOS, Android and maybe Mac and Windows and Web in the future
Any thoughts about this?

Can I pre-cache data to work offline in mobile app using AppSync?

I am developing an Android and iOS app that could be used in areas that have a very poor or no data connection. It is a requirement for the app to be pre-loaded with all of the data so it will work even if the app never communicated with the server, but it also needs to be able to update and sync when a connection is made. Is it possible to manually populate the AppSync (Apollo) cache database with data on launch and query and mutate it later? The app also contains several search and filter queries. Our backend API is currently using GraphQL.
I have seen this question, Is it possible to build offline-first mobile apps using AWS AppSync?, but it is a little different that what I'm asking.
The recommendation would be to hydrate (read: pre-load with data) a local SQLite database after install. SQLite is what the 'local cache' uses to persist data on the device.
Refer to this github issue for a code example of how to do this:
https://github.com/awslabs/aws-mobile-appsync-sdk-js/issues/160

How can I store more than 5 MB on an iPhone web app?

I am working on a magazine/portfolio application that is intended to be readable offline, saved as an icon on the home page.
This is using a lot of images, but while I can keep the images down to a respectable size (200 KB or less, with alterations for iPhone vs iPad) the amount for the page surpasses the 5 MB limit for a web app cache.
I have tried the cache manifest, but if the device is turned off or I clear the cache (which I do a lot while developing) the information is gone forever (and does not get resaved if I visit the bookmarked site while online again).
I am exploring the use of base64 to store the smaller icons in a CSS file, but am not sure about how to build a local storage database for the other information (backgrounds, images, text, etc) that will be persistent without being tied to the Safari cache.
Is this even possible?
(The project is intended to be an open source publishing engine, so more people can create digital 'zines for the iPad.)
you can't...
if you are limiting your application to a web application on the iphone, then your options are limited to what is provided on the device. I believe sqlitedb with mobile safari is limited to 5MB.
You can look into technology like PhoneGap which provides a wrapper around HTML5 web based applications on multiple platforms. This wrapper will give you access to the native device and then you could store additional data on the device in flat files on the native database without the 5MB limit

How can I migrate my user-generated data to the computer?

I have a query regarding BackUp of third party application data on PC.
I am developing an application which can store photos, text, recordings.
The user can add number of photos or recordings.
So at the runtime, size of application storage will go on increasing.
User will never want to loose his data but storage is limited.
Hence taking backup of data on his computer and then deleting from iPhone seems essential.
So what is the standard way of taking backup of third party application data?
Is there any way by which we can save the data on MAC as well as Windows using iTunes?
Is there any limit on amount of storage a third party application can take?
iTunes will perform a complete backup of the iPhone when it is plugged in for sync, which will contain all the application-specific data files. However, the only way to restore this is to restore the entire system image, so that is only an emergency backup, not what you need.
Third parties have typically provided their own backup and synchronisation strategies. There are two broad approaches:
in conjunction with a companion desktop version of the same application (eg. OmniFocus, Things, Four Track)
using a web service (eg. Darkslide for Flickr)
The web services are typically accessed via an AJAX API (or equivalent), but will obviously take longer for backups of large files. The desktop sync products provide their own (eg. OmniFocus uses a WebDAV server) and use an internal sync engine to keep things up to date, and can sync using the WiFi connection.
So either way, you are most likely going to have to write your own server to handle your own backups, and deal appropriately with the file types and metadata. I don't know of a third-party solution to this, but if one exists, it would be very generic, and may not suit your particular needs (eg. for file formats, etc).
So what is the standard way of taking backup of third party application data?
Write your own sync server and connect via WiFi. Start by looking at WebDAV, as you can build something on top fairly easily.
Is there any way by which we can save the data on MAC as well as Windows using iTunes?
iTunes will only do a full system backup. Your best bet is to write your sync server to be portable.
Is there any limit on amount of storage a third party application can take?
AFAIK there is no per-application storage limit on the iPhone. If you provide your own solution, you could do something like archive anything older than 30 days onto the Mac/PC, so you are only keeping recent files. Then allow them to choose "favourites" and those will be kept on the iPhone regardless of age.
You can use iTunes to back up your iPhone. During the process of transferring the iPhone data, you will be asked to back up apps. But if your apps are not from iTunes library, you may not install them when you restore them on devices.