CNevin561
CNevin561

Reputation: 143

Adding a custom account using Android's AccountManager

I've been trying to add a custom account to my app so I can manage the authToken to my server better, but I'm confused as to initialise eveything properly.

I've created the Authentication Activity that allows the user to log in, the Authenticator and the service, but I'm not sure how to go about handling the first time the app is opened.

The Authenticator will display the AuthActivty when it doesn't have the users account details, but in the case where the app is opened the first time, the account type doesnt exist in the phone, so I'm unable to call the getAuthToken method in the Authenticator.

Should I check if the account type exists and manually start the LoginAcivity from my MainActivty or am I missing something?

Upvotes: 0

Views: 172

Answers (1)

Aun
Aun

Reputation: 1923

You should actually have a OOBE flow for first time launch where in you can include this. That means, your launcher should not be main activity. Instead, it could be a spashscreen activity that can decide on whether to go to main activity or take first time launch flow

Upvotes: 1

Related Questions