Introduction: Run APK Blynk or Other Android App As HMI on Raspberry Pi
Hello makers !
This is my first instructable...
This is within the reach of the raspberry novice.
I spent a lot of time finding the right combinations for a good reliability and speed of commissioning. Having found little information to implement this I think it would be interesting to share this with you !
For a personal project with an ESP32 I wanted to use the Blynk application as an HMI control screen. The use of a mobile phone was not ideal, a touch pad gave too many openings of diverted uses with other apps.
So I opted for the use of a raspberry PI 3b + with a touch screen. For this project I used an official 7 "screen.
For information all other android applications can work in the same way.
To make this instructable you will need:
- Rasperry Pi 3 or higher
- Official or other touch screen (HDMI screen / mouse keyboard also possible)
- 7 inch screen box
- Micro SD card 16GB ultraSpeed recommended for raspberry
- android things setup utility
- AutoStart - No root.APK
- laptop for config
Step 1: Assemble the Screen With the Raspberry
I do not dwell on this point because a lot of tutorial already exists on this subject.
An official image tutorial can be found on this Element14 page
Step 2: Insert the Micro SD Card Into Your Laptop and Upload Android Things
- Download the "android-things-setup-utility" at this link https://partner.android.com/things/console/#/tools
- Extract files on your desktop
- Launch android-things-setup-utility-windows.exe
- What do you want to do?
1 - Install Android Things and optionally set up Wi-Fi
- What hardware are you using?
1 - Raspberry Pi 3
- Do you want to use the default image or a custom image?
1 - Default image: Used for development purposes. No access to the Android
- Wait few minutes for downlaoding
- Plug the SD card into your computer. Press [Enter] when ready
- Select drive "PHYSICALDRIVE1 (15.8 GB)" and Press [Enter] when ready
- Press key [y] and [Enter] for confirm erasing
- Wait few minutes for format and flashing
Don't worry if Unmount failed. Remove the card
Close the setup utility.
Step 3: Insert the Micro SD Card Into the Slot Provided.
Pay attention to the correct direction of the SD card.
Step 4: Statup Raspberry
- Plug the power and wait for the first display
- Select "No thanks" and yes skip setup
- Click on "Connect to network" enter your WiFi informartion and connect or plug ethernet wire
Step 5: Install Apk
- Download Adb tools https://developer.android.com/studio/releases/platform-tools Direct link https://dl.google.com/android/repository/platform-tools_r29.0.6-windows.zip
- Unzip "platform-tools" folder on your desktop
- Find CMD in windows startup and run it
- Change Directory with "cd" command. Enter >cd c:\Users\YourPersonnalName\Desktop\platform-tools
- Connect to raspberry with adb command. Enter >adb connect 192.168.1.xx (replace with the address displayed on the raspberry)
- Download "AutoStart - No root.apk" https://apk.tools/details-autostart-no-root-apk/
- Download your App "Blynk.apk" https://apk.gold/download?file_id=1085500/blynk-arduino-esp8266-rpi
- Copy two files on your desktop
- Install "AutoStart - No root.apk" with adb command. >adb install c:\Users\YourPersonnalName\Desktop\com.autostart_222.apk
Install "Blynk.apk" with adb command. >adb install c:\Users\YourPersonnalName\Desktop\Blynk-2.27.5.apk
Launch app" AutoStart" with adb command. >adb shell am start -n com.autostart/com.autostart.AutoStartActivity
Step 6: Select Your App for Autostart
- Auto startup : select ON
- Applications : select ADD for chose your app "Blynk"
- Start delay : 0
- Next app delay : 3
- Show notification at boot-up : Uncheck
- Goto home screen after autostart : Uncheck
Step 7: Test It !
- Return in adb cmd window and enter adb command >adb shell input keyevent 3
- Reboot your display with adb command > adb reboot
Wait reboot and wait for autostartup your app "Blynk" after few second.
If you followed and carried out with success or difficulty this tutorial do not hesitate to leave a productive comment to thank or improve it.
Thanks for reading, Florent to elecflo belgium
3 years ago
Thanks for sharing :)