Search code examples
androiddatabaseweb-scrapingrealm

Copy data from website to realm database


My app needs to use data from different websites. On these websites, there is a search with different chemical ingredients.

How can I programmatically copy this data from website to my realm database?

This database on Realm needs to be saved as a table which has 2 columns: ingredient name, description.


Solution

  • First of all, create an ID for each ingredient, receiving ID, Ingredient, Description. It's the best way to avoid conflict.

    Second, you need to assemble a crawler, and this goes beyond your android application, maybe a network service that can be done even in java, identifying the information on each site and inserting into your database. So doing turn your android application get this information from the site.