All Products
Search
Document Center

Mobile Platform as a Service:Create an application in Android Studio

Last Updated:Feb 02, 2026

In this section, you will create an application that displays a Toast message when a button is clicked and obtain an installation package in APK format.

This procedure has four main steps:

  1. Create a project

  2. Write the code

  3. Create a signature file and sign the project

  4. Install the application on a mobile phone

If you already have a signed, native Android project, you can skip this tutorial and directly create an application in the mPaaS console.

Create a project

  1. Open Android Studio and click File > New > New Project.

  2. In the new project window that appears, select Empty Activity and click Next.

  3. Enter a Name, Package name, and Save location. You can use the default package name. This tutorial uses Scan Application as the Name. Set Minimum SDK to API 18: Android 4.3 (Jelly Bean).

    Note

    API 18: Android 4.3 (Jelly Bean) is the minimum version that mPaaS supports. You can select a different version for production as required.

  4. Click Finish to create the project.

Write the code

  1. Open the activity_main.xml file and add a button using the following code.

     <Button
         android:id="@+id/button"
         android:layout_width="101dp"
         android:layout_height="50dp"
         android:layout_marginStart="142dp"
         android:layout_marginTop="153dp"
         android:layout_marginBottom="151dp"
         android:text="Button"
         app:layout_constraintStart_toStartOf="parent"
         app:layout_constraintTop_toTopOf="parent" />
  2. Open the MainActivity class and add the button's click event.

         findViewById(R.id.button).setOnClickListener(new View.OnClickListener(){
             @Override
             public void onClick(View v) {
                 Toast.makeText(MainActivity.this, "Hello mPaaS!", Toast.LENGTH_SHORT).show();
             }
         });
  3. After the code compiles, the coding step is complete.

Create a signature file and sign the project

  1. In Android Studio, click Build > Generate Signed Bundle / APK.

  2. In the window that appears, select APK and click Next.

  3. Click Create new.

  4. Enter the required information and click OK to create the signature. The generated signature file is available in the specified Key store path.

  5. After the content is automatically populated, click Next to add a signature to the project.

  6. Select a build variant as required. Remember the build variant information because you must select the same type when you use the encrypted file. For the signature versions, you must select V1 (Jar Signature). V2 (Full APK Signature) is optional.

  7. Click Finish. After packaging is complete, the signed APK installation package is available in the debug folder within your project folder (~\MyHApplication\app\debug). In this tutorial, the installation package is named app-debug.apk.

Install the application on a mobile phone

  1. Connect your mobile phone to your computer and enable USB debugging mode on the phone.

  2. Run the project.

  3. Click BUTTON. A Toast message appears, indicating that the application is installed and works as expected.