简体   繁体   English

使用Android WebViewClient时保持用户登录

[英]Keep user logged in when using a Android WebViewClient

I have a question about the android WebViewClient, is it possible to make for instance a page where users can login and then save the credentials into a cookie like we could do on regular website that is not running inside an Android App? 我有一个关于android WebViewClient的问题,是否有可能创建一个页面,例如用户可以登录然后将凭据保存到cookie中,就像我们可以在没有运行Android应用程序的常规网站上所做的那样?

If we can't do this, what can we use to achieve this, it should be a really basic easy thing to create we don't need tight security or anything. 如果我们不能做到这一点,我们可以用什么来实现这一目标,那么创建它就非常简单,因为我们不需要严格的安全性或任何其他要求。 We basically only want to use an email address to let the user login to the application and let them stayed logged in. 我们基本上只希望使用电子邮件地址来允许用户登录到应用程序,并让他们保持登录状态。

Any suggestion or help would be greatly appreciated, sins Android Studio is completely new to me. 任何建议或帮助将不胜感激,因为Android Studio对我来说是全新的。

Thanks in advance. 提前致谢。

so basically, WebView is just used to display, and doesn't actually have the ability to save data. 因此,基本上,WebView仅用于显示,实际上不具有保存数据的功能。 However, you can use CookieManager & CookieSyncManager to store the data you need 但是,您可以使用CookieManager和CookieSyncManager来存储所需的数据

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM