Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
A

Android-SerialPort-API

> 编程语言
Open source

Fork自Google开源的Android串口通信Demo,修改成Android Studio项目

1.5K stars0 likes1 views
WebsiteGitHub

About

Fork自Google开源的Android串口通信Demo,修改成Android Studio项目

Android-SerialPort-API

Fork自Google开源的Android串口通信Demo,修改成Android Studio项目

This lib is a fork of the Android serial port communication Demo open sourced by Google.

Installation & Usage

Gradle

添加依赖:

Add the dependency:

allprojects {
    repositories {
        ...
        jcenter()
        mavenCentral() // since 2.1.3
    }
}

dependencies {
        // 传统4KB内存页面版本
        implementation 'com.licheedev:android-serialport:2.1.4'
        // 适配16KB页面版本,https://developer.android.google.cn/guide/practices/page-sizes?hl=zh-cn
        implementation 'com.licheedev:android-serialport:2.1.5'
}

Import

java
import android.serialport.SerialPort;

su path

In order to read/write to a serial port in Android you'll need su binary installed on device (this can be done by rooting the device). Usually Android devices that has the ability to communicate with serial ports have su installed on the default path "/system/bin/su". To change this use:

java
// su默认路径为 "/system/bin/su"
// The default path of su is "/system/bin/su"
// 可通过此方法修改
// If the path is different then change it using this
SerialPort.setSuPath("/system/xbin/su");

Usage

…

实现方式参考

Implementation reference

  1. Check sample project
  2. https://juejin.im/post/5c010a19e51d456ac27b40fc

Issues· 27 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

Javaandroidserialport

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言