access files from assets/www directory
You should be able to access the file this way:
window.resolveLocalFileSystemURI("file:///android_asset/www/foo.html", onResolveSuccess, onFail);
You can then use the File API - FileEntry.copyTo or FileEntry.moveTo to actually do the action. Note - you cannot actually write into the assset/www folder, only to an SD card.
Hope this helps
How to access a file from asset/raw directory
Place your text file in the /assets directory under the Android project and use AssetManager class as follows to access it.
AssetManager am = context.getAssets();
InputStream is = am.open("default_book.txt");
Or you can also put the file in the /res/raw directory, from where the file can be accessed by an id as follows
InputStream is =
context.getResources().openRawResource(R.raw.default_book);
How to access files from assets folder in angular 2?
You have to put your files and use the relative path from the assets folder.
For example if i put a css file in src/assets/css/myfile.css
, then I have to access it like this :
<link rel="stylesheet" href="assets/css/myfile.css">
IONIC: How can i access a file in assets folder?
Where is your TypeScript file located?
I assume it is in the /app folder.
Therefore (even if I don't think that you can directly play the video) to get to your file you should do:
var fileName = "../assets/Atiye.mp4";
Trying to access sub folders in assets folder
SOLVED
it was really simple..
to access the sub folders in assets folder you would need the following..
1st access the file by its file name..
File file = new File(getFilesDir(), fname);
2nd while attempting to open the file use both file name and the url to the file
in = assetManager.open(url+fname);
3rd in the intent use only the file name..(i was using the entire path)
intent.setDataAndType(
Uri.parse("file://" + getFilesDir() + "/"+fname),
"application/pdf");
Related Topics
Two Textviews Side by Side, Only One to Ellipsize
How to Get References for All Currently Active Fragments in an Activity
Identifying Rtl Language in Android
How to Change the Background Color Around a Dialogfragment
Get My Phone Number in Android
Android - Add Textview to Layout When Button Is Pressed
Equivalent of Clean & Build in Android Studio
Com.Google.Android.Gsf Package Couldn't Be Found
Android Set Button Background Programmatically
Httpentity Is Deprecated on Android Now, What's the Alternative
How to Get Free and Total Size of Each Storagevolume
How to Do Page Flip/Turn/Curl Effect in Android
Load Large Images with Picasso and Custom Transform Object
How to Pop Fragment Off Backstack
Android Listview Setselection() Does Not Seem to Work
Android Studio: Unable to Start the Daemon Process