Background:
I'm implementing an app that reads info about movies from a web service. That web service return several info about each movie (title,date,poster url, director, actors, etc).
That web service supports pagination, so the movies are loaded in packs of 100.
Implementation:
The idea is to show a grid with all the posters. Auto requesting more items when the user scrolls down.
When an item is clicked the user navigates to a gallery with the detail view of the selected movie, allowing the scroll through the details with a ViewPager.
So the idea is to pass the collection of movies retrieved in the grid to the "DetailedGalleryActivity".
UPDATE: Also is necessary to save the state when the user leaves the fragment in order to handle the fragment lifecycle. You can test it enabling the Developer option: Don't keep activities
The problem
My first approach was to serialize the collection of movies in a json, and pass it as a String extra to the Activity.
But since the list of movies is big, if the user scrolls a lot in the grid, the size of the json is extremely big for a Bundle (see Max size of string data), getting runtime exceptions.
I have checked some answers that talks about persist the data in the SharedPreferences or other persistent storage before launching the detail activity and then access to it from the detail. I find this solution weird because it ignores the mechanisms to pass data between activities with a custom and handmade solution.
What is the best approach to solve this problem?