{"id":18745997,"url":"https://github.com/eclipse-uprotocol/up-transport-android-java","last_synced_at":"2026-03-09T22:03:17.244Z","repository":{"id":166587090,"uuid":"636234707","full_name":"eclipse-uprotocol/up-transport-android-java","owner":"eclipse-uprotocol","description":"Java Client Library to connect to the Android implementation of uProtocol","archived":false,"fork":false,"pushed_at":"2024-10-02T01:02:30.000Z","size":158,"stargazers_count":3,"open_issues_count":0,"forks_count":4,"subscribers_count":8,"default_branch":"main","last_synced_at":"2025-04-12T21:53:29.245Z","etag":null,"topics":["android","java","up-transport","uprotocol"],"latest_commit_sha":null,"homepage":null,"language":"Java","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/eclipse-uprotocol.png","metadata":{"files":{"readme":"README.adoc","changelog":null,"contributing":"CONTRIBUTING.adoc","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}},"created_at":"2023-05-04T11:57:45.000Z","updated_at":"2024-11-21T05:40:36.000Z","dependencies_parsed_at":null,"dependency_job_id":"f4817b86-ded5-4e10-86c4-56d320bb5a04","html_url":"https://github.com/eclipse-uprotocol/up-transport-android-java","commit_stats":null,"previous_names":["eclipse-uprotocol/uprotocol-android","eclipse-uprotocol/up-client-android-java","eclipse-uprotocol/up-transport-android-java"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/eclipse-uprotocol/up-transport-android-java","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eclipse-uprotocol%2Fup-transport-android-java","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eclipse-uprotocol%2Fup-transport-android-java/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eclipse-uprotocol%2Fup-transport-android-java/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eclipse-uprotocol%2Fup-transport-android-java/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eclipse-uprotocol","download_url":"https://codeload.github.com/eclipse-uprotocol/up-transport-android-java/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eclipse-uprotocol%2Fup-transport-android-java/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30314406,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-09T20:05:46.299Z","status":"ssl_error","status_checked_at":"2026-03-09T19:57:04.425Z","response_time":61,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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","java","up-transport","uprotocol"],"created_at":"2024-11-07T16:20:22.933Z","updated_at":"2026-03-09T22:03:17.234Z","avatar_url":"https://github.com/eclipse-uprotocol.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"= uProtocol Transport Android Java Library\n:toc:\n:toclevels: 4\n:sectnums:\n:source-highlighter: coderay\n\n== Overview\nThe following is the uProtocol library that implements uTransport defined in https://github.com/eclipse-uprotocol/up-java[uProtocol Java Library] using Android Binder. It also includes some commonly used utilities for error handling.\n\n== Getting Started\n=== Importing the Library\nIf you are using Gradle, add the following to your _build.gradle_ file's dependencies:\n\n[,groovy]\n----\nandroid {\n    dependencies {\n        implementation 'org.eclipse.uprotocol:up-transport-android-java::0.1.+'\n    }\n}\n----\n\n=== Configuring the Library\n`UTransprtAndroid`, by default, establishes a connection to uBus service that is integrated into the system as part of `\"org.eclipse.uprotocol.core\"` package.\n\nIf a service that implements `IUBus.aidl` interface is integrated in a different package, you should configure the library by specifying that component or just that package.\n\n.Example: config.xml\n[, xml]\n----\n\u003cresources\u003e\n    \u003cstring name=\"config_UBusService\" translatable=\"false\"\u003ecom.example.core/.UBusService\u003c/string\u003e\n\u003c/resources\u003e\n----\n\n=== Using the Library\n==== Connecting to uTransport\nBefore using the `UTransportAndroid` APIs, a uE must create an instance and open connection to uBus.\n\nFirst create an instance with one of static factory methods:\n\n[,java]\n----\nstatic UTransportAndroid create(Context context, Handler handler)\nstatic UTransportAndroid create(Context context, Executor executor)\nstatic UTransportAndroid create(Context context, UUri source, Handler handler)\nstatic UTransportAndroid create(Context context, UUri source, Executor executor)\n----\n\n[%hardbreaks]\n`context` is an application context.\n`source` is an address of uE containing its name and major version (MUST match the meta data in the manifest).\n`handler` is a handler on which callbacks should execute, or null to execute on the application's main thread.\n`executor` is an executor on which callbacks should execute, or null to execute on the application's main thread executor.\n\nNOTE: Every Android uE MUST declare its id and major version in the manifest.\n\nFor the example below you may use any `create(...)` factory method.\n\n.Example 1: Single Android uE\n[,xml]\n----\n\u003cmanifest xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    package=\"org.eclipse.uprotocol.example.client\"\u003e\n    ...\n    \u003capplication android:label=\"@string/app_name\" ...\u003e\n        \u003cmeta-data\n            android:name=\"uprotocol.entity.id\"\n            android:value=\"100\" /\u003e\n        \u003cmeta-data\n            android:name=\"uprotocol.entity.version\"\n            android:value=\"1\" /\u003e\n\n        \u003cactivity\n            android:name=\".ExampleActivity\"\u003e\n        \u003c/activity\u003e\n    \u003c/application\u003e\n\u003c/manifest\u003e\n----\n\nFor the next example you should create a separate instance of `UTransportAndroid` for each uE using `create(..., UUri source,...)` factory method.\n\n.Example 2: Several Android uEs bundled together in APK\n[,xml]\n----\n\u003cmanifest xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    package=\"org.eclipse.uprotocol.example.service.lighting\"\u003e\n    ...\n    \u003capplication android:label=\"@string/app_name\"\u003e\n        \u003cservice\n            android:name=\".ExteriorLightingService\"\n            ... \u003e\n            \u003cmeta-data\n                android:name=\"uprotocol.entity.id\"\n                android:value=\"100\" /\u003e\n            \u003cmeta-data\n                android:name=\"uprotocol.entity.version\"\n                android:value=\"1\" /\u003e\n        \u003c/service\u003e\n\n        \u003cservice\n            android:name=\".InteriorLightingService\"\n            ... \u003e\n            \u003cmeta-data\n                android:name=\"uprotocol.entity.id\"\n                android:value=\"101\" /\u003e\n            \u003cmeta-data\n                android:name=\"uprotocol.entity.version\"\n                android:value=\"1\" /\u003e\n        \u003c/service\u003e\n    \u003c/application\u003e\n\u003c/manifest\u003e\n----\n\nThen open connection to uBus using a reactive API below:\n\n[,java]\n----\nCompletionStage\u003cUStatus\u003e open()\n----\n\nWhen you are done with the `UTransportAndroid` you should close the connection:\n\n[,java]\n----\nvoid close()\n----\n\nYou cannot use other methods until the `UTransportAndroid` is connected. When this happens the `CompletionStage\u003cUStatus\u003e` returned by open() will be completed. You may query the connection status using this method:\n\n[,java]\n----\nboolean isOpened()\n----\n\n==== Sending a UMessage\nThe method below is used to send messages to consumers:\n\n[,java]\n----\nCompletionStage\u003cUStatus\u003e send(UMessage message)\n----\n\n==== Registering a UListener\nIn order to start receiving messages, a consumer should register a listener:\n\n[,java]\n----\nCompletionStage\u003cUStatus\u003e registerListener(UUri sourceFilter, UListener listener)\nCompletionStage\u003cUStatus\u003e registerListener(UUri sourceFilter, UUri sinkFilter, UListener listener)\n----\nA consumer can use the same listener for multiple filters, or register different listeners with the same filters.\n\nTo unregister a listener from receiving messages:\n\n[,java]\n----\nCompletionStage\u003cUStatus\u003e unregisterListener(UUri sourceFilter, UListener listener)\nCompletionStage\u003cUStatus\u003e unregisterListener(UUri sourceFilter, UUri sinkFilter, UListener listener)\n----\n\n=== Building the Library\nThe Android Gradle Plugin provides several standard tasks that are commonly used in Android projects. To view the complete list, you can use the following command:\n\n[,bash]\n----\ngradlew tasks\n----\n\nThe following outlines some of the standard tasks employed in the development process:\n\n. *clean*: Deletes the build directory.\n. *build*: Assembles and tests this project.\n. *lintAnalyzeRelease*: Run lint analysis on the release variant.\n. *jacocoTestReport*: Generate Jacoco coverage reports.\n. *connectedDebugAndroidTest*: Installs and runs the tests for debug on connected devices.\n. *publishReleasePublicationToMavenLocal*:  Publishes Maven publication 'release' to the local Maven repository.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feclipse-uprotocol%2Fup-transport-android-java","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feclipse-uprotocol%2Fup-transport-android-java","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feclipse-uprotocol%2Fup-transport-android-java/lists"}