Results 1 to 4 of 4
  1. #1
    akn_39 is offline Member
    Join Date
    May 2014
    Location
    Parksville, BC, Canada
    Posts
    5
    Rep Power
    0

    Default Best way to store images

    Hello Everyone: I am new to Java programming and I am working on a fairly basic Android app. The app essentially stores information (mainly text) in database format, but I also have the need to save picture/image files (typically jpg or png, 1-4mb per file). The way I have implemented this is to store the file path in the database and retrieve the actual image when required. Is this a good approach? I have seen references to ImageIO and saving image files as a blob in the database, I have not tried these methods.

    Is there a "best practice" way to handle this and are there considerations for the different techniques?

    Thanks. . .

    Tony N.

  2. #2
    Norm's Avatar
    Norm is online now Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    17,899
    Rep Power
    25

    Default Re: Best way to store images

    Moved to Android section
    If you don't understand my response, don't ignore it, ask a question.

  3. #3
    kneitzel is offline Senior Member
    Join Date
    Feb 2014
    Posts
    447
    Rep Power
    1

    Default Re: Best way to store images

    On an android device I would use the same approach.

    Storing the images inside the database or not is always a hard question.
    The advantages are in my eyes:
    - the database makes sure that the data is not corupted e.g. by accidential deletion.
    - one data source (so you just backup the database and you will have everything)
    - transactions on one system only (and maybe you have a filesystem that does not have transactions...)
    - central management of rights...

    But keeping images as files grants an easier access which can be more performant.

    Konrad

  4. #4
    akn_39 is offline Member
    Join Date
    May 2014
    Location
    Parksville, BC, Canada
    Posts
    5
    Rep Power
    0

    Default Re: Best way to store images

    Hi Konrad: Thank you for your comments and insight.

Similar Threads

  1. cant store images
    By wildheart25c in forum CLDC and MIDP
    Replies: 1
    Last Post: 01-11-2011, 10:38 AM
  2. how to store images in access database
    By sridarshan in forum JDBC
    Replies: 11
    Last Post: 06-26-2010, 03:26 AM
  3. How do I store images in a zip file in Java
    By mglover in forum Advanced Java
    Replies: 1
    Last Post: 06-11-2010, 04:53 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •