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

Embedding database file in Shared project or Android asset doesn't work

Shared Project approach Trying to embed database in Shared project. Given in my Shared Project I put database.sqlite3 under Resources folder and ensure build action is Embedded resource: However, it's not listed with GetManifestResourceNames. Note…
Janis Veinbergs
  • 6,907
  • 5
  • 48
  • 78
0
votes
2 answers

cannot display PDF file from assets folder as MODE_WORLD_READABLE no longer supported

The following code is working absolutely fine in devices with API 22 but in devices with API 24 it gives the following error: java.lang.SecurityException: MODE_WORLD_READABLE no longer supported Here is my code: private void CopyReadAssets(String…
pamo
  • 111
  • 2
  • 13
0
votes
1 answer

Exception while using SQLiteAssetHelper class

I am trying to use SQLiteAssetHelper to copy my pre-populated db into android app. I have Android-7 on my device(Nvidia Shield & Motorola Phone). From Settings->App->MyApp I have enabled Calender, Location & Storage permissions I have following…
0
votes
0 answers

Android's AssetManager from the Target Context uses assets stored under androidTest directory

I'm seeing behavior I am not expecting during development of android library (AAR), was wondering if someone can explain it. my library structure is : src/ androidTest/ assets/ my_assets/ java/ com/ …
Eldar
  • 149
  • 2
  • 12
0
votes
2 answers

android.content.res.Resources$NotFoundException with no info in developer console

I've a few rare crash logs like following in my developer console and have no idea what to do with it. About my project I can say following: crash log is not pointing to my code anywhere I'm not using assets in this project So I'm stuck at what I…
prom85
  • 16,896
  • 17
  • 122
  • 242
0
votes
1 answer

Build static library with asset_manager using NDK r10e

I am building a static library that uses AAssetManager (#include ) in C++ and then I will use the library from java. The thing is I can't include libandroid because I can't use LOCAL_LDLIBS += -landroid when building…
0
votes
1 answer

How can I read multiple data from assets?

Hi I am trying to use tess-two API to make OCR app I need to use two languages of trained data I load my data from assets, but I don't how to load multiple data from it this is my code: private void checkFile(File dir) { if (!dir.exists()&&…
Tim Chang
  • 27
  • 1
  • 4
0
votes
1 answer

Failed to open database - Android

I am testing my app on honor with API 17 (4.2.2) but get me bellow crash : E/asdf: checkDataBase-->android.database.sqlite.SQLiteCantOpenDatabaseException: unknown error (code 14): Could not open database E/AndroidRuntime: FATAL EXCEPTION:…
user4813855
0
votes
1 answer

Poor image quality after downloading from android asset

I'm trying to get an image to fit nicely on each screen size, the image i'm using an image which is 1351 × 2048 and i have used android asset to achieve this. It has worked fine except from the image quality is a lot more poor on all resolution.…
LiamB645
  • 35
  • 6
0
votes
1 answer

Cannot resolve getBaseContext() method

I want to read from a JSON-file. I did what is suggested here, but it couldn't resolve the getBaseContext()-method. I read that I should use Context instead of this, but there remains an error saying "non static method getAssets() cannot be…
Medusa
  • 593
  • 2
  • 5
  • 18
0
votes
1 answer

Error:Execution failed for task ':app:mergeDebugAssets'

I'm trying to make an app in Android Studio that opens a PDF file saved in the assets folder of the app when I tap a button. It opens the PDF through a 3rd-party app via intents. I'm getting this error when I try to run it: Error:Execution failed…
0
votes
1 answer

Developing an Android project with large assets; installing to device always takes a long time

I'm working on developing an Android application in Android Studio. I have large files in the assets folder, so the 'install' step of the code -> build -> install -> run cycle takes a long time, and I mean several minutes (5 to 10). What's the best…
hasen
  • 161,647
  • 65
  • 194
  • 231
0
votes
2 answers

set textView font and typeface from xml instead of using java

In xml code i can use fontfamily like below :
user6490462
0
votes
1 answer

Creating a Drawable from xml file in Assets folder

I have a sub-folder inside the assets folder which contains some xml layouts (just simple shapes.) My goal is to be able to create a Drawable object to use as the background of a view. Currently it's just simple shapes, but there will eventually…
Nigel DH
  • 207
  • 3
  • 11
0
votes
0 answers

Error in the cursor when performing a query in sqlite from the assets folder when the application is removed and reinstalled

I have a problem when I query the sqlite database from the assets folder only when I uninstall the application and reinstall it. If it is the first time it is installed the application runs normally without any problem. In the list of errors shows…