In my project call to the webservice generates URL of images which is different each time and it is timed which wont work like any other URL. When i click on that URL images gets downloaded in my drives. But i want to save it in my db.
I Have seen this Link and tried with it. But for my auto generated URL type that code wont work. Anyone has idea about how to get to know how to save the webservice auto generated URL in my sqlite?
As i analyzed the problem what i think is you will have two ways doing it
1) Storing the downloaded image inside sqlite and displaying it.
https://stackoverflow.com/questions/11304703/download-an-image-and-store-in-sqlite-in-android-local-db/11305051#11305051
2)or else just do how they have done in this blog
http://www.getablogger.blogspot.in/2008/01/android-download-image-from-server-and.html
may be you might get better way.
ALL THE BEST
Related
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 .
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 am developing Android app now where I need to store image Url in DB for each object and then load this image from the web (if connection is on) OR get it form cache (if not).
Picasso seems to be best lib for handling images in Android, so I starter using it. But I can not get how do I use it properly for my case. Even more - Images strangely are loaded into views right after they are first time get from API but if user starts app again, we can see placeholder only (even with internet connection on). Can someone suggest a solution or at least any kind of idea of best way to do this?
My code in Adapter (is is also same in ShowActivity):
String img_url = item.getImage(); // img_url is valid image url
Picasso.with(mContext).load(img_url).placeholder(R.drawable.plchldr).fit().centerCrop().into(holder.image);
I tried to use Picasso at the start as well, and found out that their caching system is horrible.
It would cache some images i downloaded, but not others, and would therefore leave alot of images with placeholders.
I suggest you try Universal-Image-Loader (https://github.com/nostra13/Android-Universal-Image-Loader). I'm currently using this to cache all images in my app, and it works flawlessly (Around 200 images atm).
Finally got the problem - API is returning valid image url BUT actually it (image) is hosted on S3 cloud and it is expiring till the user loads application again. So, actually saving expiring image URL is useless in this situation. I am not sure what will I do here (it seems that the only way here is hard one - storing images on SD as Bitmap). But I just wanted to tell this for those who will get similar issue.
My DataBase contains 1000's of images on server , I have to display these images in ListView in Android.
I have to develop similar List like that in the Flipcart app(If User Scroll then download Images) and store a local copy in SQlite and display from that SQlite database.
(In future if connectivity would not be there then also I would be able to run my app)
because Images will be available in SQlite.
Please suggest proper Solution for that.
Use of loaderManager or something else please suggest
I don't advise towards storing the images themselves in the SQLite database. The database will become slower to use and more cumbersome. Also, I think you should not implement such complex functionality yourself as there are many ready to use open source solutions.
There are a lot of solutions that allow you to cache the images on the file storage. They work transparently - when you request url they first check the local cache and only if this check does not exist they will make network call. Most of them also will display default thumbnail until the network call succeeds. Basically I think this is the best you can do.
I, myself have used Universal Image loader for what I describe, but out of this thread you can find many alternatives.
I am able to parse html content using HTMLCleaner & able to populate in list view. But extracting image I ma facing problem. while I am able to get images from any web server, i am not able to get same from my local Apache http server.
I want to know the reason & possible solution.
Thanks in advance.
It seems like the phone (emulator?) doesn't have access to your local server.
Use the browser in the phone/emulator and try to access your server just to make sure if it's this problem.
If you have access, print the url and make sure everything is alright.