Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Storing image in the database

 
chetan dhumane
Ranch Hand
Posts: 641
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


Not able to store image in the database ?
 
Ankit Garg
Sheriff
Posts: 9528
33
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Generally its not recommended to store files in Android database. To do that, you can include a column of type _data in your database table, android in that case will store the file in a separate location and store the reference to the file in the database. This process is mostly automatic. Look at this
 
chetan dhumane
Ranch Hand
Posts: 641
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
But I am able to store the byte array in the database.
Can I read it back and convert it to Image ?
 
Ankit Garg
Sheriff
Posts: 9528
33
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In your previous post you wrote you are not able to store the image in the database and now you are saying you are able to store it in the database?? Your code doesn't have anything related to reading the image. If you are having problems reading the file back, then show us the code which reads the file from the database...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic