I'm developing an app that will download large files (mostly videos). What I need to know is this:
Is there a max singe file size imposed by either Android or iOS? All I've seen is the 4GB limit of a FAT filesystem. The max video size should come no where near that, but we want to be 100% sure that there isn't a lower limit
Is there a max amount of space allocated to a single app on either system? Google turned up nothing on this question, so I am going to assume there isn't a limit beyond available file space (which seems logical, but also far to free for an Apple-built system)
Is there a max number of individual files or directories for either system? Again, Google turned up nothing. I don't see why there would be here, but I want to cover all the bases here.
Thanks!
All answers here are for Android:
Is there a max singe file size imposed by either Android or iOS? All I've seen is the 4GB limit of a FAT filesystem.
I would not exceed 4GB.
Is there a max amount of space allocated to a single app on either system?
No, there is no per-app quota system at this time. That being said, try not to make users regret using your app. :-)
Is there a max number of individual files or directories for either system?
Yes, but since the counts should be in the millions, your app will grind to a halt long before you hit those limits.
Can't answer for iOS, but for Android, your APK can't exceed 50MB (if it does, you can include expansion files for your additional data).
Here is the link to the docs explaining all the details:
http://developer.android.com/guide/google/play/expansion-files.html
Related
I have developed HelloWorld Android Application which just prints Hello World using eclipse and from tutorial https://developer.android.com/training/basics/firstapp/index.html?hl=it,but to my surprise the app takes 2.21 MB of memory. Can you please suggest way to reduce this size to few kb's as this should not take much space, as I haven't added any images or code in it.
An APK is a zip file, you can open it and figure out what's taking the space. If that doesn't hint you enough come back and add this info.
Also, take a look a look at proguard
Edit: Oh wait, I might have misunderstood you, did you mean storage space or runtime memory ? (RAM)
Are you sure you are talking about runtime memory? Even a simple "Hello world" application with no icon from the default Android project has a 10MB heap with 9MB allocated on my phone. Its installed size is listed as 1MB.
I do not know how to reduce memory usage in such a simple app but I can give you some tips to reduce installed size; however, there is a limit to how small you can go.
If you have an icon for all screen resolutions from mdpi to xxhdpi, it will cost you 44KB. I have found the practical lower limit for a usable app to be a little above that; I have a reasonably small app that is only 95KB. However, this is expanded during installation; expect your app to take up to twice the APK's size once installed.
A good way to get rid of space for a small app is to remove the support library. It is included by default in new projects, and takes from 400-600KB. However, removing it comes at a cost - many user interface improvements such as fragments are only supported on older platforms using the support library, so you will either have to restrict the tools you are able to use or your target user base.
Only way i found to reduce runtime memory is to use various optimization techniques. Here is the tutorial Android Dveloper. This tutorial will help you in increasing performance of your application as well as reducing the runtime memory consumption of your application.
According to the Android reference page, FileBackupHelper should "be used only with small configuration files, not large binary files."
I managed to successfully backup a database file of 8 kilobytes, but I'm curious at what point a file becomes a "large" binary file. Do you think Android is referring to files in the megabyte range?
I believe there is no hardcoded limit in Android source code (which defines "large" vs "small"). At least, I didn't find within 10 minutes looking through Android source.
Generally speaking, you should take into consideration a speed of wireless connection. It depends a lot on where you and your users are located. If it's major cities with 3G/4G coverage - I think you can backup a megabyte, if's rural area and your users are charged per kilobyte, I would rather scale back to dozens of kilobytes.
The title says most of it. I believe packaging the basic data set into the app will result in a better user experience, rather than have people download files before they can start using the app. This is where one can start losing users. At the same time, 20MB is considered kind of a lot for Android,so I wonder if this will cause issues for some users in using the app.
I am not sure if this will cause an issue. I am an android developer who uses android phone and facebook app in my fone is almost 21MB. It does not cause any issue...However, as a developer a better approach would be to do an app that does not exceed 10MB space(Unless your app is outstanding like Facebook). You can do this by using images of smaller size,making sure you do not have any resources that you are not using(classes,layouts etc)
The size never causes issue but you may consider more:
I am a android developer and a long time Android user too. Not All Android phones have high-end processors to run app faster.
A lot of Android Phones have phone memory of 100-250MB. And the old versions of Android doesn't allow user to install app on SD card. So the user may hesitate to install your App.
Unless it is necessary try to reduce the App size.
As per my personal experience, If you are designing something astonishing and it costs even few hundred MBs on my phone, so i really wouldn't mind to give a try. Since new phones, processors and high storage capacities are continuously evolving and appearing in consumers' hands, so how can we expect applications to remain the same (tiny) in size? Let them grow (but not without any valid reason), and people would still try/buy it. There are no fixed rules or guidelines for limiting the app size, but a directly proportional relationship explains it well:
High-end graphics and feature-rich application ∝ Extra size/memory
What I think is :
The size of the app never creates issue. Again if its an extraordinary app. then surely user will surely get attracted and download your app..
But on the other side just think about the Internal Memory of the phone. There are lots of phone available that has very low internal memory(many have 150 or 180MB as internal memory). May be because of too low internal memory, they wont be able to use your application and hence you may not get big traffic.
You've got a lot of answers here so I'm just going to give you my perspective.
I would be frustrated to say the least if I downloaded a 10MB app and then opened it to find I needed to download another 10MB of necessary materials. Just make the app 20MB so I know what I'm getting into when I start the download.
Only put the bear essentials into the app if it's going to be that big. Don't require users to download high res images, language packs, etc. Just publish the bare minimum that your app requires to run if it's going to be larger than 10MB. You could even publish two versions of your app, the bare minimum at 7MB or the HOLY SH*T package at 20MB, at least users would have a choice when they went to download your app.
Spend some time looking up common practices when it comes to saving space when making an app, every little bit counts and if you can make the same app and save 5MB, your users will appreciate it. If it comes down to a lot of images, consider using this tool; http://www.getpaint.net. However I would suggest reducing the JPEG quality) rather than compress them. JPEGs aren't very squishy.
Going along with #3. Think about universally accepted methods of communication; a sideways triangle for a play button, and X for a delete button, be sneaky...save space. User's love that crap :]
I'm currently building an Android project that I believe will use quite a lot of RAM, much more than the default max heap size set by devices.
The app will be the only one that runs on our Android machines (they're single-purpose), so I'm not worried about slowing down other processes. I want all the resources possible to go to this one program.
I know that I can use
android:largeHeap="true"
to give myself more room. However, in another post, a commenter suggested that this setting does not override the machine-specific max heap size. Is this true? And if so, is there another way to exceed this limit?
As an aside, I saw some posts that show how to do this natively. Unfortunately, I'm a mere Java programmer and so I have to work within the constraints of Dalvik.
This option is only for Honeycomp tablets ATM.For API levels below Honeycomp the only thing you can do is increase the heap size of all applications (Rooted phone) I haven't actually used is but check this video from Google IO at 06:00. It said that expands the heap size. So probably he is correct and not the commenter you mentioned :D
My app needs to save files that will range from about 2-20mb. When I tried to do this I was getting an OutOfMemoryException. I did some reading and it's looking like Android has a file size limit of 1mb. Is this correct? If so, is there a way around this limitation, other than splitting up every file into 1mb chunks?
The main application need to be small, like < 1 MB but you can save as many files as you want and as large as you want as long as you save them on the memory card. The available space that can be used for applications (and other secure data) is limited, usually under 128 MB. So basically you need to keep your application small and put the large part as an add-on or extra files that can be put on the memory card. If you application will use 20MB from the available space it will drastically reduce the number of people that will use it.
OutOfMemoryError means you exceeded the VM's RAM budget, which is 16MB or 24MB depending on what device you're on. It has nothing to do with file sizes.
The 1MB limit you're probably referring to is the maximum size of a compressed asset in an APK file.
Files in your app-private data area or on external storage can be as large as the filesystem will allow them to be. (I've heard the FAT32 implementation Android uses for SD cards has a 2GB limit for individual files, but don't remember the resolution of that thread.) Available disk space will likely be a larger concern.
Going back to your original problem, check the logcat output (via adb logcat or DDMS) to see if there are any messages from the garbage collector right before the OOM fired.