Ok.. thanks.. I tried it, but no success..Same error.
Now. This is my manifest
<service android:name="test.AccountAuthenticatorService" android:label="
test.AccountAuthenticatorService" android:exported="true">
<intent-filter>
<action android:name="android.accounts.AccountAuthenticator">
</action>
</intent-filter>
<meta-data android:name="android.accounts.AccountAuthenticator"
android:resource="@xml/authenticator">
</meta-data>
</service>
And this is my service
namespace test
{
[Service(Name = " test.AccountAuthenticatorService", Label = "
test.AccountAuthenticatorService")]
[IntentFilter(new[] { "android.accounts.AccountAuthenticator" })]
[MetaData("android.accounts.AccountAuthenticator", Resource =
"@xml/authenticator")]
public class AccountAuthenticatorService : Service
{
private static string TAG = " test.AccountAuthenticatorService";
private static AccountAuthenticator sAccountAuthenticator = null;
public static string ACCOUNT_TYPE = "test.account";
public static string ACCOUNT_NAME = " test";
private Context _context;
public AccountAuthenticatorService(Context _context)
: base()
{
this._context = _context;
}
public AccountAuthenticatorService()
: base()
{
}
public override void OnCreate()
{
sAccountAuthenticator = new AccountAuthenticator(this);
}
public override IBinder OnBind(Intent intent)
{
IBinder ret = null;
if (intent.Action ==
Android.Accounts.AccountManager.ActionAuthenticatorIntent)
ret = getAuthenticator().IBinder;
return ret;
}
private AccountAuthenticator getAuthenticator()
{
if (sAccountAuthenticator == null)
sAccountAuthenticator = new AccountAuthenticator
(this._context);
return sAccountAuthenticator;
}
}
Do I have to start the service?
I don’t think so.. In All the samples I saw they don’t start it..
Thanks in advance!
Un saludo
Javier Martínez Sáez
Responsable Soporte Técnico eLegisla
www.externalia.com
Tfno.: 945 291 684 | Fax 945 205 228
[email protected]
www.egestiona.es | www.elegisla.es | www.eadr.es
******************** CLÁUSULA DE CONFIDENCIALIDAD ********************
Este mensaje electrónico y todos los ficheros adjuntos que contiene son
confidenciales y destinados exclusivamente para el uso de la o las personas a
las que va dirigido, pudiendo estar sujeta a Secreto Profesional. Si usted ha
recibido este mensaje por error, le agradecemos lo comunique al emisor.
Asimismo, le informamos que la distribución, copia o utilización de este
mensaje, o de cualquier documento adjunto al mismo, cualquiera que fuera su
finalidad, están prohibidas por la ley.
Antes de imprimir este e-mail piense bien si es necesario hacerlo. El
medioambiente es cosa de todos
-----Mensaje original-----
De: [email protected]
[mailto:[email protected]] En nombre de Jonathan Pryor
Enviado el: viernes, 21 de septiembre de 2012 17:28
Para: Discussions related to Mono for Android
Asunto: Re: [mono-android] Android Account Provider
On Sep 18, 2012, at 2:49 AM, javitxin <[email protected]> wrote:
> I am trying to implement an account provider with no success..I hope someone
> could help me please..
>
> First, this is my service and AccountAuthenticator class
>
> namespace test
> {
> public class AccountAuthenticatorService : Service
You're missing a [Service] custom attribute on AccountAuthenticatorService. The
[Service] custom attribute is used to add a <service/> element to
AndroidManifest.xml.
> Second, my AndroidManifest
>
> <service android:name="test.AccountAuthenticatorService"
> android:exported="true" android:process=":auth">
> <intent-filter>
> <action android:name="android.accounts.AccountAuthenticator">
> </action>
> </intent-filter>
> <meta-data android:name="android.accounts.AccountAuthenticator"
> android:resource="@xml/authenticator">
> </meta-data>
> </service>
Given that <service/> element, you'll want:
[Service]
[IntentFilter (new[]{"android.accounts.AccountAuthenticator"})]
[MetaData ("android.accounts.AccountAuthenticator",
Resource="@xml/authenticator")]
public class AccountAuthenticatorService : Service {...}
See also:
http://docs.xamarin.com/android/advanced_topics/working_with_androidmanifest.xml
- Jon
_______________________________________________
Monodroid mailing list
[email protected]
UNSUBSCRIBE INFORMATION:
http://lists.ximian.com/mailman/listinfo/monodroid
_______________________________________________
Monodroid mailing list
[email protected]
UNSUBSCRIBE INFORMATION:
http://lists.ximian.com/mailman/listinfo/monodroid