Saied wrote:
> Thanks again!
>
> Actually, this seems to be working on the ContentProvider now:
>
> public AssetFileDescriptor openAssetFile(Uri uri, String mode) {
> String fileName = "asset_text_orig.txt";
> URI uri1 = URI.create(fileName);
> AssetFileDescriptor parcel = this.openAssetFile(uri1, mode);
> //
> for testing purposes, I hardwired this to uri1 >
> "asset_text_orig.txt";
> return parcel;
> }
>
it will not work since you call openAssetFile recursively and you will
get stack overflow error
> Now, how do I read this from an app?
>
> String packageName = "com.example.text.cp";
> FileInputStream fstream = new FileInputStream("content://" +
> packageName); // there is only one kind of file exposed
> DataInputStream in = new DataInputStream(fstream);
> BufferedReader br = new BufferedReader(new InputStreamReader(in));
> String strLine = br.readLine();
>
> ...
>
> Or should I include openAssetFile(Uri uri, String mode) at the end of
> the uri goint to FileInputStream?
>
> Thank you very much for your help so far.
>
>
>
see http://developer.android.com/guide/topics/providers/content-providers.html
pskink
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en