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

Copy from file from assets folder to my package location for both (sdcard, or internal memory)

I want to copy a pdf file from assets folder of my project to the folder where my project is installed, whether my project is installed on sdcard or internal memory. i saw a solutions says to copy it from assets folder by AssetManager to…
MBH
  • 16,271
  • 19
  • 99
  • 149
0
votes
1 answer

Allow access to local assets in android

I want to have my webview refer to a site, say example.com. In the assets directory for the app, I will include all the static assets such as javascript, styles and the images. However, when I use the following code on my website:
0
votes
1 answer

NullPointerException with custom font from assets

I'm trying to use custom font in my application, but i got that exception when when run the app: Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.TextView.setTypeface(android.graphics.Typeface)' on a…
Mohamed
  • 656
  • 9
  • 28
0
votes
1 answer

Android studio can't compile app with assets folder

I want to use custom font in my application and i did everything in the right way, but when i build the project and run it it's force stop because it can't found assets folder! That's the code from MainActivity: tv = (TextView)…
Mohamed
  • 656
  • 9
  • 28
0
votes
1 answer

Different Image widths in Html for Android Tablet and Phone

I have an android app which runs on tablet and phone. My content is loading html files from the assets folder. My problem is I want different image sizes on tablet and phone. here is the code for the image on phone.
Brendan Henry
  • 99
  • 1
  • 9
0
votes
0 answers

File copied wrongly when creating DB (Android assets and SQLite)

I'm copying a file with the structure of my SQLite database from the assets into my application folder when onCreate(SQLiteDatabase database) is called in the SQLiteOpenHelper class, but the original file and the copied one are not exactly…
moictab
  • 959
  • 6
  • 27
0
votes
1 answer

Android : read a file from a specific character to another specific character

I'm trying to read a txt file I have in assets. The structure of the file is like this: 1 [some text] 1 2 [some text] 2 3 [some text] 3 .... What I'm trying to do is to read the [some text] part corresponding to a specific number, i.e. if i pass the…
Nabil Amen
  • 69
  • 1
  • 7
0
votes
2 answers

Use assets folder in Android for support multiscreen devices

For support multiscreen devices android, typically using a drawable-xhdpi, drawable-hdpi, drawable-mdpi, drawable-ldpi for resources images. For using it with assets folder how to implement it? Do I need to create separate folder like assets-hdpi,…
0
votes
1 answer

How to store preferences without app being launched

I have a version 1 of an app installed on the device. An app can be updated automatically to version 2. I would like to save a constant string (defined at build time) in version 1 and read it in version 2. It might happen that app updates itself to…
lstipakov
  • 3,138
  • 5
  • 31
  • 46
0
votes
1 answer

Add local image in ImageView

I read from XML. 1 Fast assets://icon/photography1 Now I have gotten Class Movie. How can I add assets://icon/photography1 in my ImageView?
CoolEgos
  • 47
  • 1
  • 10
0
votes
1 answer

Libgdx : .Flip() inside a for loop

Am i implementing this correctly? I'm having issues with the direction my character is in, yet the state manager is working correctly. I'm unsure whether this is the problem. I have my player facing right automatically when constructed yet he faces…
BradleyIW
  • 1,338
  • 2
  • 20
  • 37
0
votes
1 answer

WebView: Loading a local website with directories, css's, htmls, etc stored in a folder inside assets

It is possible in Android to load a complex website stored in a folder inside assets android folder... with html, javascript, folders with css files, images etc...? Can't find any info about this in google. Which is the best approach to achieve…
NullPointerException
  • 36,107
  • 79
  • 222
  • 382
0
votes
2 answers

How to install the apk file stored in assets folder of another apk ..?

I am shipping a .apk file to the assets folder of another apk. Now, I want to install the apk stored in assets folder . Install apk from assets folder automatically / programmatically.... is this possible .......?
Ganesh
  • 923
  • 1
  • 7
  • 12
0
votes
1 answer

Can't successfully load image from Assets folder in Android

In my code I have no errors, no warnings at all but when I load a layout trying to display a thumbnail photo, located in Assets folder I can't see my image("25.png")displayed in my layout. My Java file is : import android.app.Activity; import…
user4003509
0
votes
1 answer

how to get asset path file using android default music player as an intent?

I have a really big problem in getting address from asset folder when I'm using the default music player as an intent! This is my code: Uri path = Uri.parse("file:///android_asset/file.mp3"); String newPath = path.toString(); Intent intent = new…
Amin
  • 16
  • 3