安卓登录 - 最好的实现 [英] Android Login - Best implementation

查看:185
本文介绍了安卓登录 - 最好的实现的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我打算实现一个Android应用程序,需要一个登录界面。

I'm planning to implement an Android application that requires a login screen.

如果用户打开的活动这样的事情应该发生的:

If the user opens the activity something like this should happen:

  1. 如果用户已登录,转到3
  2. 如果没有登录打开登录界面的用户和perfom登录
  3. 显示我的应用内容

那么,什么是实现登录的正确的方法是什么?

So, what's the "correct" way of implementing a login?

  1. 实施一个 StartActivity 的perfoms检查,如果用户登录,实施 LoginActivity 实现日志和 ApplicationActivity ,实际上实现了应用程序逻辑?
  2. 实施只是一个活动,并通过使用我根据应用程序的状态显示多个视图处理登录?
  1. Implement a StartActivity that perfoms the check if the user is logged in, implement a LoginActivity that implements the logging and an ApplicationActivity that actually implements the application logics?
  2. Implement just one Activity and handle the login by using multiple views which I show according to the application state?

是否有这种情况的任何实例或教程?

Are there any examples or tutorials for this scenario?

推荐答案

我不认为有这样做的正确的方式。你描述这两种解决方案似乎没什么问题,但我会合并 StartActivity LoginActivity 成一个单一的。

I don't think that there is a "correct" way of doing this. Both solutions you describe seem fine to me, although I would merge StartActivity and LoginActivity into a single one.

这篇关于安卓登录 - 最好的实现的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆