{"id":23551132,"url":"https://github.com/octoblu/meshblukit-android","last_synced_at":"2025-08-04T08:41:48.408Z","repository":{"id":35163047,"uuid":"39409216","full_name":"octoblu/MeshbluKit-Android","owner":"octoblu","description":null,"archived":false,"fork":false,"pushed_at":"2015-12-07T02:41:21.000Z","size":102,"stargazers_count":2,"open_issues_count":2,"forks_count":5,"subscribers_count":11,"default_branch":"master","last_synced_at":"2025-06-02T01:20:40.947Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/octoblu.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}},"created_at":"2015-07-20T21:25:22.000Z","updated_at":"2018-06-27T04:46:13.000Z","dependencies_parsed_at":"2022-08-30T18:51:09.134Z","dependency_job_id":null,"html_url":"https://github.com/octoblu/MeshbluKit-Android","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/octoblu/MeshbluKit-Android","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/octoblu%2FMeshbluKit-Android","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/octoblu%2FMeshbluKit-Android/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/octoblu%2FMeshbluKit-Android/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/octoblu%2FMeshbluKit-Android/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/octoblu","download_url":"https://codeload.github.com/octoblu/MeshbluKit-Android/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/octoblu%2FMeshbluKit-Android/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268672052,"owners_count":24288244,"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","status":"online","status_checked_at":"2025-08-04T02:00:09.867Z","response_time":79,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2024-12-26T10:18:33.447Z","updated_at":"2025-08-04T08:41:48.326Z","avatar_url":"https://github.com/octoblu.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MeshbluKit-Android\n\n## Installation\n\n- In library `build.gradle` add the dependency:\n\n```gradle\ndependencies {\n    compile 'com.octoblu:meshblukit:1.0.1'\n    compile 'com.octoblu:sanejsonobject:4.0.1'\n}\n```\n\n- jCenter will need to be in the repository list in the root project `build.gradle`\n\n```gradle\nbuildscript {\n    repositories {\n        jcenter()\n    }\n    dependencies {\n        // NOTE: Do not place your application dependencies here; they belong\n        // in the individual module build.gradle files\n    }\n}\n\nallprojects {\n    repositories {\n        jcenter()\n    }\n}\n```\n\n## App Examples\n\n* [BeaconBlu](https://github.com/octoblu/BeaconBlu-Android)\n* [Gateblu](https://github.com/octoblu/gateblu-android)\n\n## Import\n\n```java\nimport com.octoblu.meshblukit.Meshblu;\nimport com.octoblu.sanejsonobject.SaneJSONObject;\n```\n\n## API\n\n### Class `Meshblu`:\n\n`import com.octoblu.meshblukit.Meshblu`\n\n- **Constructor:**\n\n```java\nSaneJSONObject meshbluConfig = new SaneJSONObject();\nmeshbluConfig.putOrIgnore(\"uuid\", uuid);\nmeshbluConfig.putOrIgnore(\"token\", token);\nmeshbluConfig.putOrIgnore(\"server\", \"meshblu.octoblu.com\");\nmeshbluConfig.putIntOrIgnore(\"port\", 443);\nnew Meshblu(meshbluConfig, this); // 'this' is the application context\n```\n\n- **Set Credentials:**\n\nUpdate the Credentials for Meshblu.\n\n```java\nSaneJSONObject meshbluConfig = new SaneJSONObject();\nmeshbluConfig.putOrIgnore(\"uuid\", uuid);\nmeshbluConfig.putOrIgnore(\"token\", token);\nmeshbluConfig.putOrIgnore(\"server\", \"meshblu.octoblu.com\");\nmeshbluConfig.putIntOrIgnore(\"port\", 443);\nmeshblu.setCredentials(meshbluConfig);\n```\n\n- **Is Registered:**\n\nReturns true or false whether or not the uuid is set.\n\n```java\nmeshblu.isRegistered();\n```\n\n- **Register:**\n\nRegisters device, will emit `com.octoblu.meshblukit.Meshblu.REGISTER`\n\n```java\nSaneJSONObject properties = new SaneJSONObject();\nproperties.putOrIgnore(\"type\", \"my-device\");\nmeshblu.registered(properties);\n```\n\n- **Generate Token:**\n\nGenerates Token, will emit `com.octoblu.meshblukit.Meshblu.GENERATED_TOKEN`\n\n```java\nmeshblu.generateToken(\"some-uuid\");\n```\n\n\n- **Whoami:**\n\nGets authenticated device, will emit `com.octoblu.meshblukit.Meshblu.WHOAMI`\n\n```java\nmeshblu.whoami();\n```\n- **Message:**\n\nMessage, will emit `com.octoblu.meshblukit.Meshblu.MESSAGE`\n\n\n```java\nSaneJSONObject message = new SaneJSONObject();\nJSONArray jsonArray = new JSONArray();\njsonArray.put('*');\nmessage.putArrayOrIgnore(\"devices\", jsonArray);\nmessage.putOrIgnore(\"topic\", \"test_message\");\nmessage.putOrIgnore(\"payload\", new SaneJSONObject());\nmeshblu.message(message);\n```\n\n- **Update Device:**\n\nUpdate device, will emit `com.octoblu.meshblukit.Meshblu.UPDATE_DEVICE`\n\n```java\nSaneJSONObject properties = new SaneJSONObject();\nproperties.putOrIgnore(\"name\", \"Hello\");\nmeshblu.updateDevice(\"some-uuid\", properties);\n```\n\n- **Claim Device:**\n\nClaim the device through the api, will emit `com.octoblu.meshblukit.Meshblu.CLAIM_DEVICE`\n\n```java\nmeshblu.claimDevice(\"some-uuid\");\n```\n\n- **Send Data:**\n\nSend Data, will emit `com.octoblu.meshblukit.Meshblu.SEND_DATA`\n\n```java\nSaneJSONObject data = new SaneJSONObject();\ndata.putOrIgnore(\"sensor\", \"hello\");\nmeshblu.sendData(data);\n```\n\n- **Delete Device:**\n\nDelete device, will emit `com.octoblu.meshblukit.Meshblu.DELETE_DEVICE`\n\n```java\nmeshblu.deleteDevice(\"some-uuid\");\n```\n\n- **Get Devices:**\n\nGet devices, will emit `com.octoblu.meshblukit.Meshblu.GET_DEVICE`\n\n```java\nSaneJSONObject query = new SaneJSONObject();\nquery.putOrIgnore(\"type\", \"my-device\");\nmeshblu.devices(query);\n```\n\n- **Get Data:**\n\nGet Data, will emit `com.octoblu.meshblukit.Meshblu.GET_DATA`\n\n```java\nSaneJSONObject query = new SaneJSONObject();\nquery.putOrIgnore(\"sensor\", \"some-sensor\");\nmeshblu.devices(\"some-uuid\", query);\n```\n\n- **Get Public Key:**\n\nGet Public Key, will emit `com.octoblu.meshblukit.Meshblu.GET_DATA`\n\n```java\nmeshblu.getPublicKey(\"some-uuid\");\n```\n\n- **Reset Token:**\n\nReset Token, will emit `com.octoblu.meshblukit.Meshblu.RESET_TOKEN`\n\n```java\nmeshblu.resetToken(\"some-uuid\");\n```\n\n- **Update Dangerously:**\n\nUpdate Dangerously, will emit `com.octoblu.meshblukit.Meshblu.UPDATE_DEVICE`\n\n```java\nSaneJSONObject query = new SaneJSONObject();\nSaneJSONObject properties = new SaneJSONObject();\nproperties.putOrIgnore(\"type\", \"updated-device\");\nquery.putOrIgnore(\"$set\", properties);\nmeshblu.updateDangerously(\"some-uuid\", properties);\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foctoblu%2Fmeshblukit-android","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foctoblu%2Fmeshblukit-android","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foctoblu%2Fmeshblukit-android/lists"}