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.

Supplies

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
  • ADB.exe
  • Blynk.APK
  • 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

--> https://www.element14.com/community/docs/DOC-78156/l/raspberry-pi-7-touchscreen-display

Step 2: Insert the Micro SD Card Into Your Laptop and Upload Android Things

  1. Download the "android-things-setup-utility" at this link https://partner.android.com/things/console/#/tools
  2. Extract files on your desktop
  3. Launch android-things-setup-utility-windows.exe
  4. What do you want to do?
    1 - Install Android Things and optionally set up Wi-Fi
  5. What hardware are you using?
    1 - Raspberry Pi 3
  6. Do you want to use the default image or a custom image?
    1 - Default image: Used for development purposes. No access to the Android
  7. Wait few minutes for downlaoding
  8. Plug the SD card into your computer. Press [Enter] when ready
  9. Select drive "PHYSICALDRIVE1 (15.8 GB)" and Press [Enter] when ready
  10. Press key [y] and [Enter] for confirm erasing
  11. Wait few minutes for format and flashing
  12. Don't worry if Unmount failed. Remove the card

  13. 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

  1. Plug the power and wait for the first display
  2. Select "No thanks" and yes skip setup
  3. Click on "Connect to network" enter your WiFi informartion and connect or plug ethernet wire

Step 5: Install Apk

  1. 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
  2. Unzip "platform-tools" folder on your desktop
  3. Find CMD in windows startup and run it
  4. Change Directory with "cd" command. Enter >cd c:\Users\YourPersonnalName\Desktop\platform-tools
  5. Connect to raspberry with adb command. Enter >adb connect 192.168.1.xx (replace with the address displayed on the raspberry)
  6. Download "AutoStart - No root.apk" https://apk.tools/details-autostart-no-root-apk/
  7. Download your App "Blynk.apk" https://apk.gold/download?file_id=1085500/blynk-arduino-esp8266-rpi
  8. Copy two files on your desktop
  9. Install "AutoStart - No root.apk" with adb command. >adb install c:\Users\YourPersonnalName\Desktop\com.autostart_222.apk
  10. Install "Blynk.apk" with adb command. >adb install c:\Users\YourPersonnalName\Desktop\Blynk-2.27.5.apk

  11. Launch app" AutoStart" with adb command. >adb shell am start -n com.autostart/com.autostart.AutoStartActivity

Step 6: Select Your App for Autostart

  1. Auto startup : select ON
  2. Applications : select ADD for chose your app "Blynk"
  3. Start delay : 0
  4. Next app delay : 3
  5. Show notification at boot-up : Uncheck
  6. Goto home screen after autostart : Uncheck

Step 7: Test It !

  1. Return in adb cmd window and enter adb command >adb shell input keyevent 3
  2. 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