Back to project page android-authenticator-framework.
The source code is released under:
GNU General Public License
If you think the Android project android-authenticator-framework listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
/* * Copyright (C) 2013 Marten Gajda <marten@dmfs.org> */*from w w w . j a v a 2s .co m*/ * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published * by the Free Software Foundation; either version 2 of the License, * or (at your option) any later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA */ package org.dmfs.android.authenticator; import android.app.Service; import android.content.Intent; import android.os.IBinder; /** * A service that acts as an authenticator in Android. * <p> * Add this to your <code>AndroidManifest.xml</code> * </p> * * <pre> * <service * android:name="org.dmfs.android.authenticator.AuthenticationService" * android:exported="true" > * <intent-filter> * <action android:name="android.accounts.AccountAuthenticator" /> * </intent-filter> * * <meta-data * android:name="android.accounts.AccountAuthenticator" * android:resource="@xml/authenticator" /> * </service> * </pre> * * You may have to adjust this to your needs (e.g. add <code>android:process</code>, adjust the authenticator resource name). * * @author Marten Gajda <marten@dmfs.org> */ public class AuthenticationService extends Service { private Authenticator mAuthenticator; /* * (non-Javadoc) * * @see android.app.Service#onCreate() */ @Override public void onCreate() { super.onCreate(); // get a new authenticator mAuthenticator = new Authenticator(this); } /* * (non-Javadoc) * * @see android.app.Service#onBind(android.content.Intent) */ @Override public IBinder onBind(Intent intent) { // return the authenticator IBinder. return mAuthenticator.getIBinder(); } }