meyers8686 / plist

Automatically exported from code.google.com/p/plist
0 stars 0 forks source link

I cannot use your library on android #43

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
my file is in the asserts folder, i cannot get the path, and i can get the 
inputStream, but it must path?

Original issue reported on code.google.com by tqj.zyy@gmail.com on 4 Sep 2013 at 5:45

GoogleCodeExporter commented 9 years ago
I answered that already in a comment on the Examples page.

You have to put the file into res/raw/. Let's say it is called 
YourPlistFile.plist

Then either use

InputStream is = getResources().openRawResource(R.raw.YourPlistFile);

or

InputStream is = context.getAssets().open("YourPlistFile.plist");

and then

NSDictionary rootDict = (NSDictionary)PropertyListParser.parse(is);

(See 
http://stackoverflow.com/questions/2856407/android-how-to-get-access-to-raw-reso
urces-that-i-put-in-res-folder)

Original comment by daniel.dreibrodt on 4 Sep 2013 at 7:17