Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to access files under assets folder of other apk's?

When we browse any apk we found there is one folder named assets. Now I want to access that folder programatically. so how should I proceed for that? (Input for the program will be apk file/just app name).

like image 727
AndroidDev Avatar asked Sep 12 '12 11:09

AndroidDev


People also ask

How do I retrieve files from assets folder?

Right click on the assets folder, select New >> file (myText. txt) and your text. “Darkness cannot drive out darkness: only light can do that. Hate cannot drive out hate: only love can do that.”

How can I see the file inside an APK?

Finding APK Files If you want to locate the APK files in your Android phones, you can find the APK for user-installed apps under /data/app/directory while the preinstalled ones are located in /system/app folder and you can access them by using ES File Explorer.

Where are APK assets stored?

I noticed that , when an android app is installed, It's apk file is copied to "data/app" directory.


1 Answers

This will list all the files in the assets folder:

AssetManager assetManager = getAssets();
String[] files = assetManager.list("");

This to open a certian file:

InputStream input = assetManager.open(assetName);
like image 82
Nermeen Avatar answered Sep 27 '22 23:09

Nermeen