即使应用程序被删除,也可以使用 Android 帐户管理器保留用户名

发布于 2024-08-29 08:23:12 字数 406 浏览 3 评论 0原文

一个月前,我问了这个问题。即使有赏金,也没有人想出比使用设备的 Imei 来识别用户,然后将手机与服务器同步更好的答案。

现在我偶然发现了 Android AccountManager 类。是否可以使用此类来存储在删除/重新安装应用程序后可以访问的用户名和密码?

如果是的话我该怎么做?这是否需要用户在每次应用程序运行且密钥库尚未打开时输入其密钥库凭据?

A month ago I asked this question. Even with a Bounty nobody came up with a better answer then using the Imei of the device to identify the user and then sync the phone with the server.

Now I stumbled across the Android AccountManager classes. Would it be possible to use this classes to store a username and a password that could be accessed after a delete/reeinstall cycle of my application?

If yes how would I do this? And would that require the user to enter its keystore credentials every time the application runs and the keystore isn't opened already?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

瀟灑尐姊 2024-09-05 08:23:12

我不这么认为。在我的实验中,如果包含创建帐户的验证器的包被删除,帐户也会被删除。

I don't think so. In my experiments accounts are deleted if the package containing the authenticator that creates them is deleted.

带上头具痛哭 2024-09-05 08:23:12

我对 Android 相当陌生,但我认为您的目标可以通过同时使用两个管理器来实现。

首先,您使用 AccountManager 执行凭据和网络资源的必要关联。

其次,您使用 BackupManager 将应用程序特定的 AccountManager 记录保存到云中。如果您的应用程序被删除,则应通过 Google Market 跟踪将您的应用程序恢复到设备,并通过应用程序的 BackupManager 实现恢复所有先前的 AccountManager 记录。

I am fairly new to Android, but I think your goal can be accomplished by using two Managers together.

First, you use the AccountManager to perform the necessary association of credentials and network resources.

Second, you use the BackupManager to save your application specific AccountManager records to the cloud. If your app is ever deleted, by virtue of Google Market tracking your app should be restored to the device, and through your app's implementation of BackupManager all the prior AccountManager records as well.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文