创建自定义帐户的android [英] create custom account android

查看:192
本文介绍了创建自定义帐户的android的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请告诉我创建Android上自定义帐户最简单的方法?到目前为止,我已经阅读文档:创建自定义帐户类型但它肯定没有有很大的帮助(太模糊信息)。我试图读取LastFm的例子,但肯定他们做事情有点太多了阐述至极我十分不理解好,因为我只是一个Android初学者的帐户。 我知道它不是简单地调用:

Whats the simplest way to create a custom account on Android? So far I've read the documentation: Creating a Custom Account Type but it certainly didn't help a lot (too vague info). I tried reading the example from LastFm but certainly they did things a bit too much elaborated wich I quite didn't understand well since I'm just an Android begginer with the accounts. I know its not as simple as calling:

final Account account = new Account(mUsername, your_account_type);
mAccountManager.addAccountExplicitly(account, mPassword, null);

,因为这会特罗异常。 到目前为止,我了解,我需要使用 AccountAuthenticatorActivity 和这可以作为身份验证服务。 任何帮助,将点我在正确的方向将是更AP preciated。

because this would trow an exception. So far I understood that I need to use an AccountAuthenticatorActivity and a service that works as authenticator. Any help that would point me in the right direction would be much appreciated.

推荐答案

你检出样品同步适配器应用?这是一个有点复杂,令人费解,但如果你坚持下去,你可以得到的东西的工作。我有在 Android应用程序我一直工作在如果稍微简单的实现要检查出来为好。

Did you checkout the sample sync adapter app? It's a little complicated and convoluted, but if you stick with it you can get things working. I've got a slightly simpler implementation in an android app I've been working on if you want to check that out as well.

帐户的那些东西,我真的希望机器人做了很多简单的办法。它曾经是一个不良记录而关键的功能。这些文件似乎是越来越好,但。

Accounts are one of those things that I really wish android made a lot simpler. It used to be a poorly documented yet critical feature. They documentation seems to be getting better though.

这篇关于创建自定义帐户的android的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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