You should NEVER store the users credentials (password) in SharedPreferences or anywhere else for that matter. This is very un-secure. At best, use Android's *AccountManager* facilities.
Back to your WebView question. The WebView of your app gets access to a cache where it can cache the necessary data such as cookies. Methods that allow access from your *Java* code to this cached data are gradually deprecated and taken out. If the HTLM login-page allows the user to save (part of) his or her credentials, it will be taken care off automatically (e.g. a small "remember my info" checkbox or something similar is shown and a cookie will store the necessary data). In other words, the solution lies in the design and implementation of the HTML login-page(s). Don't do anything special in your Java code for remembering user-name and password. The only thing you may want to get out of the HTML login is the user's access or authorization token(s). If you use a embedded *WebView*, you can use the *JavascriptInterface* facilities for that. On Wednesday, January 13, 2016 at 7:48:44 PM UTC-5, Pedro CLR wrote: > > *Basically I just have like 6/7 months of experience with Java, and 2/3 > months of experience with Android...* > > > I was asked, while in my internship, to develop a simple Android app that > allow access to an existing (and working) responsive web page. > > > The idea is simple: > > > - the page works with a login in order to access certain content; > - the objective is that the user only needs to login just once; > - the login credentials are to be saved locally in order for the user > to be automatically logged in next time the Android app is accessed. > > I understand concepts of session in web development, as well as working > with PHP and JavaScript. > > > Now in Android I only know how to do this separatelly from a webpage > (login activity, saving credentials to SharedPreferences, etc), but this is > not what my employers want... > > > I'm a little bit lost, because CookieManager was deprecated, as well as a > series of other WebView methods... > > > *The app only needs to start the MainActivity with a WebView as only child > view of the main layout (e.g., a FrameLayout), and then everything else > must be managed in the webpage...* > > > How can I do this? :( > -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscr...@googlegroups.com. To post to this group, send email to android-developers@googlegroups.com. Visit this group at https://groups.google.com/group/android-developers. To view this discussion on the web visit https://groups.google.com/d/msgid/android-developers/0abbf57a-f90a-4271-bfd8-a72a195251f2%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.