0

AccountManager vs AIDL vs ContentProvider are use to share data with other app. but which is the better for sharing authentication details with other app like google does.

Narayan soni
  • 821
  • 1
  • 10
  • 28
  • 1
    AccountManger is for managing accounts and there authentication. AIDL is for writing android services which are used by multiple processes. ContentProvider is used to share data (not account authentication details). You could end up using all 3 to have a full fledged account that synchronizes data like google apps. AccountManager vs AIDL vs ContentProvider is not a valid comparison – RocketRandom Feb 09 '16 at 08:47

1 Answers1

1

I prefer AccountManager .

This class provides access to a centralized registry of the user's online accounts. The user enters credentials (username and password) once per account, granting applications access to online resources with "one-click" approval.

Different online services have different ways of handling accounts and authentication, so the account manager uses pluggable authenticator modules for different account types. Authenticators (which may be written by third parties) handle the actual details of validating account credentials and storing account information. For example, Google, Facebook, and Microsoft Exchange each have their own authenticator.

The Android Account Manager is basically an API available to Android developers that makes use of the OAuth protocol. Developers have to jump through some hoops to get their app to display in Accounts & Sync, but the first step is adding the AUTHENTICATE_ACCOUNTS permission to the manifest file for the app.

Content Provider is the mechanism used to expose many of a device's data resources for retrieval and update: Contacts, media store, bookmarks, phone-call log, and so on. It’s hard to find an interesting Android app that doesn’t either use or implement (or both) a Content Provider.

Please read

  1. What should I use Android AccountManager for ?

  2. When to use a Content Provider

  3. When to use an aidl based service?

Community
  • 1
  • 1
IntelliJ Amiya
  • 74,896
  • 15
  • 165
  • 198