1. HUGE Androidforums.com UPDATE! Learn what's new (and download the new app!)
    Dismiss Notice

Persisting Data on phone?

Last Updated:

  1. thenovices

    thenovices New Member This Topic's Starter

    Oct 17, 2010
    Likes Received:
    Hi everyone!

    I am creating an app that, stated simply, is like an interface to an API that allows CRUD operations on a database. I would like to encapsulate all the API calls in one class, but I've come up with one problem. The API endpoint only gives you 1hr sessions, so you have to re-login after the hour is up. I would like the phone to save the login information so that the user isn't prompted every single time. I understand that you can use Preferences to persist the data, but so far I haven't figured out a way to obtain Preferences without the API wrapper subclassing Context, which doesn't seem like good design.

    Could someone help me with a solution to this problem? Thanks so much in advance!



Share This Page