日本語

TUTORIAL - Installation of the sample Android application

Table of contents

1. Introduction
2. The working policy
3. Preparations
4. Download the binary APK file and install it
4.1 Get the APK
4.2 Install the APK to the target Android device
5. Install an APK by building from source
5.1 Preparations for the Android development environment
5.2 Get the source code
5.3 Load the source tree into the Android Studio
5.4 Preparations on the Android device
5.5 Build and install an APK to the Android device

Appendix
A1. Additional setup for the SSL/TLS communication with the broker

1. Introduction

We describe detailed procedures about how to install the tutorial sample application to your Android devices.

The Android screenshots in this document have taken on a Google Pixel4 device, which runs Android 11. There may by some differences in screen layout or explanatory system messages depending on the running environment. Please read through accordingly.

2. The working policy

There are two significant choices on the installation works.

Install from APK

Install from source

The former is aimed for the ones those who want to try and experience the tutorial application quickly. The latter is aimed for the developers those who intend to work further based on the source code.

3. Preparations

No matter what if you are going to use the downloaded APK as is, or to build an APK by yourself from source tree, you need to take some steps on the target Android device.

This is a restriction coming from the fact that the APK is crafted privately, not distributed from the official Google Play.

That is, you need to explicitly set your Android device to allow installing the Unknown Application which is not under the Google Play control.

Go through following steps.

Settings for Files

Once the target application has installed, revert the above settings Allow from this source to disabled.

4. Download the binary APK file and install it

4.1 Get the APK

Open the Android Chrome application and access to the following URL to download the target file xxx.apk.

Once download has succeeded, the APK will be placed under Downloads directory of the Android device.

4.2 Install the APK to the target Android device

Once you start the Files application for file manipulation on Android, you can see the categories list (left in the figure).

If you click Downloads, you can see the list of files in Downloads screen (center in the figure). Choose the target xxx.apk from there. Now, a dialog pops up to confirm if you want to install the application. Click INSTALL here.

Install confirmation dialog

The above figure is a sample. Read application names accordingly.

Because this is a direct installation from a private repository, instead of the Google Play, a confirmation dialog Google Play Protect immediately pops up (The figure below). This dialog asks if you are willing to install an application from unknown developer.

The tutorial applications are developed by ourself, the National Institute of Informatics (NII), so just click INSTALL ANYWAY and go ahead. This Play Protect confirmation is done at the first installation time only.

Confirmation by Play Protect#1

Now, another confirmation dialog pops up (The figure below). This is a check if you want scan this application and send the result to the Play Protect.

Click DONT SEND to skip. This application scanning procedure also done at the first installation time only.

Confirmation by Play Protect#2

Now you are done! When everything has finished, a toast message which tells “installation succeed” will be briefly shown.

<Reference>
Help protect against harmful apps with Google Play Protect

5. Install an APK by building from source

5.1 Preparations for the Android development environment

Install the latest Android Studio to your workstation (Windows, Mac, Linux or Chrome OS). Beware the system requirements such like operation system version, CPU type and memory amount.

<Reference>
Install Android Studio

5.2 Get the source code

Sample applications in this tutorial are publicly available on GitHub. Download the entire source tree by git command to your workstation.

5.3 Load the source tree into the Android Studio

Once the Android Studio has started, initial window pops up.

Welcome to Android Studio

If you click Open an Existing Project, file explorer dialog pops up. Choose the directory for the previously downloaded source tree.

Open File or Project

The above figure is a sample. Read file/directory names accordingly.

5.4 Preparations on the Android device

To install the APK to the target Android device, you need to enable the USB debugging in the Developer options. Due to the sensitive nature of Developer options, this is a hidden option in the Android Settings screen. Take the following steps.

<Reference>
Configure on-device developer options

5.5 Build and install an APK to the Android device

Build on Android Studio

The above figure is a sample. Read file/directory names accordingly.

<Reference>
Run apps on a hardware device

Appendix

A1. Additional setup for the SSL/TLS communication with the broker

Depending on the security policy for the broker operation, you need to install the required SSL/TLS certificate files on your Android device beforehand. See the following link for details.

Installation of certificates in the system credential storage