Questions tagged [android-assets]

You can use the `assets` folder to store raw asset files. Files that you save here are compiled into an .apk file as-is, and the original filename is preserved. You can navigate this directory in the same way as a typical file system using URIs and read files as a stream of bytes using the the AssetManager. For example, this is a good location for textures and game data.

In Android, you can use assets folder to store raw asset files. Files that you save here are compiled into an .apk file as-is, and the original filename is preserved. You can navigate this directory in the same way as a typical file system using URIs and read files as a stream of bytes using the AssetManager. For example, this is a good location for textures and game data.

598 questions
0
votes
1 answer

Formatting columns for a preloaded database android

I am trying to reference the textfile from the assets folder which is a preloaded database. I need help fixing the text file so I can put it into assets folder to reference them within SQLite. I have followed a tutorial to reference the data in…
Eugene H
  • 3,520
  • 3
  • 22
  • 39
0
votes
2 answers

Android read line text file

I have a text file which contains all five-letter words in Turkish. From there, I want to draw a random word. AssetManager screen printing on all of the word, but somehow I did not drop a single word. How can I use a loop? I would be glad if you…
Damla Umut
  • 3
  • 1
  • 3
0
votes
1 answer

Is it possible to create a Class that defines object to be called in my Activity?

Let's just say I want to create a class that holds all my fonts taken from the assets folder, is it possible? It's not letting me access the getAssets() without importing android.app.activity. Utility Class import android.graphics.Typeface; public…
0
votes
1 answer

Can't access finding a File in the Android-Assets folder (Filesystem)

I got a simple?! Problem that I can't solve... I'm trying to access a File in the assets folder like this: File file = new File("file:///android_asset/test/sample.pdf"); But the file is not available because this System.out.println("####…
Jenson
  • 625
  • 3
  • 16
0
votes
1 answer

I can't load SWF into webView android

I read this 3 questions Problem loading swf file in android Flash is not loading in Web view in Android Load an SWF into a WebView But I could not to load my SWF into webView My code is here WebView webView = new WebView(context); …
Igor Ronner
  • 1,565
  • 2
  • 14
  • 31
0
votes
0 answers

I need to pass parameter in html to load in webView android

I need to pass parameter in the attribute "src" from tag "image" and "embed" for to load in webView, but the parameter has to be from assets. How can i to make this? int height = PKViewSize.getHeightOfDisplay(context); int width =…
Igor Ronner
  • 1,565
  • 2
  • 14
  • 31
0
votes
2 answers

OutOfMemoryError when reading more than one asset

I have a function that reads asset files and stores their contents in arrays. Here's a code. private List infinitivesDB; private List formsDB; private void getDB(String lang, String type) { while(true) { …
Highstaker
  • 1,015
  • 2
  • 12
  • 28
0
votes
1 answer

How to include a shared asset folder between android projects?

Let's say that I have 2 projects with that use the same images. All pictures are stored in folders: /pictures/set1/ /pictures/set2/ /pictures/set3/ /pictures/set4/ /pictures/set5/ Project 1…
Dimitri Dewaele
  • 10,311
  • 21
  • 80
  • 127
0
votes
1 answer

How to share assets/resources/images between android projects

Let's say that I have 2 projects with that use the same images, stored in folder: /assets/pictures/ Is there a way I can share those images, without including them in both projects?
Dimitri Dewaele
  • 10,311
  • 21
  • 80
  • 127
0
votes
1 answer

Android - Javascript functions not working in Webview if HTML is hosted

I have a webview that wants to retrieve certain String value via a javascript function. I use a JavascriptInterface to print that value. This javascript lives inside a tag in a hosted HTML. Then, when I call…
htafoya
  • 18,261
  • 11
  • 80
  • 104
0
votes
2 answers

File or Folder Doesn't exist while opening PDF from assets

try { Intent intent = new Intent(Intent.ACTION_VIEW); intent.setDataAndType(Uri.parse("file:///android_assets"+"/abc.pdf"), "application/pdf"); startActivity(intent); } catch (Exception e) { …
Praveen
  • 33
  • 4
0
votes
1 answer

Android: Can reading a file in assets fail?

I have a json file in assets. I am using org.json as parser. If I always validate the json-file before upload and test it on the phone and it works, can I be sure that it will always work then or do I need to handle the case where the parsing or…
user3591115
  • 383
  • 1
  • 3
  • 9
0
votes
1 answer

how to create an asset folder in a dot42 project?

I am trying to write my first application in dot42. i am using vs2010. How to create an asset folder in dot42 project? i need to use the asset folder to copy my own sqlite database. any idea? any help will be appreciated. thank you in advance.
0
votes
0 answers

Android - How to embed an image from assets folder in the email body

So, I have this toHtml function: public String toHtml() { Uri imageUri = Uri.fromFile(new File("android_asset/" + getFullAssetsFilepath())); String html = getString(R.string.email_image, imageUri); html +=…
Joanne Chow
  • 1,018
  • 10
  • 8
0
votes
2 answers

Unable to fetch json file from android assets

I have a class JSONParser and i am trying to parse a JSON file inside that. I have stored the json file in the assets folder. And I am trying to get it like this: public class JSONParser { Context context; public JSONParser(Context context)…
Harikrishnan
  • 7,765
  • 13
  • 62
  • 113