I want to perform a simple action, to upload user images from the app to online server to store them and to have them available for future uses.
For that purpose, I will use Volley library.
Basically I would convert the image into Base64 format, send it to server, and store it.
My question, however, is that I have read answers to other questions here at stackoverflow about BLOB for storing data into database. Could anyone explain if BLOB is needed in this case or if am I mixing concepts here?.
INFO: My initial idea is to store the images in another folder in the server, and maybe the name and the path to the images in the database...but not the image in the database.
Making your own external Folder for saving images would be better than saving the Images in the database , because when you save the images as BLOB in the database some of the problems you face in database transfer is that, the database becomes to huge to transfer , but when you create a folder aside and you just call the names of the images in the Database , that is much more better. and Volley is also good in this.
If you need like a code sample i can post it
Thanks .
Related
I am converting image as a byte array to store in the database in android. For this, I have to convert image both at the time of storing and reading. I can definitely store all image in variables during runtime at once but it might take a lot of space if there are a lot of images in the database. Does conversion actually take a lot of resources ? in that case I will use other methods to store like in file (I haven't used file before so will have to learn it first, trying to save effort :) ).
I think it depends on how many images are you planning to save in the database. For instance: if it is the user profile image, which is gonna be one image per user, I think it is okay. But, if it is something like images that the user can upload as many images as he likes, I don't really think it is a good idea. There are advantages and disadvantages on both.
There are plenty discussions about those two approaches:
Storing images in a database versus a filesystem
Why is it considered bad to store images in a database?
Storing Images in DB - Yea or Nay?
What is the best place for storing uploaded images, SQL database or disk file system?
I'm creating a native android application which loads images of users. (An image of the user that is shown as in WhatsApp, messenger, etc). I need to update the image once a user changes it.
One approach I'm aware of is saving images on a separate server and saving the link to the image in the database. While loading, fetch the image from the specified url and cache it.
Another is saving the image as blob (don't think it's efficient) and cache it.
What are the approaches that I have to save images and retrieve them efficiently?
I'm using spring boot and couchbase as backend
If you save a link:
Often you can store the image on a cloud server that's less expensive
You have to retrieve the link, then build the code to retrieve the image
Checking for updates is at least slightly more complicated
If you use Couchbase Lite:
New images can propagate easily to the client
Storage is efficient
Blobs are stored as separate files
The associated document overhead is tiny
Simple to implement
What am I trying to achieve: Based on some filters by the app user, I want to return a list with text and images.
How am I doing it: I have created a table in Parse and have added a column with object type as 'file'. I have put all the jpg/gif images into that column. (double-click, browse, select image from local computer).
The trouble I am having is, the list takes considerable time (~7 seconds) before it is displayed on my android app.
Is there a better way of handling image data within Parse or should I store images somewhere else (like Amazon S3)?
I am using standard queries for Parse in order to get data, nevertheless, am also checking if there is any code latency. Wanted to confirm if I am correctly handling the image data for back-end or not.
Is there a better way of handling image data within Parse or should I
store images somewhere else (like Amazon S3)?
If your images is not too much or you are using for example(five image) its better to save the into the Assets or Drawable Folder for loading.
and if i correctly knows about this problem, you need to use ProgressBar and one image, before loading the Images in Internet.
Caching images and displaying
Hope this helps.
I am using Parse to store images too, but it's not slow as you said. Since Parse is part of Facebook, I think their infrastructure is the same. There are possible issues:
Internet connection: Slow or on 3G?
Images: files are big?
Let me know which case you are in.
If you just display thumbnail images, I suggest you to process it before saving to Parse by writing Cloud function as describe on their blog. The you just need to use generated thumbnails on your listview/gridview
I need some advice. I am doing a grocery list app on the android platform. I am planning to add product images and name to the listview. I am using MySQL and php(using XAMPP localhost) to display the data. So far i was successful with the text display using AndroidHive's connect tutorial.
My question is how should i store the images:
Upload the images to the database using datatype BLOPB
or
Transfer the image to the localhost(htdocs) folder then store directory path(using varchar datatype) [not sure if its possible but I have done something similar in asp.net]
I have seen some example here but not too sure which would be easier for me(beginner level). Thanks!!
Its better if you store images to localhost and use the associated localtion in db.
Because, converting image files and then storing it database would be difficult.
On the other half, it would affect your DB size a lot.
Storing data at localhost would be effective as the size of local disk is not a problem. Moreover, you will have access to image files directly.
I'm developing and an application that uses a sqlite database, and I'm having trouble to store images in database, I read a lot of examples, but not working here, can someone tell me the best way to store images in SQLite?
(and then I'll need to store movies as well..)
In the future I'll have to develop a backoffice so the company can add/change/delete items in the db.
Can you please help me?
Thanks!
I know that this does not exactly answer your question:
I'd not bother storing those huge blobs in sqlite, but rather store them on file system and only store the file names/paths in sqlite.
This will save you from the hassle of putting the stuff in the DB and manipulation of files (create, delete, list) is relatively easy through java.io.File and FileInputStream etc.
See e.g. PicHelper as a class that deals with storing / loading data in/from files.