I have an android appand I want to store an android Intent in the database as a blob field. I know the basics of storing and retrieving data of TEXT, INTEGER, etc, standards types in SQLite as my app already does all of that. I am not familiar with storing and retrieving blobs. I am presuming the blob is the best way, versus storing as a string and parsing back to and Intent. Maybe that is not a correct assumption though. The intents can be a package name, URI, may have extras, etc. That is why I would like to store/retrieve the whole intent and not just store parts.
You can simply store the intent in a String way:
String intentDescription = intent.toUri(0);
//Save the intent string into your database
Later you can restore the Intent:
String intentDescription = cursor.getString(intentIndex);
Intent intent = Intent.parseUri(intentDescription, 0);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With