Sorry for my bad English. I'll try to explain my problem as simple as possible;
I'm making an app-client to one website. No social network, but with blogs.
Now my app downloads 50 posts per request with the following information:
Title, Author, Type of Post, Link
They are stored to ArrayList in such way:
Title1, Author1, Type1, Link1, Title2, Author2, Type2, Link2 ... Title50, Author50, Type50, Link50
So, I have 4 * 50 = 200 elements in arraylist.
(Please, note, that this ArrayList is used while parsing webpage). In future, I want to store some additional information, such as data of post, number of likes, link to avatar and so on. As far as I know, 50 posts will demand ~600-800 elements in ArrayList.
I'm afraid that this will significally slow down performance of my Android app.
So, the question is: How would YOU recommend to store parsed data?
Thanks in advance.
I'll show some code to explain the problem better:
While parsing webpage with Jsoup I do the following thing:
post_data = new ArrayList<String>();
for (Element e : entries) {
post_data.add(e.select("title").text()); // title
post_data.add(e.select("author name").text()); // author
post_data.add(e.select("category").attr("term").toString()); // type
Elements links_int = e.select("link");
for (Element g : links_int) {
if (g.attr("rel").toString().equals("self")) {
post_data.add(g.attr("href").toString()); // post link (if there's one)
} else { continue;
}
}
Right after page is parsed, I fill my data scructure named "items" (and that data structure is used to form ListView):
for (int i = 0; i < (post_data.size()); i += 4) {
items.add(new WhatsNew_post_Item(
WhatsNew.this.post_data.get(i),
WhatsNew.this.post_data.get(i + 1),
WhatsNew.this.post_data.get(i + 2),
WhatsNew.this.post_data.get(i + 3)));
}
ArrayList<Post>where eachPostcontains the title, author, type and link... rather than 4 elements in anArrayList<String>per post.