thenovices
Lurker
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!
thenovices
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!
thenovices