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

Steps in attaching a prepopulated sqlite database for android application

I want to build an android application which requires use of predefined **database **..which can be queried.can anyone please help ??!!
0
votes
1 answer

not found as file or resource in assets folder

I have a question, why can't access a file in my assets folder? Folder My code Uri path = Uri.parse("android.resource://com.hackro.tutorials.myapplication/raw/comprobante.pdf"); String newPath = path.toString(); Resources res =…
David Hackro
  • 3,652
  • 6
  • 41
  • 61
0
votes
1 answer

Access resources from Android library

I'm using Android Studio 2.0 and I've created an Android library to keep some classes and a XML data file. The file is placed in the /res directory but I cannot find any way to access it. I always get a FileNotFoundException. The code I use to open…
yian.athanasiadis
  • 527
  • 1
  • 5
  • 6
0
votes
2 answers

Android insert data in Db from file which have multiple lines for each Insert query

I want to pre-populate my database. So I generate SQL queries from browser and write code to insert them in db. It is working fine for the single line query but most insert queries have multiple line for example ` INSERT INTO `poem` VALUES…
Nouman Ghaffar
  • 3,780
  • 1
  • 29
  • 37
0
votes
1 answer

Error in loading html page from asset folder in android studio

I am trying to load html from assets folder which contained C Programming code but I got error like Error:(7, 19) Error: The reference to entity "ltstdio.h" must end with the ';' delimiter. in android studio P_Armstrong_number.java import…
Student
  • 25
  • 2
  • 11
0
votes
1 answer

Unable to set action bar title with custom font

I am trying to set custom font but always getting error that textview is null. Here is my code: int titleId = getResources().getIdentifier("action_bar_title", "id", "android"); TextView yourTextView = (TextView) findViewById(titleId); Typeface tf =…
0
votes
1 answer

How to use Pre populated Database with the real device

I have made my database using greendao and Have been testing it on the emulator so far. It was working so perfectly. And there was no memory leak and any error whatsoever . But now I am stuck to just one single point. and that is how do I use this…
Allay Khalil
  • 674
  • 3
  • 11
  • 31
0
votes
1 answer

Android webview: find the typed word in html page and load html page

I have 20+ html pages stored in asset folder in android. These html pages belongs to my website. And all the pages are at different depth in asset folder. (I am writing after 3-4 hours of searching on Google, SO, etc. but no clue! And I am new to…
user5738881
0
votes
0 answers

Error pasting .html to assets folder

I have a problem pasting .html files into assets folder in android studio. whenever i paste it and run my code i get the red R error. Is there any way to properly import my html files?. Because in eclipse it worked for me when importing. Please…
vutch
  • 1
  • 1
0
votes
1 answer

Cordova app - Scripts and Stylesheets loaded fine. Image aren't

I am building a web app + an hybrid Cordova app. From what I read, it is best to provide relative paths to Cordova. I first had an issue with this solution but solved in using the tag, and almost everything works fine now. Scripts and…
0
votes
1 answer

Android Studio Assets file cannot be accessed in WebView

I have been trying to figure out almost 2 weeks. I have read previous posts and tried the proposed solutions but they didn't work for me. Iam using Android Studio, I need Webview to access a local Jpg stored in Android Assets file. Here is my…
0
votes
2 answers

Cannot read some files names from asset folder

I can read the file names from Asset folder but it is skipping the few file names It looks like it is only able list me the names which are in English rest of the names i.e non english are skipped . I have attached a image. In image you can see the…
Abhijit Gujar
  • 433
  • 6
  • 15
0
votes
3 answers

How do I transfer an Android asset without blocking the UI thread?

I'm trying to transfer an asset by following the android developer training which says to use this code: @Override public void onDataChanged(DataEventBuffer dataEvents) { for (DataEvent event : dataEvents) { if (event.getType() ==…
0
votes
1 answer

Playing audio/video stored in Android assets folder with vlc and fd not working

libvlc has support to accept a file descriptor as a valid piece of media. AssetManager allows you to grab an asset as a file descriptor. If I feed the assets file descriptor to libvlc, nothing plays and it stops immediately after attempting to play…
0
votes
1 answer

getAssets() from another class

Is there an error in the code? It works from my main activity and my fragment. But if I use the method (loadSound) in a sound class, getAssets() doesn't work. please help me,Any ideas? Thanks! this is my fragment code : public class…
o.m.k
  • 45
  • 1
  • 4