Doubt with Intents

Asked

Viewed 30 times

0

I use Intentservice to get the data from my Bank on the Internet. and I am passing the data of the intentservice class to Activity with use of Intent. My doubt is how much data I can pass via Intent.

The user will view these items in an infinite list until the last bank record. These items I am passing to an Arraylist within the Intentservice.

Should I manage the search according to the list scroll? Sort clear the Arraylist when scrolling the list? to not have a gigantic Arraylist?

  • It’s kind of hard to understand your question. I use Intentservice to collect data from my Bank on the Internet: What is "My Bank on the Internet"?

  • Databank. Webservice. My database is external in a webservice.

1 answer

0

It’s not very good for you to show all the bank records. Very hardly the user will want to see everything, the most important in the context of the app are the ones you should prioritize. Ideally you only show more information when the user asks.

And to solve this problem, you can create an endpotint in your web service that takes as parameter the number of items to be returned. If you are using REST architecture, an example would be: endereçoDoWebService/itens/10, that would return the last 10 items.

On Android, you would add a Reader to Recyclerview, or whatever other view you’re using to show items, and whenever you get to the end of the scroll, you make a request to your webservice for more items, and when they return, you add them to your list.

The Facebook app, for example, only loads more information into your feed when you arrive at the bottom of the current list or when you give a Swipe to refresh.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.