How to reduce application size when it is installed in sd card - sd-card

I have recently started developing a simple application which has a very few KB (less than 20KB) of resources most of which are png images. I have written on the application manifest that the application should prefer external storage.
The problem is that the application size is reduced only from 680KB to 500KB. I have seen games that reduce their application size from 10MB to 200KB when moved to sd card. Since my phone has only 70MB of internal storage available when nothing is intalled from google play it seems stupid for an application that has a single activity with some buttons and textboxes and 2 32X32 png files to take 0.5 MB of data.
What should I do while developing the application to make it move most of it on the sd card? I am not really concerned about the apk file size but on the remaining data on the internal storage, since it is fairly cheap to buy a 4GB sd card than a newer phone with larger internal memory.

Looks like there is a tool designed just for that purpose and google recommends developers to use it. Its called proguard. It does wonders to the application size.

Related

iOS: Application in production. Which Size?

I am developping my first application on iOS. I am on this language since few days and I am going to share this application in Apple Store ASAP. But I have a big question around architecture.
Currently, I have with about 40 different type of Views, others components and a lot of PNG (30x30). I know that I can reduce considerably the number of Views through the development of a small framework but as it's my first learning-by-practice application, I wanted to move on quickly about all standards components and to start this development without architecture, reusables class or design pattern ... without think too hard.
To be short, I am wondering about the real size of applications in production and the performances. Have we got some constraints with:
Apple Store (upload apps)
Ram Capacity of iPhone during using
Download application from apple store for the user
etc...
Basicly, is it acceptable to have with about 40 screens for an iPhone Application?
Best regards.
There is a limit of 50 MB for over-the-air downloads.
Number of screens is probably not going to be a problem. The amount of executable code associated with each screen is probably not going to be significant. The bigger issue is how much PNG data you are going to have embedded in the app. A single 30x30 PNG isn't very big. 40 of them probably won't very big (depending on how well they compress). But if you have dozens of them per screen, or if you have a big hi-res background image for each screen, then the total amount of data could get big.
My advice would be to just start developing everything in the most straightforward way you can. Don't worry about sizes until you have some evidence that it may be a problem. And do a lot of testing on an actual device (don't rely on the Simulator) running whatever the oldest OS version is that you are willing to support.

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

Aren't universal binaries a huge waste of memory on the device?

While working on an universal binary for iPhone / iPad, I've been asking my self often: Is this really so good? I believe the iPhone and iPod touch devices will simply download the whole package, including all the irrelevant iPad content. Since my app is graphics-heavy, the iPhone and iPod touch users would suffer from about 10 MB of irrelevant graphics. They're just trash and not used on their device. Same for iPad users, who will see something like 6 MB of garbage image data which is never used. Of course, along with all the non-used code for the device.
I wonder if this is really intelligent. If this is really the future: Downloading and installing a lot of trash and then worrying about buying an 8 GB, 16 GB, 32 GB or even 64 GB device just to be able to install more stuff. I already fear lots of the universal apps I have are just trashing my device full with unused files. It makes me feel stupid.
Any apps that aren't graphic heavy are worth making a universal binary for. eg: if you just have the standard cocoa UI elements and some data. Then all you do is set all the frames relative to the size of the frame.
If its effectively a seperate app (ie: you've got a ton of DIFFERENT picture files for the iPad version, then release it as such. Even if they are just higher-res pictures and such, it doesn't matter.)
You think that's silly? Try re-downloading an entire 80MB app (resources and all!) every time a small code change is made. :)
Given your figures of 8, 16, 32, 64 GB; I assume you're talking about storage capacity, rather than "memory" in the sense of RAM. If this is the case, you may consider compressing your resources and unzipping them to the app's sandbox for easy access on future boot-ups.
Alternatively, you could bundle only the iPhone / iPod resources with the app and download the iPad-specific resources separately. Users might not like the surprise bandwidth usage and it might not even get past Apple.
Finally, you could procedurally generate your resources and your users will love you for the saved space, if not battery life. Perhaps combine the best of both worlds and only generate the resources once?

Question about IPhone app bundle reasonable size for App Store. Storage memory!

I plan to submit my new app to App Store. App consist of a lot of image resources (animation) - more than 40M.
Is there any formal limits at App Store of the app bundle size? I never see such condition and think it will be ok. Is it right?
My major question is..
Is there any negative aspects for usability in case app is a huge?
-increase user traffic
-problem with installation
-etc...
Should I try to reduce my app size as much as I can? (actually I've done it already but size still big)
I have no statistic on this point. What is the average app size at app store and how many exclusion with big size?
Thanks, Mike/
The only limit that I'm aware of is that if your app is larger than 10 megabytes, you must download it over wifi when installing via the App Store on the phone.
There are some huge apps that I've installed, including:
Apple's Hold em: 172.8 MB
Spore: 68.5 MB
Oregon Trail: 52.6 MB
and 10 more that are over 40MB
I'd venture to guess that the upcoming Tom Tom app with the maps will be very large.
I don't think most people look at app size when downloading via iTunes or even on the phone when on Wifi. Smaller applications will install faster, but at that point they've already bought the application.
If you somehow have the ability to get your app under 10MB, then I'd say shoot for it. I don't have any actual numbers, but I would guess it certainly wouldn't hurt. However, if you can't get down to 10MB, I would spend only a reasonable amount of time getting your application size down. The decrease in download time and disk space I doubt will raise sales that much.
I don't know of any limits, but remember that anything larger than 10 MB requires a wifi connection to download. Under 10 MB can be downloaded over 3G.
At least these are the limits today, they could change soon.
iTunes Connect developer guide says there is a hard limit of 2 GB.
App Size Tips (For iOS Apps Only)
■ Apps can be as large as 2GB, but be aware of download times.
■ Make efforts to minimize file size.
■ Remember there is a 20MB limit for Over the Air downloads
https://itunesconnect.apple.com/docs/iTunesConnect_DeveloperGuide.pdf

How much space is alloted to application storage on the iPhone?

Does anyone know what subset of the iPhone's overall storage capacity is reserved for applications and application data? I am not talking about RAM, but rather disk space. I remember reading that only a portion of the iPhone's capacity was used for application data, while the remainder was used for music and media, however I cannot remember the amount. Thank you.
It depends on the model, of course - you have 8, 16 and 32 GB variations. My 16GB iPhone 3G would have around 14GB of free space, while my 32GB iPhone 3GS has around 28GB of free space. This free space is not limited to either applications, music, videos or podcasts - it is shared. As long as there is still free space available, you can install more applications or sync more media files. There is no partitioning of hard disk space by file type.
On the other hand, no single application may occupy more than 2GB of hard disk space.
iTunes assigns ~500mb of the device's flash to the OS partition and the rest is assigned to the user partition to store App Store application/data, music, videos, podcasts, email, photos etc. Upon sync iTunes will always ensure there is at least ~200mb free by removing music (usually)