I am working on an offline dictionary app in android studio using SQLite database.
I want to make some text bold or color changed which I use in SQLite database.
How can I make text bold or can change the color of text stored in database.
I am working on an offline dictionary app in android studio using SQLite database.
I want to make some text bold or color changed which I use in SQLite database.
How can I make text bold or can change the color of text stored in database.
You can store the heading and paragraph/description in 2 different columns, then you can create 2 different TextViews
one for the headings and set it like:
TextView heading = (TextView) findViewById(R.id.TextViewHeading);
heading.setTypeface(null, Typeface.BOLD);
heading.setText (heading);
And the description/paragraph TextView
you can set like this:
TextView paragraph = (TextView) findViewById(R.id.TextViewParagraph);
paragraph.setText(SQLiteHelper.Paragraph);
You are welcome to store text in a database, using a data format that has a representation for bold. For example, HTML is text with "tags" for formatting, such as <b>
for bold. Markdown — the "wikitext" language used for Stack Overflow questions and answers — uses double-asterisks for denoting boldface (e.g., **this would be in bold**
). You are welcome to store HTML or Markdown in a database.
You could do this in sqlite but you don't need to, if you just want to change the weight on the front end of the app, but I'd have to see the code (codepen) or a screenshot at least.