Possible Duplicate:
Read local compressed XML files(gzip) in Android applicat开发者_运维问答ion
Hi I am working on an android project and need to open XML files which are compressed in gzip format and stored in locally.
I don't know how to get an InputStream(Read gzipped local xml file) from the locally stored gzip xml file.
The files are stored in the raw folder which is in the res folder
Then need to parse and get the information to store in the SQLite DB.
(Example gzipped Xml file -> student.gz)
I am Using java in the implementation.
Can someone help me please. Thank you very much...
InputStream in = getResources().openRawResource(R.raw.yourgzipedfilehere)
Then read this: http://developer.android.com/reference/java/util/zip/GZIPInputStream.html
精彩评论