{"id":16683307,"url":"https://github.com/barnhill/androidobd","last_synced_at":"2025-10-06T00:05:02.762Z","repository":{"id":37727612,"uuid":"164668192","full_name":"barnhill/AndroidOBD","owner":"barnhill","description":"Android library for reading OBD messages from ELM327 based devices","archived":false,"fork":false,"pushed_at":"2024-12-04T01:34:59.000Z","size":1117,"stargazers_count":59,"open_issues_count":2,"forks_count":10,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-01T01:01:44.147Z","etag":null,"topics":["automotive","car","java","obd","obd2","onboard-diagnostics"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","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/barnhill.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-01-08T14:38:22.000Z","updated_at":"2025-03-21T14:33:08.000Z","dependencies_parsed_at":"2023-01-31T10:01:08.643Z","dependency_job_id":"ea948d9b-f323-4767-8378-552d036486fe","html_url":"https://github.com/barnhill/AndroidOBD","commit_stats":null,"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/barnhill%2FAndroidOBD","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/barnhill%2FAndroidOBD/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/barnhill%2FAndroidOBD/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/barnhill%2FAndroidOBD/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/barnhill","download_url":"https://codeload.github.com/barnhill/AndroidOBD/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253786073,"owners_count":21964087,"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":["automotive","car","java","obd","obd2","onboard-diagnostics"],"created_at":"2024-10-12T14:24:08.769Z","updated_at":"2025-10-06T00:05:02.755Z","avatar_url":"https://github.com/barnhill.png","language":"Kotlin","readme":"![AndroidOBD CI](https://github.com/barnhill/AndroidOBD/workflows/Android%20CI/badge.svg) [![API](https://img.shields.io/badge/API-24%2B-brightgreen.svg?style=flat)](https://android-arsenal.com/api?level=24)\r\n\r\n## Android OBD Library\r\n\r\n\u003cimg src=\"https://raw.githubusercontent.com/barnhill/AndroidOBD/refs/heads/main/logo.png\" width=\"250\"\u003e\r\n\r\n### What is this repository for? ###\r\n\r\nThis project offers a developer friendly interface to communicate with ELM 327 OBD devices via BLUETOOTH.\r\n\r\n### Usage ###\r\n\r\nAdd Dependency:\r\n```Gradle\r\nimplementation 'com.pnuema.android:obd:1.8.1'\r\n```\r\n\r\nTo get started you will need to first send a few commands over bluetooth or usb whatever the input stream is that you negotiate with the ELM-327 device.\r\n\r\nConnection and init:\r\n```\r\nval connected = ObdInitSequence.run(bluetoothSocket)\r\n```\r\n\r\nOnce a connection has been established and inited you can send commands and get responses as follows:\r\n\r\nCode:\r\n```\r\n//Request MODE 1, PID 0C - RPM\r\nval pid = PIDUtils.getPid(ObdModes.MODE_01, \"0C\")\r\nval command = OBDCommand(pid)\r\ncommand.run(bluetoothSocket.inputStream, bluetoothSocket.outputStream)\r\n\r\nLog.d(\"PID\", \"${pid.description} : ${pid.calculatedResult}\")\r\nLog.d(\"PID Formatted Result\", command.formattedResult)\r\n```\r\n\r\n```\r\n//Clear DTCs - NonPermanent\r\nval pid = PID(ObdModes.MODE_04) //Clear DTCs\r\nval command = OBDCommand(pid)\r\ncommand.run(bluetoothSocket.inputStream, bluetoothSocket.outputStream)\r\n```\r\n\r\nNote that you do not have to take the raw values and calculate it yourself.  The library will run the value through the formula that are specified in the specifications for CAN to get the resulting value.  This is available in the `calculatedResult` and `formattedResult` fields on the pid after the `command.run(...)` command finishes.\r\n\r\n### Who do I talk to? ###\r\n\r\n* Brad Barnhill (https://github.com/barnhill)\r\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbarnhill%2Fandroidobd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbarnhill%2Fandroidobd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbarnhill%2Fandroidobd/lists"}