Media Section: Files Quantity

Hi there,

Does anyone have an idea how many images I can upload in the media section?

image

Each image weighs around 20 kB.

Thank you!
RM

In theory, using the ai2 server, you could have @ 1300 20kB images in your assets, given you do not have any other assets. A compiled app on the AI2 server cannot be larger than 30mb, and the build process introduces an overhead of @ 3.5mb.

In practice, too much of anything can break AI2. That said I have seen projects with 100s of small asset files which work well.

It might be better/easier to download these images to your app on first run, either all at once, or as required, keeps your initial app light...

Hi TIMAI2,

Thank you for your feedback!

mmmmm I'm not expert but... sound very interesting your comment regarding download the images in the first run... Because maybe is an easy solution to my problem.

Do you have any idea how I can do something like what you propose?

Best regards
RM

See this method by @Taifun

1 Like

How many images does your App require Romulo? You can start by optimising them:

Dimensions as small as is practical, 24 bit instead of 32 bit if there is no transparency required, webp format instead of png. webp is as good as png but much lighter. For example I have a button icon 32 bit image that is 12.00 KB in png format but only 2.00 KB in webp format.

On the main server https://ai2.appinventor.mit.edu/ ~150–300 depending on the file sizes. On the code server https://code.appinventor.mit.edu/ more than 1000.

See also here:

Hi ChrisWard,

Analyzing, my app will storage around 650 images of 20 kB each. So, with only images the app will be close to the 13 MB...

I will study the option from TIMAI2, just in case the app get struggle to work...

Thanks.
RM

As I said, this is not possible on the main server. Read my posts...

Actually the easiest way:

  1. Batch convert the png files to webp: https://www.irfanview.com/ (free)
  2. Use SteveJG's method to add them to the App Assets 'through the back door' and develop the App on the Code Server. Assets app - limit - #9 by SteveJG (previously posted by Anke)