KO
|
EN
gitlite — search
Search
#javascript
#python
#hacktoberfest
#react
#ai
#typescript
#llm
#go
#golang
#android
#machine-learning
#rust
#deep-learning
#linux
omh-core
★ 9
Open GitHub ↗
omh-core
Download README (.md)
Explore Similar Repositories
Cloudflare-bulk-dns-delete
:
A script made to delete a decently big amount of records from cloudflare DNS.
wm_sdk_w80x
:
SDK for WinnerMicro W800/W801
OpenECCI-GUI
:
GUI-based software for controlled ECCI (Electron Channelling Contrast Imaging) analysis of crystal defects in a scanning electron microscope (SEM).
Linux-PAM-Security-Administration
:
Linux PAM Security Administration, by Packt Publishing
pyproject-check-version
:
No description available.
// repository documentation
Was this content helpful?
★ 0
(0 ratings)
Select Rating:
★
★
★
★
★
Submit Feedback
Recent Feedback
×
Download README
Do you want to download the
README.md
file for
omh-core
?
Download (.md)
[](https://discord.gg/X8QB9DJXX6)  <!-- // TODO - enable when the repo gets released and is public  --> [](https://github.com/openmobilehub/omh-core/actions/workflows/android_pr.yml) # OMH (Open Mobile Hub) - Core Android Plugin 1.0 > **Note:** This repository will be deprecated in August 2024. Developers should use the following repository: > - [OMH 2.0 Core Android Native repo](https://github.com/openmobilehub/android-omh-core) ## Overview *OMH is an Android SDK, available as open-source, that simplifies the process of swapping services such as Maps & Location, Sign-in, Storage, and more, for both Android GMS and Non-GMS devices.* *It aims at creating low coupled, extensible SDK reducing the code boilerplate of switching between GMS, Non-GMS, or any other service, and also provides a custom full open source alternative services switching automatically according to your configuration in the Gradle plugin giving the right outputs without overloading your APK with unnecessary libraries.* ## OMH - Core The OMH Core is a [Gradle plugin](https://docs.gradle.org/current/userguide/plugins.html) that allows developers to configure, enable and set-up the OMH SDK in their projects.This plugin automatically implements the necessary dependencies and enable the custom-build variants to allow you compile the different builds to use the defined providers. ## Installation Go to your app build.gradle file and add the following: ```groovy plugins { ... id 'omh-core' } ... omhConfig { bundle('worldwide') { it.auth { addGmsService 'com.omh.android:auth-api-gms:1.0-SNAPSHOT' addNonGmsService 'com.omh.android:auth-api-non-gms:1.0-SNAPSHOT' } } bundle('gmsStore') { it.auth { addGmsService 'com.omh.android:auth-api-gms:1.0-SNAPSHOT' } } bundle('nonGmsStore') { it.auth { addNonGmsService 'com.omh.android:auth-api-non-gms:1.0-SNAPSHOT' } } } ``` You can also see this video: https://github.com/openmobilehub/omh-core/assets/10377529/1b142648-9005-43cd-804b-8e80e1b0ea07 ## Usage ### Step 1: Create an instance of OmhAuthClient ``` private val omhAuthProvider = OmhAuthProvider.Builder() .addGmsPath(BuildConfig.AUTH_GMS_PATH) .addNonGmsPath(BuildConfig.AUTH_NON_GMS_PATH) .build() ``` ``` private val omhAuthClient = omhAuthProvider.provideAuthClient( scopes = listOf("openid", "email", "profile"), clientId = "YOUR_CLIENT_ID", context = applicationContext ) ``` ### Step 2: Start using some functions In you sample app, perform the authentication ``` private fun startLogin() { val loginIntent = omhAuthClient.getLoginIntent() loginLauncher.launch(loginIntent) } ``` If the authentication is successful, then navigate to your desired screen ``` private val loginLauncher: ActivityResultLauncher<Intent> = registerForActivityResult(ActivityResultContracts.StartActivityForResult()) { result -> try { omhAuthClient.getAccountFromIntent(result.data) navigateToLogIn() } catch (exception: OmhAuthException) { val errorMessage = OmhAuthStatusCodes.getStatusCodeString(404) } } ``` You can also see the video: https://github.com/openmobilehub/omh-core/assets/10377529/b71d0fad-31cf-4a7c-983d-f3542045f3f1 ## Documentation See example and check the full documentation at our [Wiki](https://github.com/openmobilehub/omh-core/wiki). ## Contributing We'd be glad if you decide to contribute to this project. All pull requests are welcome, just make sure that every work is linked to an issue on this repository so everyone can track it. ## Common issue: There is an certain error when using gradle 8.0 * Add this code ``` packagingOptions { exclude("META-INF/DEPENDENCIES") } ``` # Governance For details on our project's governance model and how decisions are made, please see our [Governance Policy](https://github.com/openmobilehub/admin/blob/main/GOVERNANCE.md).