lundi 5 octobre 2015

How to implement a good user pattern with an Android app?

I've been struggling with this for some time, but how is the best way (or more scalable/safe) to implement an User pattern with NO authentication or login/logout. A scenario where the user will need to setup some data to the app work, but there is no need of store personal user data (name, email, etc), like seeing on the alarm app?

I come from a Rails/JS backend, so I'm very used to with the MVC pattern.

I've read about Singleton classes, but their available all the time in ANY component? Like Activity, Fragments, and etc.

I need to load data from an API, parse and create an object, bundle this object to the user, and read its preferences. And then, render it on the view.

I think that create an database to store only one user, is kind of useless, tough, I will store other data.

I come up with this idea: On the main activity of my app, setup the user object, based on other data (loaded from the API, and the local database and preferences file), but this seem to be heavily and probably would have really anoying performance issues.

If someone could share a light, It would very appreciated.

Thanks!

Aucun commentaire:

Enregistrer un commentaire