0

I have a pre-built database, I used SQLiteMan to populate database that contains short stories or articles, so I have a table structure like this:

Table: texts
id - integer auto increment
title - text
content - blob

The content field contains a paragraph text or strings from a text file I edited from a text editor.

How can I retrieve the contents from the database as text?

1
  • You could always store content as text... Commented Aug 6, 2012 at 5:58

2 Answers 2

2

You can get your blob data like this.

byte[] byteArray = cursor.getBlob(columnIndex);
Sign up to request clarification or add additional context in comments.

Comments

1

Given that you've asked "as text" I would clarify the previous answer with:

new String(cursor.getBlob(1), "utf-8");

of course if you've used a different character set, then you would specify that instead of utf-8.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.