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
0 answers

Load SVG's xml code from assets folder

I have a lot of SVG images, currently transformed into XML code, stored into the drawable/ directory. I am using the following code to retrieve them all and randomly display one of them: Field[] ID_Fields = R.drawable.class.getFields(); int[]…
Michael
  • 876
  • 9
  • 29
0
votes
3 answers

Can not resolve getAssets() method from inside a java file: Android

I have created a file inside assests folder and now I want to read the file from a java class and pass it to another function in the same class but for some reason i am unable to use getAssest() method. Please help! public void…
Dia
  • 65
  • 2
  • 9
0
votes
2 answers

Libgdx AssetsManager as static variable

I am trying to implement the AssetsManager to my app. It should only load all the font files and a background music. All this works perfectly. My problem is that sometimes on android the AssetsManger files are away/wrong/buggy when I leave the App…
Tim Jansen
  • 109
  • 1
  • 6
0
votes
4 answers

Adding Drawables from assets into ListView

I have added many images in the assets folder and want to get those images from there and add it into a ListView. When i am executing the app everything is perfect but the image container of the listview appears blank(transparent). Output The Java…
Basil Victor
  • 111
  • 2
  • 13
0
votes
2 answers

No such table: table1 error when copying database from assets

I'm having a database stored in assets/databases named myDatabase.db and I want to copy it to the internal storage using the code in here: public class DatabaseOpener extends SQLiteOpenHelper { private static String DB_PATH; private static String…
Andrei Zamfir
  • 143
  • 1
  • 3
  • 11
0
votes
1 answer

JNI get asset filepath

I am trying to add two .xml files with initialisation data to the APK of my Android App. In the JNI C++ Code I want to get the path to the files so I can open and read the files. I realy need the path, because the files are opened with an OpenCV…
0
votes
2 answers

Null-pointer issue displaying an image from assets folder Android 2.2 SDK

I looked at the 2 examples on Stack, but can't get them to work. I'm simply trying to grab an image from a folder in assets and set it as in ImageView, but get a null pointer returned. What am I doing wrong? Main Activity: package…
user375566
0
votes
1 answer

Android assets folder does not contain what I put in there

I have added a bunch of wave files into my assets directory for loading. I created assets by right clicking on my res folder in android and going "Add folder -> Assets folder" It created an assets folder at app\src\main\assets. I have dragged a…
Scorb
  • 1,654
  • 13
  • 70
  • 144
0
votes
1 answer

get list of files under asset directory

I have a list of mp3 files under my asset folder, I want to list the files and there paths that exist under this directory. I have tried getAssets() but all what I get is filenames. is there any other way? thanks in advance
0
votes
2 answers

Android gradle plugin 2.2.0 causes FileNotFoundException while reading from assets

After upgrading to Android gradle plugin 2.2.0 (and Android Studio 2.2) I've been having trouble reading from a zip file which is located at app/src/main/assets/magic_info.zip It used to work fine with plugin versions 2.1.3 and prior but now it…
ThanosFisherman
  • 5,626
  • 12
  • 38
  • 63
0
votes
0 answers

Fast copy subfolder from assets in Android?

I have seen many example in SO how to move files from assets. All of them copy files one by one, not as part of a sub folder, i.e. here. Is it possible to move a sub folder to a target location? If I have more thousand small files then it seems…
János
  • 32,867
  • 38
  • 193
  • 353
0
votes
1 answer

How to build a ResourceManager in libGDX with AssetManager

I want use non static AssetManager In my android game? I have many levels. How should I use AssetManager? I should create for every level a separate AssetManager? Because if I create one AssetManager, it will load all textures, etc, in first…
infoman
  • 37
  • 1
  • 4
0
votes
1 answer

how can I set gravity to center in webview to play gif?

I want to play gif in alertdialog. I write this code: AlertDialog.Builder builder = new AlertDialog.Builder(myThis); builder.setCancelable(false); WebView view = new WebView(myThis); …
CompEng
  • 7,161
  • 16
  • 68
  • 122
0
votes
1 answer

I can't access drawable folder android

I'm working on an application that deals with getting an image from the drawable folder. In one of my last application what I did was I created a different ic_abc folders for each icon in my application and in there, there would be same image with…
Sagar
  • 416
  • 7
  • 23
0
votes
2 answers

Error loading json ui-skin file from android/assets

I have default.json file for setting skin to ui component. The file location previously was in project package core/src/com/mygame, which has the following data: { com.badlogic.gdx.graphics.g2d.BitmapFont: { default-font: { file:…
Kapparino
  • 988
  • 11
  • 33