{"id":21175366,"url":"https://github.com/6thsolution/easymicrosoftsyncadapter","last_synced_at":"2025-10-12T11:32:21.192Z","repository":{"id":80403332,"uuid":"98004967","full_name":"6thsolution/EasyMicrosoftSyncAdapter","owner":"6thsolution","description":"Easy Microsoft Sync Adapter is an Android Library based on Microsoft Graph for syncing with all Microsoft based calendars.","archived":false,"fork":false,"pushed_at":"2017-07-22T08:00:50.000Z","size":167,"stargazers_count":3,"open_issues_count":1,"forks_count":2,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-13T15:55:42.548Z","etag":null,"topics":["android-library","calendar","microsoft","syncmanager"],"latest_commit_sha":null,"homepage":null,"language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/6thsolution.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2017-07-22T03:44:28.000Z","updated_at":"2024-01-07T18:38:45.000Z","dependencies_parsed_at":"2023-04-18T23:31:52.405Z","dependency_job_id":null,"html_url":"https://github.com/6thsolution/EasyMicrosoftSyncAdapter","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/6thsolution/EasyMicrosoftSyncAdapter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/6thsolution%2FEasyMicrosoftSyncAdapter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/6thsolution%2FEasyMicrosoftSyncAdapter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/6thsolution%2FEasyMicrosoftSyncAdapter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/6thsolution%2FEasyMicrosoftSyncAdapter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/6thsolution","download_url":"https://codeload.github.com/6thsolution/EasyMicrosoftSyncAdapter/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/6thsolution%2FEasyMicrosoftSyncAdapter/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261327947,"owners_count":23142428,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android-library","calendar","microsoft","syncmanager"],"created_at":"2024-11-20T16:59:10.308Z","updated_at":"2025-10-12T11:32:21.187Z","avatar_url":"https://github.com/6thsolution.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"Easy Microsoft Sync Adapter is an Android Library based on Microsoft Graph for syncing with all Microsoft based calendars.\n\nPerforming authentication and full duplex sync with **All of Microsoft calendars**.\n\n## Features\n* Supports Outlook, Office365, Exchange Server.\n* Easy to use and implement.\n* Fast and simple syncing.\n* Use android builtin Authenticator.\n* Simple Interface to communicate with.\n* completely writen in kotlin (The future of android :)\n\n## Installation\n1) Configure your top-level `build.gradle` to include our repository\n```groovy\nallprojects {\n    repositories {\n        jcenter()\n        maven { url \"http://dl.bintray.com/6thsolution/public-maven\" }\n    }\n}\n```\nThen config your app-level `build.gradle` to include the library as dependency:\n``` groovy\ncompile 'com.sixthsolution:easymssyncadapter:1.0.0-beta1'\n```\n\n2) Config\nAdd *microsoft_client_id* metadata to your application tag in manifest\nlike this:\n```xml\n\u003cmeta-data\n    android:name=\"microsoft_client_id\"\n    android:value=\"YOUR_MICROSOFT_CLIENT_ID\"\n    /\u003e\n```\n\n## Usage\n* For complete example refer to `app` module and `MSContentProviderTest`\n\n* **Add new account**:\nNote that by adding new account any previous account will be terminated,\nbecause microsoft graph library doesn't support multi login at this time.\n\nFor adding new account you must call `AccountManager#addAccount` .\nit automatically open `LoginActivity` and handle add progress by itself.\n\n\n```java\naccountManager?.addAccount(authType, authType, null, null, this, { future -\u003e\n            try {\n                val bnd: Bundle? = future?.result\n                updateStatus(String.format(Locale.US, \"New account added\\n\\n%s\", bnd.toString()))\n            } catch (ex: Exception) {\n                updateStatus(ex.message)\n            }\n        }, null)\n```\n* **Login handling**:\n\nThe token will be handled by `microsoft graph` library.\nbefore any request you must check for valid token. for this you can use\n`IMSLoginHandler` interface, some of it's methods listed below\n\n 1) **logout(callback: ICallback\u003cVoid\u003e)** : logout from existing account\n and call the callback\n ```java\n loginHandler.logout(object : ICallback\u003cVoid\u003e {\n             override fun failure(ex: ClientException?) {\n                 // TODO\n             }\n\n             override fun success(p0: Void?) {\n                 // TODO\n             }\n         })\n```\n\n2) **login(activity: Activity, callback: ICallback\u003cVoid\u003e)**: Use this\nmethod to login with microsoft account. you can use any method that\nconnected to `Microsoft Graph`. The activity parameter is just for\n running something in `ui thread` and we don't keep any hard reference\n of it.\n\n *Note*: There is an internal login activity that after a successful\n  login will show a dialog that you can enter a display name for your\n  account. it contain a title, an EditText and a Button. if you want to\n  change any of their text you can add this strings to your resource,\n  with your value.\n\n  ```xml\n  \u003cstring name=\"display_name_title\"\u003eEnter a Display name\u003c/string\u003e\n  \u003cstring name=\"display_name_hint\"\u003edisplay name\u003c/string\u003e\n  \u003cstring name=\"display_name_ok\"\u003eOk\u003c/string\u003e\n  ```\n\n 3) **loginSilent(callback: ICallback\u003cVoid\u003e)**: If logged in before you\n can use this method to login silently (actually checking or getting new\n token) without showing any ui. **You Must call this method before\n using any of the library method like adding or deleting event\n or ...** . This method use a callback to inform you of login result.\n\n 4) **loginSilentBlocking(): Void**: In some case you don't want use a\n callback for silent login. in this situation you can use this method\n and wait for return value.\n\n* **Calendar operation handling**\n\nFor adding event, updating, deleting ... you can use\n `IMSCalendarManager` interface. this interface handle both operation\n on local database (via `ContentProvider`) and remote operation (via\n `SyncAdapter`). some of it's method and their description are listed\n below:\n\n 1) **addNewEvent(account: Account, calendarId: String, event: MSEvent)**:\n For adding any new event use this method. the `account` is the logged in\n microsoft account, The `calendarId` is the id of calendar that event\n must be added to it. and finally `event` is the new event.\n This method first add the event to local database then try to add it to\n remote server.\n\n 2) **getListOfAvailableCalendars(): List\u003cMSCalendar\u003e**: This method\n return the list of calendar from local database.\n\n 3) **syncLocalEventsWithRemoteEvents(account: Account)**: Preforming a\n  full sync between remote and local events. This will force the\n  `SyncAdapter` to perform the sync operation right now.\n\n 4) **getListOfAvailableEvents(calendarId: String): List\u003cMSEvent\u003e**:\n This Method return the list of all local event associated with specific\n `calendarId`\n\n 5) **updateExistingEvent(account: Account, calendarId: String, eventId: String, event: MSEvent)**:\n This method first update the event in local database then try to update\n it with remote server. The method's parameters is self explanatory :)\n\n 6) **deleteExistingEvent(account: Account, calendarId: String, eventId: String)**\n This method first delete the event from local database then try to delete\n it from remote server. The method's parameters is self explanatory :)\n\n * **Listen for sync status**\n\n There is an abstract class called `SyncReceiver` which is a `BroadcastReceiver`.\n You can create an instance of it and override\n `onSyncStatusChanged(syncStatus: SyncBroadcastStatus, bundle: Bundle?)`\n to get notified of any progress changes. The `SyncBroadcastStatus` is\n an enum with self explanatory members as follow:\n ```java\n     SyncError\n     SyncCanceled\n     SyncFinished\n     SyncLocalAndRemoteCalendars\n     SyncEventsOfCalendar\n     StartTokenRefresh\n     EndTokenRefresh\n     StartAddEvent_LocalDatabase\n     EndAddEvent_LocalDatabase\n     StartAddEvent_RemoteServer\n     EndAddEvent_RemoteServer\n     StartUpdateEvent_LocalDatabase\n     EndUpdateEvent_LocalDatabase\n     StartUpdateEvent_RemoteServer\n     EndUpdateEvent_RemoteServer\n     StartDeleteEvent_LocalDatabase\n     EndDeleteEvent_LocalDatabase\n     StartDeleteEvent_RemoteServer\n     EndDeleteEvent_RemoteServer\n ```\n\n* **Extra operation**\n1) **Get list of available accounts**\nYou can use this code to get list of available accounts for microsoft.\nas i said before microsoft graph library won't support multi login so\nthe list of accounts contain just one account:\n\n```java\nval authType = getString(R.string.auth_token_type_full_access)\nval accounts: Array\u003cAccount\u003e? = accountManager?.getAccountsByType(authType)\n```\n\n## License\n```\nCopyright 2016-2017 6thSolution Technologies Inc.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n   http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F6thsolution%2Feasymicrosoftsyncadapter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F6thsolution%2Feasymicrosoftsyncadapter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F6thsolution%2Feasymicrosoftsyncadapter/lists"}