Android Question Got an app with lots of video files. Best deployment method suggestions???

MegatenFreak

Active Member
Licensed User
Hi everyone.
I have an app that plays lots and lots of tiny small video files. Now, I know how to make it work by installing the APK in the phone and then copying the video files to the respective Android/data folder for app to find them. But I need to make it simple for other people, you know, get it to work via a simple installation, no strings attached.
I've searched around the forum but haven't found any info on this matter. (could be my poor searching skills, in which case I'm sorry)
I've thought of putting all the video files as assets so B4A compiles them all into the APK. I wonder if that'll work, and if it'll be feasible to handle a very large APK file.
I have no idea what the best approach is.
Could you point me in the right direction, please?
Thanks a lot in advance.
 

MegatenFreak

Active Member
Licensed User
Start with this solution. It should be trivial to test it. How large is the APK (in release mode)?
I put only a few of the videos together to create a small demo version of the app. The APK was about 7 MB, but even though the videos were embedded in the APK, the app didn't work. It crashed when trying to access the files. I used "DirAssets" to refer to the videos in my B4A code.
But the full app has a lot of videos, and it might go well over 300 MB, give or take. Still, it would be good if I could pack them into one APK file, except that it didn't work. I wonder what the problem is.

EDIT: I ran the app through B4A by connecting my phone. This is the error message that causes the crash:
"java.lang.RuntimeException: Cannot load video from assets folder."

Does this mean it's not possible to embed video files into the APK?
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
EDIT: I ran the app through B4A by connecting my phone. This is the error message that causes the crash:
"java.lang.RuntimeException: Cannot load video from assets folder."

Does this mean it's not possible to embed video files into the APK?
No. It means that you cannot play the file directly from File.DirAssets. You will need to copy it to File.DirInternal and then play it.
 
Upvote 0
Top