             //to clear the table before add data             articleDB.execSQL("DELETE FROM articles"); //will clear everything and add a new data             for (int i=0;i<numberOfItems;i++ ){                 //Log.i("JSONItem",jsonArray.getString(i));                 String articleId = jsonArray.getString(i);                 url = new URL("https://hacker-news.firebaseio.com/v0/item/"+articleId+".json?print=pretty");                 urlConnection = (HttpsURLConnection) url.openConnection();                 in = urlConnection.getInputStream();                 reader = new InputStreamReader(in);                 data = reader.read();                 String articleInfo = "";                 while (data!= -0){                     char current = (char) data;                     articleInfo += current;                     data = reader.read();                 }                 //Log.i("ArticleInfo",articleInfo);                 //separate title and URL                 JSONObject jsonObject = new JSONObject(articleInfo);                 if (!jsonObject.isNull("title") && !jsonObject.isNull("url")){                     String articleTitle = jsonObject.getString("title");                     String articleURL = jsonObject.getString("url");                     //Log.i("info",articleTitle + articleURL);                     url = new URL(articleURL);                     