开发者

Read locally stored gzipped XML file in Android application [duplicate]

This question already has an answer here: Closed 11 years ago.

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜