Android Frappe Authenticator

Android Studio Project

OR Libraries to use in your project (use one)

Android developers fork repo and help!

9 Likes

Frappe Authenticator updates -

Source - https://github.com/revant/AndroidFrappeAuthenticator/tree/redux

Testing Apk - https://github.com/revant/AndroidFrappeAuthenticator/raw/redux/app/build/outputs/apk/FrappeAuthenticator-testing.apk

Prerequisites for testing:

  • Add “OAuth Client” to your Frappe / ERPNext server
  • Set Server url in “Social Login Keys” e.g. https://<org>.erpnext.com

Currently Does :

  • Saves Bearer Token
  • Refresh access token
  • sets user details as per openid_profile endpoint

Uses :

  • Use this in any android app which has to login, use access_token and use REST API
  • Integrate this with current cordova app

Upcoming (As I learn) :

  • Sync Adapter for Contacts

Screenshots

References :

3 Likes

Lovely

Authenticator works well, It can be used separately
check authenticator branch of the git repo.

SyncAdapter things accomplished,
check sync branch of the git repo.

  • Create a content provider (which is unnecessary for storing contacts, kept in source for reference)
  • Using RawContacts and Data tables instead.
  • Managed to write contacts in RawContact and Data, Can print them out on logcat.
  • Using RawContacts adds the Contact in Contact list!

Difficult things for me,

  • Rows in table named Data related to RawContacts Table is stored but not shown on Contacts Phonebook, I don’t know what I’m missing.
  • Only some data from RawContacts table is shown
  • Right now just adding the contacts, if not available locally. Sync two lists (remote/local contacts) in Java!

I hope someone who knows android development helps. There are stub projects but none of them fully work. Most of the Authenticator and SyncAdapter example out there are copied from Write your own Android Sync Adapter and http://www.c99.org/2010/01/23/writing-an-android-sync-provider-part-2/

even this comment!

https://github.com/revant/AndroidFrappeAuthenticator/blob/master/app/src/main/java/io/frappe/frappeauthenticator/authentication/FrappeAuthenticator.java#L21

Screenshots

Contacts to Display has frappe accounts :

Some part from RawContacts is displayed,

Nothing from Data is shown, Data stores email, phone, organization, structured names etc.

Reference for Contact > RawContacts > Data relation :

Contacts Sync Ready for testing
https://github.com/revant/AndroidFrappeAuthenticator/raw/sync/app/build/outputs/apk/frappe-authenticator-test-201703051545.apk

Frappe Icon in contact’s list

Open’s ERPNext Contact viewing activity

Click on Phone or Mobile to call

Click on email to send email.

Someone can improve ui?

Pull request XML layout for activity_profile.xml, I will use it to display contacts instead of plain list.

Edit:

New Screenshot for Contact screen, doesn’t display null values

1 Like

lovely!

Sync Calendar

Renders HTML from description

Download : https://github.com/revant/AndroidFrappeAuthenticator/raw/sync/app/build/outputs/apk/frappe-authenticator-sync-test-201703082220.apk