Here you can find the source of getPullParserFromAssert(Context context, String fileName, String encoding)
public static XmlPullParser getPullParserFromAssert(Context context, String fileName, String encoding) throws XmlPullParserException, IOException
//package com.java2s; //License from project: Apache License import java.io.IOException; import java.io.InputStream; import org.xmlpull.v1.XmlPullParser; import org.xmlpull.v1.XmlPullParserException; import org.xmlpull.v1.XmlPullParserFactory; import android.content.Context; public class Main { public static XmlPullParser getPullParserFromAssert(Context context, String fileName, String encoding) throws XmlPullParserException, IOException { return getPullParser( context.getAssets().open(fileName, Context.MODE_PRIVATE), encoding);//w ww .j a v a 2 s . c o m } public static XmlPullParser getPullParser(InputStream in, String encoding) throws XmlPullParserException { XmlPullParserFactory factory = XmlPullParserFactory.newInstance(); factory.setNamespaceAware(true); XmlPullParser pullParser = null; pullParser = factory.newPullParser(); pullParser.setInput(in, encoding); return pullParser; } }