I am trying to make a login app for my college cyberroam in android studio. I dont want to open the webpage in webview. I want to make a login activity in which the user can save his user name and password for the future and it gets autofilled everytime the user opens the app and this login page sends the username and password to the cyberroam webpage and logs in the user. A message is then shown that you are logged in. How do I make such an app?
-
Use the shared Preference.... – Arjun saini Aug 10 '16 at 09:20
-
check this post: http://stackoverflow.com/questions/38820887/how-to-check-whether-user-login-or-not-in-android/38820928#38820928 – David Aug 10 '16 at 09:25
2 Answers
That depends on the way you want to implement.
Simple technique will be to scrape the login page and to enter the login there.
For that you need to select the form
such as: select_form('form[action="httpclient.html"]')
This may vary according to platform you use and cyberroam login page. Then just enter username and password similar to given below.
browser['username'] = key
browser['password'] = pas
Then submit the page. The response returned help to know wheather you have logged in or not.
Then you can create your app. You also can take help from the cyberroam app from playstore
- 65
- 1
- 1
- 10
For adding Login feature you can use Firebase Authentication if you want your app to connect to Internet for authentication. Or if you just want offline authentication go for Shared Preferences or SQLite database for storing and fetching user information would be better option.
- 743
- 6
- 25