So, I am using Firebase/Cloud Storage with Flutter.
I am still trying to understand what constitutes bandwidth usage.
Setup:
I've built a simple app to pull images from Firebase. Each image is less than 100kb.
Flutter DevTool Network:
Here, it makes a multiple HTTP calls for maybe 10 images.
Firebase CloudStorage BandWidth Usage:
What I am seeing:
With just 10 images being loaded, the Bandwidth uses around 400 MB.
After refreshing the app a few times, the bandwidth already exceeded close to 2 GB.
I am not really understanding what's going on.
Does anyone know how else I can investigate why so much bandwidth is being used for simple 10 images loading?
Related
This question already has answers here:
How to store image to cachednetwrok image in flutter
(7 answers)
Closed 16 days ago.
In my Flutter app, I have pages with multiple user profile images. Sometimes 20 of the same user profile image. For every image, I fetch the download URL from Firebase Storage and use a FadeInImage. Will Firebase Storage count every image as a download or do the images get saved to the cache and automatically reused?
In other words, do I need to worry about saving the images to cache myself to reduce downloads and costs or does Firebase do that for me?
do I need to worry about saving the images to cache myself to reduce downloads or does Firebase do that for me?
If you're reading files from Storage, it doesn't mean that they will be automatically cached on your device.
To solve this you have to find a solution for caching, so you don't need to use bandwidth each time you display an image. For Flutter I recommend you check the accepted answer from the following post:
How to store image to cachednetwrok image in flutter
I cannot find any documentation that currently shows any data being cached, but flutter has plenty of libraries that can help with that, I personally use the extended image library https://pub.dev/packages/extended_image that can cache any image fetched on the network with very simple code.
Are you trying to reduce bandwidth costs for Firebase storage or for users so they don't have to download same images every time? If for users, then you'll have to cache them yourselves and write your own logic to purge the files as needed.
Alternatively, consider using Cloud CDN, where egress charges are lower compared to Firebase storage and it would also speed up download speed significantly for end users. It'll also be useful to purge cache programmatically using Cloud Functions/backend when a user updates their profile image.
Also see Firebase storage extremely slow fetching.
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.
Does any one know what is the max file size we can upload to a server from an iPhone app?
I could easily upload a file with size upto 10 MB but app start giving unpredictable results in uploading a video beyond this size.
Any help is much appreciated.
In general there would not be any limits on the file size from the iPhones side of view. However you might have limitations imposed on you from the server side, e.g max disk quota, etc.
You will have to implement the upload in chunks or streamed as the iPhone is limited in memory.
If you upload end read the file from disk in chucks, the limiting factor will be the server and you internet connection.
I don't think that there is a hard limit to the upload.
AFAIK, there's no limit. Just make sure that the server that you're sending the data to is configured to accept it.
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.
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