i have 4 cloumns in sqlite db (id,name,text,fav) my android app is ebook. i want add image to textview For example, I have 5 paragraphs in one lesson that I stored all those paragraphs in one cell of a row in db. Now I want to add an image after line 3 of first paragraph and 1 image after second paragraph. How can add images into the locations? In other lessons might be vary the locations. please help me!how can add image between text!
1 Answers
If you want to add the actual image in the database you need to add it as a blob, see this post how to store Image as blob in Sqlite & how to retrieve it?
If you just want to add an image location then create a new column and use it to store the image location or resource id.
If you want to add a location for where in the layout to put the image as well as the image location then create two columns; one for storing the image location (or resource id) and one describing the position of the image in the layout.
Remember that if you change the database structure (for example adding columns) you need to uninstall the app from the emulator/device or clear the cache in order to make it work. Otherwise you will get an error because the actual database structure wont change after it has been set once even if you change the structure in your code.

- 1
- 1

- 36
- 4
-
please see attach http://uupload.ir/files/fvc_untitleggd.png In other lessons might be vary the locations. – gigiran Jan 22 '17 at 16:25