Power & Source of Big Ideas

How to Use Gpio Pins On Android

Moderators: chensy, FATechsupport

Hey everbody!

First off all, yes Im a little noob :) . Before I buy my Nanopi M2 I want to know if I can use the GPIO pins on Android 5.0.1 ( I want use a 3 axis gyro for Google Cardboard type apps, exspecally Vridge) if anyone can help me with this please do it :D .
Is easy from Android but you need to use a JNI to run the native C++ code.

If you want to avoid using the FriendlyArm version and the need to sign with the platform-tools signature files, this code I created works well under Android 5 and above and also includes I2C

https://github.com/davemclaughlin/GPIOdriver
Hi, Thank you. I recently came to know that there is a new GPIO expander software!.
Then, I use the GPIO pins of a Raspberry Pi Zero while running Debian Stretch on a PC or Mac with our new GPIO expander software! With this tool, you can easily access a Pi Zero’s GPIO pins from your x86 laptop without using SSH, and you can also take advantage of your x86 computer’s processing power in your physical computing projects.
My request is to discuss every issue as soon as possible. I feel it's slow on issue solving solution.
You should be able to use the GPIO pins on Android, but support can depend on the ROM and kernel used on the NanoPi M2. A lot of Android builds don’t expose GPIO access as easily as Linux does, so getting sensors like a 3 axis gyro working for VR apps may require custom drivers or additional development. If your main goal is Google Cardboard or VRidge tracking, Linux or a newer Android build with better hardware support might be easier to work with.
Richardrol wrote:
You should be able to use the GPIO pins on Android, but support can depend on the ROM and kernel used on the NanoPi M2. A lot of Android builds don’t expose GPIO access as easily as Linux does, so getting sensors like a 3 axis gyro working for VR apps may require custom drivers or additional development. If your main goal is Google Cardboard or VRidge tracking, Linux or a newer Android build with better hardware support might be easier to work with.


Can't believe my old reply is nearly 6 years ago.

If you are building Android from source, you can modify the access to the GPIO pins from the Linux configuration files. I had GPIO, UART, I2C and SPI etc all working with Android 5.1

I've not used these boards for a number of years now but should be easy enough to do the same on later Android source builds.

Who is online

In total there are 3 users online :: 0 registered, 0 hidden and 3 guests (based on users active over the past 5 minutes)
Most users ever online was 13606 on Thu Mar 26, 2026 3:27 pm

Users browsing this forum: No registered users and 3 guests