How do I include a big zip file in an Android Xamarin App

Sauer, Joshua Mason 0 Reputation points
2023-03-10T10:55:48.89+00:00

Hello everyone,

I'm just wondering what the ideal way to go about this issue I'm facing in development would be.

The issue being that I am developing an app that works with a Zip File with files inside of it, that get imported into a folder structure inside said app. Now, I have succeeded in importing a zip file (~750mb) as an Android Asset, then loading in the file via OpenAppPackageFileAsync and then copying the file onto the device's appdata folder so it can be properly unzipped to retain the structure inside of the zip file.

Now whilst this approach worked with the 750mb file, this was only used for a proof of concept, as the actual file holds a lot of data which is necessary, and has amassed a size of almost 10gb.

However, trying out a larger filesize often just ended in this error whilst compiling the app for debugging with a device:

User's image

Thus I am left wondering how I would ideally implement this large of a file into the app, since an approach via AndroidAssets and the Asset Manager does not seem like the way to go.

Would appreciate any suggestions on how to go about this, thanks in advance!

Developer technologies | .NET | Xamarin
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Anonymous
    2023-03-13T07:19:17.8366667+00:00

    Hello,

    You cannot put 10GB file to your application, here are limiations.

    • Max size for all asset packs combined = 2 GB.
    • Max number of asset packs = 50.
    • Max size of install-time asset packs is 1 GB. (might be more then one, not very clear)
    • Max size of each fast-follow and on-demand asset pack = 512 MB.

    If you have a large file, you can separate these files in your server side and create several paths with webapi to download them to the appdata folder by DownloadManager in android

    Best Regards,

    Leon Lu


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.