1. Check out our companion app, Forums for Android! Download from Google Play

Persisting Data on phone?

Discussion in 'Application Development' started by thenovices, Oct 17, 2010.

  1. thenovices

    thenovices New Member
    Thread Starter

    Oct 17, 2010
    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