• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Need step by step instructions how to automatically add files to the APK in Android Studio

dmitryengr

Lurker
Mar 4, 2023
1
0
I am trying to do this very trivial task, but I cannot find any complete instructions on how to do it.

So far, I gathered that

  1. APK is just an archive that files can be added to using aapt add MyApp.apk file1 file2 ...
  2. Or the files must be added to the assets folder
  3. The APK must be less than 100mb to be allowed on the APP store
  4. The files must be signed
The problem is that I am finding these one-line answers in Stack Overflow questions, and not in any official instructions from Android Studio developers, and they leave a lot of necessary steps out. Which I have to guess, like where to put the files, where are they getting stored on the device. If adding files to the assets folder, I need to know Which assets folder? app/build/intermediate? Do I need to add something to Gradle scripts? Are there any other steps?

This is a very basic thing that probably every android app needs to do, and I am baffled that there is not an option or support in the IDE to import and sign the files being used by the application.

So far I had to resort to manually uploading these files (YOLO ONNX models, label text files, test images, etc) to my phone and the emulator for testing.

I am looking for some clear and concise step by step instructions to how someone can add something like a text or image file to their APK, sign it, and make it deploy to the phone or emulator automatically when building, running, or debugging the app.

Can someone please help point me to such a resource?

Thank you,
 
Last edited:

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones