1

I'm starting to study android programming, and i want to know, how to do a login activity like facebook, skype, whatsapp and others.

Let me explain: When you open the app for the first time, you will see the login or register screen, so if you has already registered, you can log in the app. Once you enter, will be created an account on settings witth the app name, saving your account coneccted to the app. And if you open the app again you will automatically be redirected to your user screen.

How should I do that? Could you give me material to study? I was trying to google it without success.

thank you guys!

Mriaco
  • 91
  • 1
  • 2
  • 11

2 Answers2

0

You have to save the login/password or Aoth cookie into the local storage of the phone dedicated to your applicaton.

See official documentation for more infos See little tuto

clement
  • 4,204
  • 10
  • 65
  • 133
  • if you open settings on your phone, you will see "accounts", then are saved informations about all accounts conected to the device. If i follow this tuto, i will do something like this? – Mriaco Dec 03 '14 at 15:51
  • no, this will be saved into the application's data, inside the application's sandbox. If user want to remove the credentials, he will remove the application's data. This isn't what you wanted? The Account savec into the Account is different, this is documented in thiz post but this is "louder" in term of coding than my first idea but maybe more clear for the user... http://stackoverflow.com/questions/9776074/adding-account-through-account-manager – clement Dec 03 '14 at 15:56
  • the link you sent, that is what i want. I want to put the account logged in my app in the account settings. – Mriaco Dec 03 '14 at 16:02
  • perfect, in this case, this link will be good for you: http://udinic.wordpress.com/2013/04/24/write-your-own-android-authenticator/ – clement Dec 03 '14 at 16:05
0

If I understood your needs correctly for basic studies you could just start by using a local .txt file where you save parameters like Name, Password, LastLogin etc. By starting the app you just read the file.

For productive use a GCM Server would be needed where you could send requests for login data. See HERE

How to read a text file see: HERE

Hope I could help

Community
  • 1
  • 1
BinaryIT
  • 115
  • 1
  • 10