Friday 16 October 2015

Jsoup web scraper help



I have created an app and have also created a web scraper for the app to gather info that will be displayed on the android application. Unfortunately I am unable to use the web scraper with the app since I have learnt there are restrictions on using a Jsoup with android apps. I have been told I must use a sub class called AsyncTask in order to use my web scraper. Would this mean that My whole web scraper that is in its own class needs to be under this sub class as the MainActivity class would end up being huge. Also the AsyncTask class requires a doInBackground method and a onPostExecute that requires arguments. Do I have to use this sub class and these methods? as I don't really see how to adapt my code to fit this class as I have methods in the web scraper such as getLinks(), getEvents........ Is there a way I can just make an object of the web scraper in the MainActivity class and call on its methods rather than putting all of my code in AsyncTask?



No comments:

Post a Comment