{"id":18330442,"url":"https://github.com/mbientlab/metawear-sdk-android","last_synced_at":"2025-12-16T17:06:19.326Z","repository":{"id":17786369,"uuid":"20660910","full_name":"mbientlab/MetaWear-SDK-Android","owner":"mbientlab","description":"MetaWear Java SDK - Android - Google - Android Studio","archived":false,"fork":false,"pushed_at":"2023-07-19T19:25:41.000Z","size":52911,"stargazers_count":63,"open_issues_count":3,"forks_count":52,"subscribers_count":17,"default_branch":"master","last_synced_at":"2025-03-21T15:45:20.774Z","etag":null,"topics":["android","bluetooth-le","java","metamotion","metawear"],"latest_commit_sha":null,"homepage":"https://mbientlab.com","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mbientlab.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2014-06-09T20:20:13.000Z","updated_at":"2025-01-03T08:09:51.000Z","dependencies_parsed_at":"2023-02-14T11:46:21.389Z","dependency_job_id":"60cb343a-fa6b-46a8-85d9-e8be38d40d6f","html_url":"https://github.com/mbientlab/MetaWear-SDK-Android","commit_stats":null,"previous_names":[],"tags_count":65,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mbientlab%2FMetaWear-SDK-Android","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mbientlab%2FMetaWear-SDK-Android/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mbientlab%2FMetaWear-SDK-Android/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mbientlab%2FMetaWear-SDK-Android/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mbientlab","download_url":"https://codeload.github.com/mbientlab/MetaWear-SDK-Android/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247423496,"owners_count":20936622,"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","bluetooth-le","java","metamotion","metawear"],"created_at":"2024-11-05T19:22:46.217Z","updated_at":"2025-12-16T17:06:19.321Z","avatar_url":"https://github.com/mbientlab.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MetaWear Android API\nThe MetaWear Android API is a library for interacting with [MbientLab's Bluetooth sensor Development boards](https://mbientlab.com/) on an Android device.  A minimum of Android 11.0 (SDK 30) is required to use this library, however for the best results, it is recommended that users be on **Android 13 (SDK 33)**.  \n\n# Setup\n## Adding Compile Dependency\nTo add the library to your project, first, update the repositories closure to include the MbientLab Ivy Repo in the project's  \n``build.gradle`` file.\n\n```gradle\nrepositories {\n    ivy {\n        url \"https://mbientlab.com/releases/ivyrep\"\n        layout \"gradle\"\n    }\n}\n```\n\nThen, add the compile element to the dependencies closure in the module's ``build.gradle`` file.\n\n```gradle\ndependencies {\n    compile 'com.mbientlab:metawear:4.0.0'\n}\n```\n\nThe library was built on Java 17 but works fine with the built-in Java 11 in Android Studio Eel.\n\n## Declaring the Service\nOnce your project has synced with the updated Gradle files, declare the MetaWear Bluetooth LE service in the module's *AndroidManifest.xml* file.\n```xml\n\u003capplication\n    android:allowBackup=\"true\"\n    android:icon=\"@drawable/ic_launcher\"\n    android:label=\"@string/app_name\"\n    android:theme=\"@style/AppTheme\" \u003e\n\n    \u003cservice android:name=\"com.mbientlab.metawear.android.BtleService\" /\u003e\n    \u003c!-- Other application info below i.e. activity definitions --\u003e\n\u003c/application\u003e\n```\n\n## Binding the Service\nLastly, bind the service in your application and retrain a reference to the service's LocalBinder class.  This can be done in any activity or fragment that needs access to a MetaWearBoard object.\n\n```java\nimport android.app.Activity;\nimport android.content.*;\nimport android.os.Bundle;\nimport android.os.IBinder;\n\nimport com.mbientlab.metawear.android.BtleService;\n\npublic class ExampleActivity extends Activity implements ServiceConnection {\n    private BtleService.LocalBinder serviceBinder;\n\n    @Override\n    protected void onCreate(Bundle savedInstanceState) {\n        super.onCreate(savedInstanceState);\n        setContentView(R.layout.activity_main);\n\n        ///\u003c Bind the service when the activity is created\n        getApplicationContext().bindService(new Intent(this, BtleService.class),\n                this, Context.BIND_AUTO_CREATE);\n    }\n\n    @Override\n    public void onDestroy() {\n        super.onDestroy();\n\n        ///\u003c Unbind the service when the activity is destroyed\n        getApplicationContext().unbindService(this);\n    }\n\n    @Override\n    public void onServiceConnected(ComponentName name, IBinder service) {\n        ///\u003c Typecast the binder to the service's LocalBinder class\n        serviceBinder = (BtleService.LocalBinder) service;\n    }\n\n    @Override\n    public void onServiceDisconnected(ComponentName componentName) { }\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmbientlab%2Fmetawear-sdk-android","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmbientlab%2Fmetawear-sdk-android","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmbientlab%2Fmetawear-sdk-android/lists"}