My content provider stores data in SQLite database. One column is a string. I would like to attach this string as a file attachment to an email message.
I got this working by implementing ParcelFileDescriptor openFile(Uri uri, String mode)
. The implementation
- Queries the column value from the database
- Stores the returned value in a file
- Returns the result of
ParcelFileDescriptor.open(file,ParcelFileDescriptor.MODE_READ_ONLY)
Is it possible to avoid these steps and duplication by implementing ParcelFileDescriptor
that would represent the column value of a record directly?
(I could store the string value in the file to avoid duplication, but I would like to keep using FTS3 facility provided by SQLite)
Thank you for your help!