Java 如何在android中维护会话以及如何设置会话超时?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/22936660/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
how to maintain a session in android and how to set a session timeout?
提问by Subramanyam M
I have created a small Pizza House Application
. I would like to have a Session
and store the email address of the user and also set session timed outto it.
我创建了一个小Pizza House Application
. 我想要一个Session
并存储用户的电子邮件地址,并设置会话超时。
Could someone help me with it with a small example?
有人可以用一个小例子帮助我吗?
Thanks in advance.
提前致谢。
回答by Krunal Indrodiya
you can manage this by using of shared preferences, also you can do this by creating database table,
您可以使用共享首选项来管理它,也可以通过创建数据库表来做到这一点,