android-assets

Android: read a GZIP file in the ASSETS folder

How can you read GZIP file in Android located in the "ASSETS" (or resources/raw) folder? I have tried the following code, but my stream size is always 1. GZIPInputStream fIn = new GZIPInputStream(mContext.getResources().openRawResource(R.raw.myfilegz)); int size = fIn.available(); for some reason the size is always 1. But if Idon't ...

Data not displayed first time in android after copying the file from assets to data folder

Description I have used the code tip from http://www.reigndesign.com/blog/using-your-own-sqlite-database-in-android-applications/ to copy a pre-filled data file to the target and handled this in a asynch task Problem : On starting the application it gives error and shuts down first time, starting again without any change it works perf...

Problem while opening Asset File with the help of Content Provider

Hi All, My requirement is to open one app's Asset file from another app via content provider.(I am exposing that file with ContentProvider implementation) I am able to open few files and read, but while opening some files I am getting exception. Please find the implementation for opening Asset File. @Override public AssetFileDescriptor...

binary read android assets

Trying to read a binary data file in the assets directory of android app: void loadFile(InputStream filein){ log(filein.available()); // returns 11310099 int a = filein.read(); // returns -1 (i.e. EOF) } // Function was called using: loadFile(context.getAssets().open("filename.dat")); So if available() correctly returns that th...

Smaller APK size with large assets?

I am creating a simple android app to view a comic book. The pages are large(0.5-1 mb each), high quality .png's and I am loading them into a webview to make use of the built in zoom controls. So far I only have 17 files and the APK size is already about 16 mb. I'm looking to add over 200 files in future updates. I can't really reduce th...

Problem with loading existing .html file with android WebView

Hi everyone, Firstly, happy birthday! I did try samples, demos from Google codes and other resources with WebView, but when i try to do it in my own code, it doesn't work for me. I want to load myfile.html which i put in assets folder, and using: private WebView myWebView; myWebView.loadUrl("file:///android_assets/myfile.html); On ...

Null-pointer issue displaying an image from assets folder Android 2.2 SDK

I looked at the 2 examples on Stack, but can't get them to work. I'm simply trying to grab an image from a folder in assets and set it as in ImageView, but get a null pointer returned. What am I doing wrong? Main Activity: package com.xxx.xxx; import java.io.InputStream; import android.app.AlertDialog; import android.graphics.Bi...