Having to store too many image files - iphone

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

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 :)

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.

How to save a large (60mb+) image to photo library?

I know the various ways to save a UIImage to the photo library:
UIImageWriteToSavedPhotosAlbum
ALAssetsLibrary
However, my images are HUGE (60mb+), so bringing them into memory is not possible. I can download the images by streaming them to disk, and even use imageWithContentsOfFile to take a peek (although that is kind of unnecessary given screen size).
But I want the user to be able to save these images for later. Is there anyway for me to get these large images into the photo library? Do I just have to keep them stored locally inside the app sandbox?
I believe that there is no point at storing them at the photo library, since it is designed to be viewed on the device and theres no point at viewing an image so big. If you want to let the user see the image then i suggest you create a preview and save THAT version into the photo library. If you want to let the user transfer them from the device to the computer there is a special folder in your app bundle which will allow those pictures to appear when using itunes and selecting your application. then he can transfer those pictures to his computer. Also could you elaborate on the characteristics of the images? format, dimentions, purpose, etc.

iPhone Image Resources, ICO vs PNG, app bundle filesize

My application has a collection of around 1940 icons that are used throughout.
They're currently in ICO and new images provided to me come in ICO format too. I have noticed that they contain a 16x16 and 32x32 representation of each icon in one file.
Each file is roughly 4KB in filesize (as reported by finder, but ls reports that they vary from being ~1000 bytes to 5000 bytes)
A very small number of these icons only contain the 32x32 representation, and as a result are only around 700 bytes in size.
Currently I am bundling these icons with my application and they are inflating the size of the app a bit more than I would like.
Altogether, the images total just about 25.5MB. Xcode must do some kind of compression because the resulting app bundle is about 12.4MB. Compressing this further into a ZIP (as it would be when submitted to the App Store), results in a final file of 5.8MB.
I'm aware that the maximum limit for over the air App Store downloads has been raised to 20MB since the introduction of the iPad (I'm not sure if that extends to iPhone apps as well as iPad apps though, if not the limit would be 10MB).
My worry is that new icons are going to be added (sometimes up to 10 icons per week), and will continue to inflate the app bundle over time.
What is the best way to distribute these icons with my app?
Things I've tried and not had much success with:
Converting the icons from ICO to PNG:
I tried this in the hopes that the pngcrush utility would help out with the filesize. But it appears that it doesn't make much of a difference between a normal PNG and a crushed png (I believe it just optimises the image for display on the iPhone's GPU rather than compress it's size). Also in going from ICO to PNG actually increased the size of the icon file...
Zipping the images, and then uncompressing them on first run.
While this did reduce the overall image sizes, I found that the effort needed to unzip them, copy them to the documents folder and ensure that duplication doesn't happen on upgrades was too much hassle to be worth the benefit. Also, on original and 3G iPhones unzipping and copying around 25MB of images takes too long and creates a bad experience...
Things I've considered but not yet tried:
Instead of distributing the icons within the app bundle, host them online, and download each icon on demand (it depends on the user's data as to which icons will actually be displayed and when).
Issues with this is that bandwidth costs money, and image downloads will be bandwidth intensive. However, my app currently has a small userbase of around 5,500 users (of which I estimate around 1500 to be active based on Flurry stats), and I have a huge unused bandwidth allowance with my current hosting package.
So I'm open to thoughts on how to solve this tricky issue.
I did some research on MonoTouch for a client. MonoTouch has a minimum file size of 5.1mb because all the C# stuff. It doesn't seem to have affected apps store users willingness to download the MonoTouch based apps.
In my research I didn't see any evidence that end users pay much attention to app size when making purchasing decisions. A lot of apps are first downloaded to non-Mobiles via iTunes and the difference in download time between a 1mb and 5mb is barely noticeable. A lot of end users are only vaguely aware that apps even have a size.
My recommendation would be to try and prioritize the icons based on usage rate. Praeto's rule shows up in most data so you'll probably find that 20% of the icons get 80% of the use. Include that 20% most active icons in the app bundle and then download the rest.

Max size iPad / iPhone Offline Application Cache

Anyone knows the max size of Safari's 'Offline Application Cache' on the iPad & iPhone. Looks like it's 5MB. Is there any way to enlarge this size?
Offline application cache docs: https://developer.apple.com/library/archive/documentation/iPhone/Conceptual/SafariJSDatabaseGuide/OfflineApplicationCache/OfflineApplicationCache.html
I have the same problem on iPhone. On iPad though I figured a turn around. If your manifest contains files less than 5MB the first time and you update the cache by window.applicationCache.update() and before doing the update you increase the manifest files to be below 10mb it will work. If you continue doing that (increasing the manifest by <5MB each time and then update()) you will see that the iPad can cache more than the 5MB limit.
It is so sad that Apple by not supporting Flash and MIDP but only HTML5 for web-apps screws so much on that.
If your application uses more than 5mb than iPhone/iPad will ask the user to allow the website to use more space.
Let's read my test at here: Mobile Safari 5mb HTML5 application cache limit?
I think your apps need user's agreement for storage more than 5MB. Another problem you get is the network problem. It's too slow for 50MB transferring...