{"id":25284206,"url":"https://github.com/elastos/elastos.carrierclassic.android","last_synced_at":"2025-10-27T19:31:13.843Z","repository":{"id":55642263,"uuid":"115597572","full_name":"elastos/Elastos.CarrierClassic.Android","owner":"elastos","description":null,"archived":false,"fork":false,"pushed_at":"2020-12-29T09:09:17.000Z","size":539,"stargazers_count":8,"open_issues_count":5,"forks_count":16,"subscribers_count":29,"default_branch":"master","last_synced_at":"2025-02-05T23:45:54.506Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/elastos.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-12-28T07:28:56.000Z","updated_at":"2023-12-27T03:47:53.000Z","dependencies_parsed_at":"2022-08-15T05:20:24.784Z","dependency_job_id":null,"html_url":"https://github.com/elastos/Elastos.CarrierClassic.Android","commit_stats":null,"previous_names":["elastos/elastos.net.carrier.android.sdk"],"tags_count":21,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elastos%2FElastos.CarrierClassic.Android","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elastos%2FElastos.CarrierClassic.Android/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elastos%2FElastos.CarrierClassic.Android/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elastos%2FElastos.CarrierClassic.Android/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/elastos","download_url":"https://codeload.github.com/elastos/Elastos.CarrierClassic.Android/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238548626,"owners_count":19490675,"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":[],"created_at":"2025-02-12T20:36:08.899Z","updated_at":"2025-10-27T19:31:08.474Z","avatar_url":"https://github.com/elastos.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"Elastos Carrier Android SDK\n===========================\n\n[![Build Status](https://travis-ci.com/elastos/Elastos.NET.Carrier.Android.SDK.svg)](https://travis-ci.com/elastos/Elastos.NET.Carrier.Android.SDK)\n\n## Introduction\n\nElastos Carrier Android SDK is a Java API wrapper for the C language based [Elastos Carrier Native SDK](https://github.com/elastos/Elastos.NET.Carrier.Native.SDK). With the Android Carrier SDK, it is possible to build applications for mobile phones, tablets, wearables, TVs and car media systems that run on the Android Operating System (OS) while utilizing the functionalities of the Elastos Carrier.\n\nThe Elastos Carrier is a decentralized and encrypted peer-to-peer (P2P) communication framework that routes network traffic between virtual machines and Decentralized Applications (DApps).\n\nThe authentication process of peer nodes utilizes the Elastos Decentralized ID (DID) sidechain. （TODO）\n\n## Build from source\n\n### 1. Cross-compilation for Android Platform on Ubuntu / Debian / Linux or MacOS host\n\n***************\n\nWith CMake, Elastos Carrier can be cross-compiled to run on Android as a target platform, while compilation is carried out on a(n) Ubuntu / Debian / Linux or MacOS host.\n\n**Prerequisite**: Android NDK 'android-ndk-r16b' or higher must be downloaded onto the host.\nAndroid NDKs (such as 'Linux 64-bit (x86)' or 'Mac' ) can be downloaded from https://developer.android.com/ndk/downloads/ .\nPlease make sure to extract the downloaded NDK.\n\nOpen a new terminal window.\n\nDownload the **Elastos.NET.Carrier.Native.SDK** (not the Elastos.NET.Carrier.Android.SDK) repository using Git:\n```shell\n$ git clone https://github.com/elastos/Elastos.NET.Carrier.Native.SDK\n```\n\nNavigate to the previously downloaded folder that contains the source code of the Carrier project.\n\n```shell\n$ cd YOUR-PATH/Elastos.NET.Carrier.Native.SDK\n```\n\nEnter the 'build' folder.\n```shell\n$ cd build\n```\n\nCreate a new folder with the target platform name, then change directory.\n```shell\n$ mkdir android\n$ cd android\n```\n\nTo generate the required Makefile in the current directory, please make sure to first replace 'YOUR-TARGET-ARCHITECTURE'\nand 'YOUR-ANDROID-NDK-HOME' with the correct option and path.\n\n-DANDROID_ABI accepts the following target architecture options:\n* armeabi-v7a\n* arm64-v8a\n* x86\n* x86_64\n\nReplace 'YOUR-ANDROID-NDK-HOME' with the path to the extracted NDK folder.\n\nRun the command with the correct options described above:\n```shell\n$ cmake -DANDROID_ABI=YOUR-TARGET-ARCHITECTURE -DANDROID_NDK_HOME=YOUR-ANDROID-NDK-HOME -DCMAKE_TOOLCHAIN_FILE=../../cmake/AndroidToolchain.cmake ../..\n\n```\n\nBuild the program: \u003cbr/\u003e\nNote: If \"make\" fails due to missing permissions, use \"sudo make\" instead.\n```shell\n$ make\n```\n\n\n\nInstall the program: \u003cbr/\u003e\nNote: If \"make install\" fails due to missing permissions, use \"sudo make install\" instead.\n```shell\n$ make install\n```\n\n\nCreate distribution package: \u003cbr/\u003e\nNote: If \"make dist\" fails due to missing permissions, use \"sudo make dist\" instead.\n```\n$ make dist\n```\n\nNote: To build for multiple target architectures separately, repeat the steps starting from:\n\nRun the command with the correct options described above:\n```shell\n$ cmake -DANDROID_ABI=YOUR-TARGET-ARCHITECTURE -DANDROID_NDK_HOME=YOUR-ANDROID-NDK-HOME -DCMAKE_TOOLCHAIN_FILE=../../cmake/AndroidToolchain.cmake ../..\n\n```\n\nFor each architecture, the distribution package will contain the following files:\n```\nlibcrystal.so\nlibcarrier.so\nlibcarriersession.so\n```\n\nThese shared native libraries will have to be later imported into the Android project based on their\ntarget architectures.\n\nCurrently, the target CPU architectures **armv7l**, **arm64**, **x86**, **x86-64** are supported.\n\n### 2. Import Android project\n\n**Prerequisite**: Android Studio must be installed (Download from https://developer.android.com/studio/ ).\nAndroid NDK must be installed within Android Studio (File \u003e\u003e Settings \u003e\u003eAppearance and Behavior \u003e\u003e System Settings \u003e\u003e Android SDK -\u003e SDK Tools (Tab) -\u003e NDK (active))\n\nOption 1: Start Android Studio and select \"Check out project from Version Control\", then select Git and add the URL\nhttps://github.com/elastos/Elastos.NET.Carrier.Android.SDK , click clone.\n\nOption 2: Download the Elastos.NET.Carrier.Android.SDK with Git:\n```shell\n$ git clone https://github.com/elastos/Elastos.NET.Carrier.Android.SDK\n```\nthen start Android Studio and import the project with the option 'Open an existing Android Studio project'.\n\n\nSelect 'Create project from existing sources', click next, click finish.\n\nWait for all the import processes to finish.\n\n\n### 3. Import Shared Native Libraries\n\nIn the Project View on the left side, navigate to the directory **\"app/native-dist/lib\"** .\n\nUnder the native-dist folder, create a new folder with the name of the target architecture such as armeabi-v7a, arm64-v8a,\nx86, x86-64 or all of them, depending on which are relevant for your needs.\n\nFrom Step 1 (Cross-compilation for Android Platform) in this documentation, copy the created native libraries ( .so files )\ninto the target directories.\n\nYour project should have following directory structure:\n\n```\napp/native-dist\n   |--include\n       |--carrier.h\n       |--carrier_session.h\n   |--lib\n       |--armeabi-v7a\n          |--libcrystal.so\n          |--libcarrier.so\n          |--libcarriersession.so\n       |--arm64-v8a\n          |--libcrystal.so\n          |--libcarrier.so\n          |--libcarriersession.so\n       |--x86\n          |--libcrystal.so\n          |--libcarrier.so\n          |--libcarriersession.so\n       |--x86-64\n          |--libcrystal.so\n          |--libcarrier.so\n          |--libcarriersession.so\n```\n\nThe files under the subdirectory **\"app/native-dist/include\"** are public header files and are already exported from Carrier native.\n\n### 4. Build Carrier SDK\n\nDepending on which native libraries for target architectures were imported previously, adjust the code in\nElastos.NET.Carrier.Android.SDK\\app\\build.gradle on the following lines:\n\nC:\\Users\\akoss\\AndroidStudioProjects\\Elastos.NET.Carrier.Android.SDK\\app\\build.gradle\n```shell\nndk {\n    abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64'\n}\n```\nOnly those target architectures should stay for which the native libraries were imported.\n\nFurther adjustments are optional.\n\nIn Android Studio, click 'Make Project', then 'Build Project'.\n\n### 5. Output\n\nAfter building with success, the output distribution package named **org.elastos.carrier-debug(release).aar**, carrying the JAR package and JNI shared libraries to different CPU architectures, will be put under the directory:\n```\napp/build/outputs/aar\n```\n## Usage\n\nIn your project with gradle management, add following statements in module's build.gradle to import Carrier SDK:\n\n```markdown\ndependencies {\n    implementation 'org.elastos:carrier:5.3.2'\n}\n```\n\nWhile in project with maven management, add the following statements as it's dependency:\n```markdown\n\u003cdependency\u003e\n  \u003cgroupId\u003eorg.elastos\u003c/groupId\u003e\n  \u003cartifactId\u003ecarrier\u003c/artifactId\u003e\n  \u003cversion\u003e5.3.2\u003c/version\u003e\n  \u003ctype\u003epom\u003c/type\u003e\n\u003c/dependency\u003e\n```\n\n## Basic Tests\n\nAll basic tests are located under the directory **\"app/src/androidTest\"**. These tests can be run in Android Studio.\nBefore running the tests, uncomment the **\"service\"** configuration in AndroidMinifest.xml.\n\n## Build Docs\n\nOpen **Tools** tab in Android Studio and click the **Generate JavaDoc...** item to generate the Java API document.\n\n## Contribution\n\nWe welcome contributions to the Elastos Carrier Android SDK Project.\n\n## Acknowledgments\n\nA sincere thank you to all teams and projects that we rely on directly or indirectly.\n\n## License\nThis project is licensed under the terms of the [GPLv3 license](https://github.com/elastos/Elastos.NET.Carrier.Android.SDK/blob/master/LICENSE)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felastos%2Felastos.carrierclassic.android","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Felastos%2Felastos.carrierclassic.android","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felastos%2Felastos.carrierclassic.android/lists"}