This project, initially conceived as an Android experiment, has evolved into a robust open-source Android Obd2 Reader application. While I, Pires, the maintainer after the original author Brice Lambi, am no longer actively involved, the project continues to be a valuable resource thanks to contributions from a dedicated community.
Initially, the project served as a deep dive into Android development. Over time, it matured into a more structured application, underpinned by the OBD Java API. This API, designed for flexibility, allows the core OBD functionalities to be independent of the communication protocol, needing only an InputStream/OutputStream
pair to operate. Alongside the API, an Android application was developed, although I readily admit its user interface might not win any design awards!
The project’s longevity and continued relevance are a testament to the community contributions. Numerous individuals have stepped in, adding impressive features, bug fixes, and improvements. To all contributors, thank you. Your efforts have shaped this project into what it is today.
This project is now in a phase of community stewardship. While my personal journey with OBD projects has concluded, the Android OBD2 Reader remains available and functional, a resource for those interested in vehicle diagnostics and open-source Android applications.
The Android OBD-II reader application is specifically designed to communicate with Bluetooth ELM327 OBD readers, providing a wireless interface to your vehicle’s diagnostic system.
You can find the latest release of the Android OBD2 Reader application available for download here.
Getting Started with Your Android OBD2 Reader
To get started with development or testing, ensure you have the following prerequisites in place:
Prerequisites
- Java Development Kit (JDK) 8: Essential for compiling the Java-based components.
- Android Studio (1.5.x or Newer): The primary IDE for Android development, needed to build and run the application.
- Android SDK (API 22, Build tools 23.0.1): Specifies the Android version and build tools required for compatibility.
- OBD Java API: This library, which is already included in the project, provides the core OBD communication logic.
Testing with an ELM327 OBD Adapter
To test the Android OBD2 reader app directly on your Android device connected to your car via an ELM327 Bluetooth adapter, follow these steps:
cd whatever_directory_you_cloned_this_repository gradle clean build installDebug
This command will navigate to your project directory, clean any previous builds, build the debug version of the application, and install it on your connected Android device.
Utilizing the OBD Server for Data Upload
The application also supports uploading data to a server. If you wish to enable this functionality, you will need to set up an OBD Server.
- OBD Server: A basic RESTful application, available at OBD Server, can be compiled into a runnable JAR file.
- Enable Upload Functionality: Within the Android OBD2 Reader application preferences, you need to activate the data upload feature.
- Configure Server Endpoint: In the application’s preferences, set the correct server address and port where your OBD Server is running.
Troubleshooting Connection Issues
If you encounter problems connecting your Android OBD2 reader to your vehicle, consider these troubleshooting steps, as suggested by @dembol:
“Before assuming an issue with the Android OBD2 Reader app, it’s crucial to verify your ELM327 adapter and its compatibility with your car. Tools like Torque or Scanmaster can be used to test the basic functionality of your adapter. The problem might indeed lie with the adapter itself or its compatibility with your vehicle’s OBD-II protocol.”
Often, connection issues can be resolved by initializing the ELM327 adapter with specific commands. Many OBD diagnostic tools automatically reset the adapter and configure settings like echo and headers before attempting protocol selection. You can use an ELM327 terminal application on Android to manually send these commands:
ATD
ATZ
AT E0
AT L0
AT S0
AT H0
AT SP 0
These commands perform the following actions:
ATD
: Reset to default settings.ATZ
: Reset all.AT E0
: Turn echo off (recommended).AT L0
: Turn linefeeds off.AT S0
: Turn spaces off.AT H0
: Turn headers off (default).AT SP 0
: Set protocol to automatic.
Depending on your specific ELM327 Bluetooth adapter, you may need to adjust echo and header settings. The following commands can be used:
AT E0
: Turn echo off. Characters sent to the ELM327 adapter are not echoed back. This is often necessary for proper communication.AT E1
: Turn echo on. This is the default setting where characters are echoed back.AT H0
: Turn headers off. This is the default, omitting header information and CRC bytes.AT H1
: Turn headers on. Includes header information and CRC bytes in the communication.
Building with a Custom OBD Java API Version
For developers who require testing with a modified version of the underlying obd-java-api
library, the project provides a straightforward way to integrate a custom build.
-
Clone OBD Java API Repository: In your project directory, clone the
obd-java-api
repository:git clone https://github.com/pires/obd-java-api.git
-
Create build.gradle for OBD Java API: Inside the newly cloned
obd-java-api
directory, create a file namedbuild.gradle
with the following content:apply plugin: 'java'
-
Modify Main build.gradle: Edit the main
build.gradle
file of the Android OBD2 Reader project and replace the dependency line:compile 'com.github.pires:obd-java-api:1.0-RC14'
with:
compile project(':obd-java-api')
-
Update settings.gradle: Edit the
settings.gradle
file in the root of your project and add the following line to include the OBD Java API project:include ':obd-java-api'
By following these steps, your Android OBD2 Reader project will now utilize your locally cloned and potentially modified version of the obd-java-api
library.
Tested Devices
The Android OBD2 Reader application has been successfully tested on a range of Android devices, ensuring broad compatibility:
- Samsung Galaxy Nexus (Android 4.4.1)
- LG Nexus 5 (Android 6.0 Preview 3)
- Nexus 7 2013 WiFi (Android 4.4.4)
- Samsung Galaxy S4 Active I9295 (Android 5.0.2)
- Samsung Galaxy S6 Edge SM-925F (Android 5.0.2)
- Samsung Galaxy Note 3