Android where to store images - android

I'm developing a new app where I have a doubt about images and folders storage.
I have a DB where I want storae the path of the images and not the images (I don't want to use BLOB because I don't want a large DB). Ok, the question: which is a better place where I can put to the images Raw? Drawable? Assets? and also what type (png or jpg or bmp)?
Thank you so much for any suggestion.

Related

Android - Storing and loading a folder of images stored on the web

I have a folder on my computer with many images. I want to have my app be able to load all of these images into a View. I have no problem loading one image from its url (using Picasso) but I want to know how to load a folder of them (i.e the amount of images may change).
I was thinking that I could use a Google Drive public folder to store the images, but how could I get the images from within the folder (i.e if I had the folder's URL could I use Java to "open and look inside" it)? Is there a better (and free) way than Google Drive to store the images? Maybe an imgur album or some kind of free server hosting service?
You can use Firebase or Alternative use is Imgur . You store images there and the links of images tou can store in a db (sql Lite) and just add connection of db in main.activity Here you can learn how
You should consider using Firebase for this. Upload your Images in the Firebase Storage and store the link in the database. Once done, you can show all the Images in your app and also dynamically add the images.

How to display images in the mysql database like photo gallery in android?

Actually I am developing an android application to to store images after capturing the images from camera intent and need to display those saved images from the database?I stored the images in Blob format...
It's not recomended to save images into the database. The Blob format is good for storing amorphous data, but you need to do some serious tricks to convert it back into a Image format.
However, might we suggest instead to save the image on the local storage and store in the database only the identifier for the image?

Efficient loading drawable images in android application

I'm currently working on an application in college. I have created several games incorporating lots of images. My lecturer however is not happy with the app loading the images from the drawable folder, he wants something more efficient on memory.
Just wondering if anyone knows any solution? i looked at lazyloader and asychronous loading but most examples use images from the web. I need an efficient way to load lots of high quality images from drawable folder to UI.
Here is your options:
Load images from drawable as is now
Reduce images size and use lower quality JPEG for mobile
Create download class and download images from server to SD card and use it from there
If you using images in your app, you can read them from drawable, SD card or online. The image have to be somewhere to load it.

Images in listview with smooth scrolling

Currently I am not having server to upload the images and the images will be twice time if i copy images assets to sdcard, so I put all images in assets folder.The size of images are large, it takes time to decode and scale images.
I want to use lazy loading to show theses images.But I can use lazy loading code only when images are coming from sdcard or web server.
Please suggest me how can i show images from assets folder with smooth scrolling.
Thanks in advance.
But I can use lazy loading code only when images are coming from
sdcard or web server
You can use lazy loading with any source. Are you using an existing implementation, or did you create your own? If you have the code, you can easily extend it so that it allows loading images from assets.

Best solution for downloading and caching images

i've got a question about best solution for caching downloaded images. From internet are downloaded URLs of images i want to show with specifig tag. On some other activities will be showed previews of images and after click on preview will be shown image in full size and his description. My idea is save info about image to database with path to directory named after tag in cache directory. When preview should be shown, i look to cache and if there image is, good and if not image will be downloaded
Maybe use a naming convention so you won't need to use the database ?
Like this :
Profil picture for user 1 will be in
tmp/mypackage/pic_cache/user_pic_1.jpg

Categories

Resources