1

In Android, I have an application that handles multiple rich format text fields. I get the description of the text from an xml and create it as an spannable string builder, adding each run and styling it.

Is there a way to store this on sqlite that doesn't imply storing the whole XML describing the paragraph?

I know it can be done in iOS but I haven't found a way for Android.

Thanks in advance for any answers or tips.

Arcantos
  • 1,052
  • 1
  • 13
  • 28

1 Answers1

2

Is there a way to store this on sqlite that doesn't imply storing the whole XML describing the paragraph?

I do not know what "the whole XML describing the paragraph" is. You can:

  • Use Html.toHtml() to generate HTML from a Spannable, or

  • Roll your own code to convert a Spannable into something that can be stored as a string or byte array

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491