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

It is possible to check the extension of a file stored on assets folder?

I have the name of a file img2455, but i dont have the extension. It is possible to check the extension of that file? It can be stored on assets folder as .jpg, .png or .bmp, but i dont know, i must check it. ¿How can i do it? Now i am accessing…
NullPointerException
  • 36,107
  • 79
  • 222
  • 382
0
votes
1 answer

Failed to save image from app assets folder to Gallery Folder in Android?

I have written this code its saving image in specified folder name but i want to save this image in Gallery/Specified FolderName/Image.Can someone please help me ..... CODE: saveImageView.setOnClickListener(new View.OnClickListener() { …
user3233280
  • 279
  • 2
  • 7
  • 21
0
votes
1 answer

App Crashed if trying to get Bitmap Image from Assets Folder in Android ?

I have put some images in assets folder and trying to pass image name from db to the function if image is not found in assets folder then my app crashed....how can i get rid of this issue if images are not found then is there any possibility to show…
user3233280
  • 279
  • 2
  • 7
  • 21
0
votes
2 answers

How to correctly reference and image in the assets folder?

I have some images in my assets folder, and I would like to load them into a ListView by using a SimpleAdapter. I am referencing the images by their filenames, like: "my_image.jpg". Here is some code: ListView lv = (ListView)…
S L
  • 409
  • 2
  • 6
  • 15
0
votes
2 answers

How to get folder from assets?

File directory = new File(android.os.Environment.getExternalStorageDirectory()+ File.separator+"folder"); The above code can get a folder in the memory card as a File. Then I use the File class to get the files in the folder. How can I get a folder…
0
votes
1 answer

how to get a .csv file from www folder in my phonegap application?

Here I am using .CSV file in phonegap application for one application. I have 25 .CSV files. I want to get full all 25 .CSVs in my application. I tried this link for my reference but it takes from input. i dont want to get file from user input. i…
AndyBoy
  • 564
  • 6
  • 29
0
votes
1 answer

i want to show hindi text in android but unable to parse

I have added hindi .ttf file in assets and here is my code for the app public class NanTV extends TextView{ private Context c; public NanTV(Context c) { super(c); this.c = c; Typeface tfs = Typeface.createFromAsset(c.getAssets(), …
user1798477
  • 31
  • 1
  • 10
0
votes
1 answer

Why does file:///android_asset stop working?

I have an app that uses some HTML and images for an informational activity. I programmed it a few years ago and it worked fine: WebView wvManual = (WebView)findViewById(R.id.wvManual); …
Bart Friederichs
  • 33,050
  • 15
  • 95
  • 195
0
votes
0 answers

Android - Both resources and assets go missing

I'm making a game that uses both Android resource and asset folders. It works fine on my device and 90% of the other devices, but few users have had an issue where some or all of the resources and assets suddenly disappear. I have scan.png in my…
0
votes
1 answer

Android - ImageView source from protected folder assets

I want to load images from assets folder into an ImageView by XML attribute so, in the layout. Also, i want to protect these images because is very easy decompile APK and extract files. Is possible?
0
votes
2 answers

Convert file from assets folder in android to arraylist>

I have a txt file which I have to get it in arraylist> format to use it in my code. So far I have used this code and I am getting string. I have to add all the data to google maps. Any way to do this? public String…
jason
  • 3,932
  • 11
  • 52
  • 123
0
votes
0 answers

Button click or swipe to retrieve image from assets folder

I was wondering if it was possible to swipe or click a button to scroll between images stored in the assets folder? I want a previous and next button to go back and forth between the images. I have no idea how to start so some guidance would be…
Dan
  • 63
  • 1
  • 2
  • 8
0
votes
0 answers

retrieving multiple images from assets folder

I am having trouble loading images from the assets folder. What I want to do is after a user clicks a button the image will switch. I have 6 images in my assets folder and I was wondering how to load a new image after every click. Essentially I…
Dan
  • 63
  • 1
  • 2
  • 8
0
votes
3 answers

How can I copy a file from my assets folder into my SD card at first run of the app in Android?

How can I copy a file from my assets folder into my SD card at first run of the app in Android ? I need to know the exact steps please.
0
votes
1 answer

How to read file from asset folder in android with MuPDF?

I am building an app for viewing pdf file. I could build MuPDF library. I want my app to open only pdf files which I will keep in /assets folder. Source code supplied comes with code which reads file from SD card. I want to read and display files…
Avinash Sahu
  • 249
  • 3
  • 19