A
A
Andres Iniesta2019-03-02 19:15:55
Java
Andres Iniesta, 2019-03-02 19:15:55

JSOUP: How to copy images from website to database?

Goodnight!
I do site parsing, take pictures from there and put them in listView. Everything is fine, but I would not want to download pictures from the site again every time I start the app, but show the user from the phone's local database.
Tell me how to organize it all? Just point me to the right path, and then I'll smoke myself. New pictures are sometimes added to the site, and then the new ones added should be added to the existing database, synchronized, so to speak.
I use JSOUP, AssyncTask for now.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
L
lavren1974, 2019-03-02
@lavren1974

Understanding the page... Looking for paths to the pictures... It all comes together... You write a script in which you specify the paths to the pictures, which downloads them where you specify... This task was successfully solved by me several years ago .. unfortunately originals are missing...

O
Orkhan, 2019-03-02
Hasanly @azerphoenix

Good afternoon.
About storing pictures. You can store paths to images in the database, and store the files themselves in a folder. Another option when saving is to encode the image into a blob immediately in the database. The first method is preferable if there will be a lot of files.
As for parsing, there is nothing new here... Parse data while parsing, cycle through the list of links with pictures, create files and write to the desired directory or immediately to blob.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question