{"id":18080733,"url":"https://github.com/omaraflak/arduino-library","last_synced_at":"2026-02-27T01:31:24.140Z","repository":{"id":54878210,"uuid":"91958604","full_name":"omaraflak/Arduino-Library","owner":"omaraflak","description":"A lightweight Android library to communicate with Arduino through usb.","archived":false,"fork":false,"pushed_at":"2024-04-17T06:11:12.000Z","size":175,"stargazers_count":96,"open_issues_count":15,"forks_count":26,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-07-13T20:49:59.883Z","etag":null,"topics":["android","arduino","communication","library","otg","serial","usb"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/omaraflak.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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,"zenodo":null}},"created_at":"2017-05-21T13:19:55.000Z","updated_at":"2025-05-31T13:36:06.000Z","dependencies_parsed_at":"2025-04-12T14:32:53.028Z","dependency_job_id":null,"html_url":"https://github.com/omaraflak/Arduino-Library","commit_stats":null,"previous_names":["omaflak/arduino"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/omaraflak/Arduino-Library","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/omaraflak%2FArduino-Library","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/omaraflak%2FArduino-Library/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/omaraflak%2FArduino-Library/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/omaraflak%2FArduino-Library/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/omaraflak","download_url":"https://codeload.github.com/omaraflak/Arduino-Library/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/omaraflak%2FArduino-Library/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29880699,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-26T23:51:21.483Z","status":"ssl_error","status_checked_at":"2026-02-26T23:50:46.793Z","response_time":89,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5: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","arduino","communication","library","otg","serial","usb"],"created_at":"2024-10-31T13:09:40.012Z","updated_at":"2026-02-27T01:31:24.122Z","avatar_url":"https://github.com/omaraflak.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Arduino\nA lightweight Android library to communicate with Arduino through USB.\n\n# Usage\n\n```java\nArduino arduino = new Arduino(Context);\n\n@Override\nprotected void onStart() {\n    super.onStart();\n    arduino.setArduinoListener(new ArduinoListener() {\n        @Override\n        public void onArduinoAttached(UsbDevice device) {\n            arduino.open(device);\n        }\n\n        @Override\n        public void onArduinoDetached() {\n            // arduino detached from phone\n        }\n\n        @Override\n        public void onArduinoMessage(byte[] bytes) {\n            String message = new String(bytes);\n            // new message received from arduino\n        }\n\n        @Override\n        public void onArduinoOpened() {\n            // you can start the communication\n            String str = \"Hello Arduino !\";\n            arduino.send(str.getBytes());\n        }\n        \n        @Override\n        public void onUsbPermissionDenied() {\n            // Permission denied, display popup then\n            arduino.reopen();\n        }\n    });\n}\n```\n\n```java\n@Override\nprotected void onDestroy() {\n    super.onDestroy();\n    arduino.unsetArduinoListener();\n    arduino.close();\n}\n```\n\n# Custom vendor id\n\nThe library currently filters the vendor id 9025, but you can add your own filter by calling :\n\n```java\nArduino arduino = new Arduino(Context);\narduino.addVendorId(1234);\n```\n\n# Custom delimiter while reading\n\nYou can set a custom delimiter byte (default is `\\n`) :\n\n```java\nArduino arduino = new Arduino(Context);\narduino.setDelimiter(';');\n```\n\n# Arduino Side\n\nExample code which sends back every character received\n\n```C\nvoid setup() {\n    Serial.begin(9600);\n}\n\nvoid loop() {\n    if(Serial.available()){\n        char c = Serial.read();\n        Serial.print(c);\n    }\n}\n```\n\n# Sample Code\n\nSee **[MainActivity.java](https://github.com/omaflak/Arduino/blob/master/app/src/main/java/me/aflak/libraries/MainActivity.java)**\n\n# Special thanks\n\nThis code is using UsbSerial library : [https://github.com/felHR85/UsbSerial](https://github.com/felHR85/UsbSerial)\n\n# License\n\n    MIT License\n    \n    Copyright (c) 2017 Michel Omar Aflak\n    \n    Permission is hereby granted, free of charge, to any person obtaining a copy\n    of this software and associated documentation files (the \"Software\"), to deal\n    in the Software without restriction, including without limitation the rights\n    to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n    copies of the Software, and to permit persons to whom the Software is\n    furnished to do so, subject to the following conditions:\n    \n    The above copyright notice and this permission notice shall be included in all\n    copies or substantial portions of the Software.\n    \n    THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n    IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n    FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n    AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n    LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n    OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n    SOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fomaraflak%2Farduino-library","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fomaraflak%2Farduino-library","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fomaraflak%2Farduino-library/lists"}