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

How can i use the Check Boxes with ListView and Insert the value in Sqlite Database in android

I have created one database with three table and place that database into the asset folder. Now I want to show the value from one column on a list view with checkboxes and then on user selection want to insert them into the another table. SO how can…
ADB
  • 567
  • 2
  • 5
  • 20
0
votes
1 answer

What's wrong with my read and write of the file in Android app's assets?

Code first: AssetManager mgr = DeviceListActivity.this.getApplicationContext().getAssets(); try { Log.e("Glenn:", address); FileOutputStream fout = mgr.openFd("device/device_address.txt").createOutputStream(); PrintWriter _fout = new…
0
votes
1 answer

How do I read and write UTF-8 encoding from java assets folder? I have the code, but its not working. I get �D�nde est� / D�nde

private void CopyAssets2() { AssetManager assetManager = getAssets(); String[] files = null; try { files = assetManager.list(""); } catch (IOException e) { Log.e("File Error", e.getMessage()); } for (String…
0
votes
1 answer

Android file not loading

I have a feeling that the path to the assets file is wrong but i am not sure of the right path to use. I had double checked the text file are actually located in the assets What makes me think its the wrong file or directory is because of the error…
alex
  • 398
  • 1
  • 6
  • 24
0
votes
1 answer

android database returning no records but sqlitebrowser contains data

I have a problem with a database file not being read I have added the database file in assets called mydb but when i run my code it says its not being located. It is calling this toast Toast.makeText(this, "No contact found",…
al23dev
  • 845
  • 2
  • 8
  • 17
0
votes
1 answer

Using an AsyncTask to copy assets to SD card throws an IOException, but creates a 0 byte file

I'm using the following snippet of code to copy an item in my assets directory across to the SD card. String DATA_PATH = Environment.getExternalStorageDirectory().toString() + "/MyApp/"; String lang = "eng"; String[] paths = new…
Jimmy
  • 16,123
  • 39
  • 133
  • 213
0
votes
2 answers

accessing a file from folder within assets

I have an application which displays html file from assets folder.Now the issue is if there is only one html, all works fine but in case I have more than 1 html, how do I refer it? Folder structure when only 1 html is present is like and I refer to…
GAMA
  • 5,958
  • 14
  • 79
  • 126
-1
votes
1 answer

Android Studio - Generating a signed bundle leaves out local json file

I have a local json file which is critical to the app. The file is around 28mbs in size. I have it stored under res>raw. However, when I generate a signed bundle from release variant, the build is only 4 mbs. If I generate a signed bundle from…
Singh Raman
  • 103
  • 1
  • 5
-1
votes
1 answer

Can't copy pre-created db from assets

android cant copy my pre create db from assets , the old db still exist in data/data/packagename/dabases, i want to change old db with new one ive tried to change this.getReadableDatabase(); into SQLiteDatabse db = this.getReadabledatabase() if…
-1
votes
2 answers

Which methods can be used to manage differing versions of pre-existing databases?

Note this is intended to be a Ask and Answer Your Own Questions as per share your knowledge, Q&A-style Often a pre-existing database is provided for an Android App that utilises SQLite. The database is often placed into the assets folder and the…
MikeT
  • 51,415
  • 16
  • 49
  • 68
-1
votes
2 answers

android copy file from sd to assets

Is is possible to copy a file from sd to assets ??? I don't think so... But you all a lot more brainier than I am ;) Thanks
Karl
  • 149
  • 1
  • 7
-1
votes
1 answer

Adding files to Assets folder. Android

I'm using Assets folder for files storing. And added file ten_ways manually to this folder. But when I display the list of files of this folder with the help of this code AssetManager manager = getApplicationContext().getAssets(); try { …
-1
votes
2 answers

Loading a file from the asset folder instead of the raw folder

i have a file in raw folder , and i want to put it inside assets folder and load it from. how can i do that ? here is my code and file name is pays_names.json. public static CountryFlagsLoader getInstance() { return ourInstance; } public void…
Cristina99
  • 21
  • 1
  • 7
-1
votes
2 answers

Getting error no such tables found SQLite from assets, what should i do? included my LOG

This is my App tab shows E/SQLiteLog: (1) no such table: quest E/AndroidRuntime: FATAL EXCEPTION: main Process: com.developmethis.csguide.csquizmodule, PID: 22684 java.lang.RuntimeException: Unable to start activity…
-1
votes
1 answer

mp3 file showing red j attached

I added an audio file to the raw folder but wasn't able to reference it. When I checked it had a red circle with a "j" inside it. When I reference the raw folder in Java it doesn't show.
K.D. MBEDOBE
  • 43
  • 1
  • 12