Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Development: On a macro-level, how do I design a program that will store and display login information

This is a question about Application design rather than how-to-do specific actions.

I am a student taking a beginner's course in Android Development. I am designing a program which initially requires the person to login, then at a later time they may choose to display a record of all the users that have logged in previous sessions.

As of right now, there are two parts of my app: LoginField Activity which takes the login data from the EditText field, and which is then supposed to write that information to an external .dat file of some kind so that the information will persist across launches, and a LoginHistory Activity which is supposed to display this history in a ListView.

I have toyed with creating a separate class for the ArrayAdapter logic - an ArrayAdapterController class (?) - but was uncertain how to pass information back and forth between it and the two Activities.

so - my questions are these:

  1. since the information needs to persist across sessions what is the best method to do this? it does not have to be secure for the moment as this is only a student project.
  2. does it make sense to make a separate Controller class to handle the information that will be passed between Views/Activities?

apologies for the general nature of this question - as you can see I am an MVC novice.

like image 865
Bennett Von Bennett Avatar asked Dec 20 '25 06:12

Bennett Von Bennett


1 Answers

You've asked a general question, so the best I can do is give you a general answer. You want to use the AbstractAccountAuthenticator class. The documentation there should give you a good jumping off point for you. Furthermore, the SampleSyncAdapter provides a comprehensive (but complex) example of using the authenticator with a full on REST Web Service.

like image 114
Kurtis Nusbaum Avatar answered Dec 22 '25 20:12

Kurtis Nusbaum



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!