iPhone/Android - securing images downloaded by app - iphone

I know there are a lot of posts about storing images on disk, both for Android and iPhone. What I would like to know is how to hide these files from user (disable access from both device itself and PC sd-card reader).
I want my app to download copyrighted images that should be only accessed using my application.
Android & iPhone,
multiple images (I'm guessing around 50-200, maybe more)
image size +/- 150-300 KB, various size but less than 1000x1000.

You can encrypt the downloaded bytes and then save it with any of your own format file extension. Then save it on your disk. While Reading Decrypt the data and use it accordingly.
This the only way i think to implement this. Hope it helps :)

SD cards are FAT formatted, i.e. all content is available to all. Your only real option is encryption. You can probably adapt the code here to encrypt and decrypt a file: http://www.androidsnippets.org/snippets/39/
Obviously you'd have your app generate a random key on first run, and store it in your preferences (which is private to your app on internal storage).

Related

Split game Into Parts

Hello I have a big game (mobile) divided into different parts is it possible to build a small version and make the user only download certain part ?like for example creating different games and he can download some
It's complicated but it's possible.
I don't write code because it would be endless work, but I give you some guidelines:
Asset bundles
Asset bundle is a way to very compress all your assets except scripts.
Basically you can think of it as zip files, which you can unzip and use whenever you want.
For example you can insert all the assets of a specific minigame, such as textures, 3D models, sprites, audio files and the rest.
When the user wants to play a minigame, you will have to unzip it.
You can also show a screen showing the upload percentage.
Firebase Storage
Asset bundles save you a lot of space, but if you need to save even more space, you can upload them to a server and the user will download the asset bundle from the server.
Obviously it will take a little longer than to recall it from memory; moreover, he will not be able to download it and then play it if he is offline.
To upload your asset bundles, I can recommend the Firebase Storage service.
You will not pay anything for a long time because you have 5gb free and in a month you can download it seems to me up to 1gb totally free.
Alternatively you can rent a normal server.
if you think my answer helped you, you can mark it as accepted. I would very much appreciate it :)

Large storage in Flutter web

Is there a way to store approximately 2GB of binary data (video files with ~600MB each) in Flutter web?
I need to support web on both desktop and mobile devices.
I tried Localstorage (converting everything to List<int>), but it caps out at a couple of MB. Drift seems to be based on Localstorage aswell. Best thing I found was Sembast, which uses IndexedDB, but even there I seem to be reaching the limits.
Maybe there's a work-around to access the file system?
Edit: I basically want to cache the videos, so they are available offline (so downloading and using FilePicker is not an option). I also considered using assets, but 2GB would be too much to download initially, even if I compress it.

Storing .png images in an ios app?

Im creating an iphone game that will use more than 1200 .png image files, and all the images combined together come up to the size 11mb, i was wondering whats the best way to store them, i was going to use the s3 storage by amazon, but I would love them to be apart of the app in the resources folder, so users can play offline aswell. So i wanted get any opinions in what is the best way to store images in terms of caching and optimizating .png files in use with IOS Apps. thanks
Just drag them into xcode. 11 MB is not much, apple has raised their download limit over 3G/Edge.
Once you have them inside your project, you just call them like
UIImage *myImage1 = [UIImage imageNamed:#"1.png"];
It doesn't get simpler.
If you don't put the files inside your project and have to download them, you download these into your Documents folder. You can put what ever you want in that directory, as it is only for your project and no other project has access to it
11MB isn't much these days, your app can be upto 50MB and still be available to download over cellular networks so the best solution is;
a) Don't worry about it. Put them in your resources folder.
If you are going to have lots more images, then the easiest solution is to simply download them when the app has a network connection. You can store them in the Documents folder and mark them as do not backup so that they aren't synchronised with iCloud. You could also store them in the Caches folder, but that makes them much more liable to vanish at any moment so you would need to have a slightly more complex mechanism to recognise they are no longer on disk and to pull them in afresh.

Having to store too many image files

So I have a huge app. It is full of features, most of which require a couple images, and all of which have to be saved as part of the binary file. I worked really hard before the release to get under the 20MB threshold, to make the app more accessible to users. My release binaryt was 18.1MB.
So now, with the new iPad and its retina display, what should I do about updating all of my images for this new display. If I did include an updated copy, I would be way over the 20MB limit. Currently, I store some image files on my sever, and download/cache them as the user needs them, but im hesitant to do this with major features because I'm concerned some users may not always have internet access. And without some of those images, the app is useless.
Is there any way I can have an iPhone only install the iPhone graphics, and visa versa?
Apple has since raised the limit for all devices to 50 MB due to the release of the new iPad. This should hopefully allow you to fit all of the pictures in your app bundle.
One approach to minimize the size of your files is by compressing your PNG files. This will only minimize the size, and the images will continue to work correctly.
The links provided below will help you find a crusher you desire.
PNG Crush
PNG Compressor
ImageOptim

Sencha Touch and Saving Local Media

Does anyone know if it is possible to save media from the internet on the local device using Sencha Touch? From what I've seen so far, I understand it's definitely possible to save XML or JSON data locally on the device, but I have had no luck finding ways to store media locally.
To be more specific, I am looking to program an app that provides the user with a series of audio seminars - like podcasts, really. The user would be able to stream those audio files directly from the internet, but I also need to provide the user with the ability to save an episode/seminar for later. This will be important for when a user is traveling and does not have a reliable internet connection or data plan.
The primary delivery device would be on iOS (iPhone, iPad, iPod Touch) and I would hope to be able to use the same technology on Android devices - but that would be a secondary phase.
If this is possible, how would I go about saving material? And what, if any, would be the limitations on doing so? Any thoughts on this would be greatly appreciated.
I have done something similar using Sencha Touch 1 and PhoneGap to produce a hybrid app.
Basically, I use Sencha Touch to download the JSON, etc and LocalStorage to hold the data. Downloading media/files/etc to the actual device is not supported in Sencha Touch as the framework doesn't have access to a file system.
I then use PhoneGap's API's to tap into the device's native file system and download files to the app's Documents directory and pass the file names/paths to Sencha Touch for use in the app.
I'm assuming you are looking to create a hybrid app based on your question but if this is strictly a web app then there isn't much you can do.
TO add to the above point, you possibly could base64 encode the file and store it within LocalStorage but this isn't a sustainable model as LocalStorage only gives you 5mb of space. If you go over 5mb, the user is prompted (yes, no) to allow LocalStorage to use more space (in 5mb increments). Since the files your reference have the potential to be 5mb each, you can see how this could quickly become unmanageable for both you and the user.
EDIT:
See http://phonegap.com/ for the native wrapper
http://blog.clearlyinnovative.com/post/2056122828/phonegap-plugin-for-downloading-url-all-the-code for the phonegap download plugin
and https://github.com/aaronksaunders/FileDownLoadApp for the code
Check this website out. Scroll down to storing data offline. They discuss Sencha Touch provides a set of data store and proxy classes that make it very easy to work with data from (and going to) a variety of sources - both server- and client-side... hope this helped, cheers.