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
-1
votes
1 answer

Android read pdf file from asset folder

I try to read a pdf file store in the assets folder. I see this solution : Read a pdf file from assets folder But like comments say this it's not working anymore, the file cannot be found, is there another solution for read a pdf file directly,…
Vodet
  • 1,491
  • 1
  • 18
  • 36
-1
votes
3 answers

Reading images from asset and fill in the array

I have a gallery I have some pictures in my gallery that there are in the drawable. like this first I put the into in Integer Array like this. Integer stickers_big[] = { R.drawable.stck1, R.drawable.stck2,...} and this my adapter : class…
nsr
  • 115
  • 13
-1
votes
2 answers

Get a file from assets, read it and copy the contents in another file

i am having a file in the assets folder. I want to open the file, read the byte[] through the InputStream and then use the FileOutputStream to write the byte[] into another file. My code: assetManager = MainActivity.this.getAssets(); …
user7157256
-1
votes
1 answer

How to open pdf with any pdf app from assets using ContentProvider

Firstly, I know this question asked many time and you can be sure that I read and tried all of them but i couldn't succeed sadly. I need to ask again to make clear for all newbie at android developing. BTW, i am learning from udacity. I am trying to…
-1
votes
1 answer

Pdf File In asset folder not open in thirdparty app

Hi I am new in android i have some PDF file that exist in this path asset/pdf/example.pdf when i try PDF file with this code Intent intent = new Intent(Intent.ACTION_VIEW); File file = new File("file:///android_asset/pdf/example.pdf"); …
Mohamad Amin
  • 93
  • 1
  • 7
-1
votes
1 answer

Access AssetManager from a Non-Activity Class

i am trying to learning Xamarin and while i'm at it, i'm also learning SQLite. Though i am currently struggling on how i can export the SampleDb.db i have in my Assets Folder to somewhere (like Personal Folder inside) of Android File System. My…
TheQuestioner
  • 702
  • 10
  • 28
-1
votes
1 answer

Gradle copy task neither copies the file nor gives any error

I have added the following task and its execution schedule to build.gradle: task copyDbFile (type: Copy) copyDbFile { description = 'Copies the relevant db file to assets folder' from 'store' into 'assets' include…
Viral Patel
  • 32,418
  • 18
  • 82
  • 110
-1
votes
2 answers

Android: Creating sqlite database from db file

I have created a sqlite database and copied the .db file to assets folder of the application as stated in question 2605555. The code compile fine. During runtime, it says unable to read the file. I would like to use readymade .db file and want to…
Suresh PB
  • 169
  • 1
  • 2
  • 16
-1
votes
1 answer

Cant retrieve the data from assets folder Android

Hi im creating an app that retrieves sqlite database in the assets folder. When i run the program, it says no such table: students while compiling SELECT * FROM students. The assets folder has students.sqlite and has a table name students that…
APCM
  • 1,704
  • 1
  • 11
  • 24
-1
votes
1 answer

Android Downloaded HTML content should not coping using file managers / through the USB connection

I'm developing a android application which is downloading contents from a API as a zip file and extract it in to the assets folder in the app.Then using the web view in the app can load that content. How can i prevent user from directly access the…
-1
votes
1 answer

What is the correct delivery format for the elements of an Android UI?

You have an idea for an Android app and ask a graphic designer to draw up one of the screens in Photoshop. He does that and it looks amazing! But how do you get from that to defining what you need in terms of assets for your user interface…
-1
votes
1 answer

Getting java.io.FileNotFoundException

I have four file in a subfolder in assets folder. I have written this code @Override public View getView(final int position, View convertView, ViewGroup parent) { if (convertView == null){ convertView =…
aquib
  • 194
  • 2
  • 13
-1
votes
2 answers

Accessing the external already created database.But the Code isnt working

This is the Main Activity that i have written and it is not working ! Please Help import android.view.View.OnClickListener; import android.widget.Button; import android.widget.Toast; public class MainActivity extends Activity { Button…
-1
votes
1 answer

I can't set text (read from my asset folder) to my list

In my application I want to read my text from asset. Now I have text in my asset folder and I think my problem is that I can't set my text to my list.Before this, I read my text from an array but when I change it, I have exceptions.How I can read my…
mahsa
  • 51
  • 5
-1
votes
2 answers

How do I get a direct path to the assets folder

I want a direct path to the assets folder so I can open a PDF that is stored there. So I can pass it as a parameter in this Intent: Intent i = new Intent(this, SecondMainActivity.class); i.putExtra(PdfViewerActivity.EXTRA_PDFFILENAME,…
Bouss
  • 205
  • 2
  • 9
  • 20
1 2 3
39
40