Get assets directory from an android function name or variable instead of hard-coded
NickName:Codebeat Ask DateTime:2015-05-18T09:27:46

Get assets directory from an android function name or variable instead of hard-coded

Read many questions about the location of assets. Not any of these solutions uses a function to get the assets foldername/dirname/pathname, only hard-coded like: "file:///android_asset/".

For example to get a path you can do something like this:

String sFilesPath = mContext.getFilesDir().getPath();

Is there a function or variable in Android to get the full path to the assets folder?

Copyright Notice:Content Author:「Codebeat」,Reproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/30293896/get-assets-directory-from-an-android-function-name-or-variable-instead-of-hard-c

More about “Get assets directory from an android function name or variable instead of hard-coded” related questions

Get assets directory from an android function name or variable instead of hard-coded

Read many questions about the location of assets. Not any of these solutions uses a function to get the assets foldername/dirname/pathname, only hard-coded like: "file:///android_asset/". For exam...

Show Detail

Get folders name from Assets directory

I'm trying to get the names of my folders in "assets". I can get the names of the files with an AssetManager by using the method assetManager.list(). But the problem is that it return only files' n...

Show Detail

Get variable (not hard-coded) name?

I am looking for a way to retrieve the variable name, so I don't have to use hard-coded declarations when needed (for property names etc.): I hardly believe it's possible; maybe someone has a solu...

Show Detail

Unable to get files in Android assets directory

I am trying to find files located in assets. I have .txt, .gif, and .db files that are there in an eclipse android project but do not display when I run the following code: AssetManager am = getA...

Show Detail

Packaging Flash Builder Apps for Android/IOS - assets directory Q

First timer here. I've been writing an app that's intended to be deployed onto mobile platforms (iOS and Android ). This uses Flash Builder 4.6's android build target - it uses a subdirectory in t...

Show Detail

Android assets no such file or directory

In my android project I have created an assets folder in which I have added some json files and I want to read them with a stringBuffer. The assets folder is listed inside src/main. So far I have a...

Show Detail

Writing to android assets directory at runtime?

I get html snippets updates from a network request and need to insert them into a local html file that can then be fetched with webView.loadUrl at runtime. I can easily load the file from /

Show Detail

Android assets folder not supported by Eclipse

I'm trying to load some custom XML data into an Android application, so I put it in the assets folder so I can read it. However Eclipse won't let me build my project; it says "invalid resource dire...

Show Detail

How To Get File In Assets From Android NDK

I'm trying to access an image file in the assets folder from the native side. Now I can successfully search through the assets folder and its subdirectories locating the particular file that I am l...

Show Detail

How To Get File In Assets From Android NDK

I'm trying to access an image file in the assets folder from the native side. Now I can successfully search through the assets folder and its subdirectories locating the particular file that I am l...

Show Detail