I've programmed in other languages and such, but I'm still a bit of an iPhone noob. My hope for my app is to store around 2,100 items or so, each having information and an image, and allow the user to select from a list of these and add them to to a TableView.
Is storing this large amount of data realistic? If so, how?
Thanks!
You should be fine, if your images are not too big. If the average size of one image is about 100K, you'll need something in the order or 210MB, which would be fine. Not ideal, but fine.
However, if the average size is 1MB, you're looking at roughly 2GB storage. The low end iPhones have 8GB of storage. Users take considerable amount of that space for music, pictures and apps. 2GB for single app is way too much, and it's unlikely you'll be able to get that space.
Storing 2100 items in SQLite is possible and will work properly. The only thing to keep in mind is to always filter before showing and never display more than 100 or 200.
Related
I am creating an app where the user will select some photos for the avatars used in the app. Once selected, on the next launch I want to populate the avatars automatically.
Solution I am Thinking: I will keep a duplicate of the original photo in the app directory and next time I will use the photo to make the avatars.
Issue: Not efficient as the same copy of the image exists.
Question: Since many apps are doing this thing, I want to know the best way to do that, more specifically in Flutter?
Use the cached_network_image plugin.
This plugin allows you to download an image from the internet and cache it in the app for later. You can provide a placeholder image that sits there while no image has been loaded yet(from the web or the internal cache) and also what to show in case of error. If the device goes offline cached_network_image automatically will load the image from the cache, it's transparent to your app, you don't have to bother with the cache, storage space, database, anything.
Take a look at the docs.
There are no best practices in this regard. It depends on your app.
1) Storing your avatars
Takes more storage space. But your app runs faster.
Best when the number of avatars displayed on a single screen is high, but the total number of avatars in your app is small. (E.g.: you show 15 avatars on a single screen, and there are 100 avatars in your database).
2) Generating your avatars
Takes less space. But your app runs slower.
Best when the number of avatars displayed on a single screen is low, but the total number of avatars in your app is large. (E.g.: you only show 3 avatars on a single screen, but there are 100.000 avatars in your database).
Conclusion
Speed is usually more important than storage space, therefor I'd lean towards storing the avatars. But the only true way to get an answer is to test it and see what works best for your specific app.
I think you must copy the original photo, Most people use cloud service(google photos etc.) for their photos and not keep photos on phones any more..
use cached images widget to store images for some time or use SQLite database for long time in device .
I am making an app that uses a lot of fairly big image files. I notice it crashes when they all get loaded on my iPhone 3G (128 mb ram), but not when I test it on a 3rd gen iPod (256 mb ram). So I assume there must be some percentage that is allowed for each app to use? My app has about 30 images at about 440k each loaded so 13.2mb. I didn't think that would be too much. They need to be swapped in and out pretty quickly, so releasing the ones not in use from memory doesn't seem like a good idea...
EDIT:
The app swaps images based on the way the phone is being tilted. It's 30 images from a 3D scene, so when you move it, it changes the perspective. It needs to be as smooth as possible.
The answer is: as much as you want, until the OS complains.
There is no such thing as an absolute memory limit, since it wholly depends on the phone's memory, how much the OS and its related services are taking up, and the time of the month (just kidding, but you get the idea).
You should be scaling down these large image files to fit into memory, or even more so, not loading them all at once considering the screen is so small and only so much can be viewed at any one particular time.
My app compiles to about 80mb. I was under the impression this was quite large. However it does have video content, high resolution images and we're charging ₤3.99 for it on the App store.
What would be "large" for an app? For instance, would you say 80mb was large? What would you say the limit is (realistically).
Thank you very much
Tom
I really don't think this can be answered objectively. You should do whatever you can to keep it as small as possible so you're not wasting storage space on the device. Just realize the app bundle's size isn't a reflection of the exectuable's size. If the executable is huge, that's a (memory) problem you should try to address. If most of it is resources, compress as well as you can without sacrificing too much (or any?) quality, and that's the best you can do.
In other words: there is no such thing as a "normal" size for an app.
Some of these high-resolution magazine apps are a few hundred megabytes (I know they're iPad, but the storage is the same size in each case). I think <100MB is not unreasonable.
That is pretty large. IMO anything over 20MB is large, seeing how it requires a WiFi connection to download. Since your well over that, I wouldn't worry about bringing it down.
Whenever possible, keep your app under 20MB. However, there are plenty of apps that are bigger than yours.
i am developing a application which contains many images which appear on different buttons click and has an mp3 file too..When i checked the size of my .app file it is around 6.8 mb which i think might be too large?? is there any way i can reduce the size of my .app file though i think reducing the size of my images(already around 15kb) wont be the solution.
6.8mb is fine and is small enough that people can downloaded it over 3G (the limit is 20Mb; you need wifi if it's more)
One thing to keep in mind is sales! On any app you do now or in the future you will want to keep the total size under 20mb.
Think about how many users want to "instinctively buy" your app. They saw a friend with your app and want to download it right then and there, but ohh wait... cant do it till ya get home! LOST SALE - More than likely that person will forget by the time they get home.
In your case 6.8mb is nothing compared to many apps that are games. I've seen 200 - 300mb apps that take a while to download on wifi. (WSOP Poker , Gamebox)
Good Luck my friend!
I have an app which is quite huge. It has tons of images and sounds. In total it's 30 MB in size.
1) Is there an official limit for the app size?
2) Are there other "practical" limits I should consider?
Reading around, there are reports that the absolute maximum size for an application is 2GB (http://discussions.apple.com/thread.jspa?threadID=1605342).
Other than that, if your app is over 10MB, users will only be able to download it over a wifi connection, having the impact that users won't be able to download your application easily when they are out and about.
This might sound obvious, but there are two size limits to keep in mind here - neither are absolutely defined.
One is the limit for the application bundle. I don't know if there is a real limit (other than the device's flash storage limit), but this should rarely be an issue. Keep in mind the 10Mb threshold that the other Phil mentions though. There may be something in the 2GB limit too, I don't know.
The more important limit is on the size of the loaded binary image and it's runtime memory usage. The iPhone is obviously a constrained device in this area. The original iPhones and iPod touches had 128Mb of total RAM, with no paging. Current models have 256Mb, but it's a bit early to limit yourself to that subset of the installed base if you can help it.
Assuming 128Mb, of that a fair chunk is used by the system itself and its background tasks (and people want user background tasks too!?!).
In a conversation with an Apple Engineer he said that apps should be written to use no more than about 25-30Mb! Up to 60Mb may be available but cannot be counted on (but you could use this extra for caching stuff that you can purge as necessary).
1) I believe that you shouldn't ask for maximum size, as you have to aim for minimum possible size for your apps. As iPhone has limited memory (both storage & RAM), you should not create a huge app. (I doubt an app > 200MB can pass through Apple's app check.)
Yeah, Phil is right, when you app is over 10MB, it can only be downloaded via wifi or iTunes. Quite a lot users may want to download anywhere they like using 3G networks, so >10MB is not recommended.
Also, take care those users with iPhone 2G. If you produce a >10MB app, it takes them a day to download your app (if they are lucky enough to have no disconnection at the middle of download...)
2) practical limit ... K.I.S.S = Keep It Simple and Small.
That's it. Hope it helps.