Persistent Cache: cleaned-up version as implemented by @mvglasow

This is a cleaned-up version of the pull request by @mvglasow with most formatting-only changes removed. The main activities in the Samples app use persistent tile caching.