Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
370 views
in Technique[技术] by (71.8m points)

android - 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).

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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);

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...