The moose likes Android and the fly likes Storing image in the database Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Mobile » Android
Reply Bookmark "Storing image in the database" Watch "Storing image in the database" New topic
Author

Storing image in the database

chetan dhumane
Ranch Hand

Joined: Jan 07, 2009
Posts: 608



Not able to store image in the database ?


http://www.androcid.com/
Ankit Garg
Saloon Keeper

Joined: Aug 03, 2008
Posts: 9090

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


SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
chetan dhumane
Ranch Hand

Joined: Jan 07, 2009
Posts: 608

But I am able to store the byte array in the database.
Can I read it back and convert it to Image ?
Ankit Garg
Saloon Keeper

Joined: Aug 03, 2008
Posts: 9090

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...
 
IntelliJ Java IDE
 
subject: Storing image in the database
 
Threads others viewed
can we store an integer in a byte array
Save + store images from database
Encoding/decoding problem
Get byte[] of image
Display of images in JSP
developer file tools