Create your own Android app for Java learning

What kind of app to make

My eldest son was doing something called "Orikouchokin" in a nursery class I enjoy that there is something good when it accumulates, so I decided to make my own app for children, such as a stamp card that manages points. I think there are many such apps to look for, but since the purpose is learning, I will make my own.

environment language app name
AndroidStudio4.0.1 Java OrikouChokin

How to design a stamp card

For the time being, I came up with the idea of arranging ╩╗ImageButton` in a grid pattern. When you click on it, the image of the button is replaced and it looks like you are stamping.

Place the TableLayout inside the default ConstraintLayout.

activity_main.xml


<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".MainActivity">

    <TableLayout
        android:layout_width="358dp"
        android:layout_height="569dp"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintHorizontal_bias="0.493"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent">

        <TableRow
            android:layout_width="match_parent"
            android:layout_height="match_parent">

            <ImageButton
                android:id="@+id/imageButton1"
                android:layout_width="70dp"
                android:layout_height="70dp"
                android:background="@android:color/transparent"
                android:scaleType="centerInside"
                app:srcCompat="@drawable/kyouryu2" />

            <ImageButton
                android:id="@+id/imageButton2"
                android:layout_width="70dp"
                android:layout_height="70dp"
                android:background="@android:color/transparent"
                android:scaleType="centerInside"
                app:srcCompat="@drawable/kyouryu2" />

            <ImageButton
                android:id="@+id/imageButton3"
                android:layout_width="70dp"
                android:layout_height="70dp"
                android:background="@android:color/transparent"
                android:scaleType="centerInside"
                app:srcCompat="@drawable/kyouryu2" />

            <ImageButton
                android:id="@+id/imageButton4"
                android:layout_width="70dp"
                android:layout_height="70dp"
                android:background="@android:color/transparent"
                android:scaleType="centerInside"
                app:srcCompat="@drawable/kyouryu2" />

            <ImageButton
                android:id="@+id/imageButton5"
                android:layout_width="70dp"
                android:layout_height="70dp"
                android:background="@android:color/transparent"
                android:scaleType="centerInside"
                app:srcCompat="@drawable/kyouryu2" />
        </TableRow>

Now the 5 buttons are lined up horizontally. For the time being, in order to make it about 5x4, I will describe four more chunks of <TableRow> </ TableRow>. Then it will be as follows. The image of the button is a psychedelic triceratops written by the eldest son. (Button image settings will be described later) Implement it so that clicking on Triceratops will turn it into a psychedelic Brachiosaurus.

Although it is a stamp card, it is strange that the picture is included from the beginning, so I will try to make it like that later, I hope my eldest son will enjoy the process of completing the app. </ font>

Button image settings

Place the images used in the app, such as the Triceratops mentioned above, in the following locations in the project. AndroidStudioProjects\OrikouChokin\app\src\main\res\drawable image.png If you place it here, Android Studio will complete it when you enter " @ " in the srcCompat property of ╩╗ImageButton`. image.png The button is now a triceratops.

SetOnClickListener for a large number of buttons

(I will write more tomorrow)

Recommended Posts

Create your own Android app for Java learning
Create your own Java annotations
Create your own encode for String.getBytes ()
Kotlin vs. Java: Which Programming Language to Choose for Your Android App
Books used for learning Java
Create your own Solr Function Query
Use LocationAwareLogger for your own Logger
Make your own persistence FW (Java)
Handle your own annotations in Java
[Android] Create validation for date input!
[Android Studio] [Java] Learning memos & links
Learning guidelines for Android development for iOS engineers
Java learning (0)
Java: Try implementing your own comma-separated formatter
First steps for deep learning in Java
Understand java interface in your own way
Utilization of Talend component (5) Create your own component
Create a TODO app in Java 7 Create Header
Learning for the first time java [Introduction]
How to create your own annotation in Java and get the value
[Azure] I tried to create a Java application for free-Web App creation- [Beginner]
Specify Java / Kotlin compile-time options for Android apps
9 strongest sites for learning Java by self study
I made an Android app for MiRm service
[Java] Let's create a mod for Minecraft 1.14.4 [Introduction]
[Java] Let's create a mod for Minecraft 1.16.1 [Introduction]
Create your own Utility with Thymeleaf with Spring Boot
Get your version number in the Android app
[Java] Let's create a mod for Minecraft 1.14.4 [99. Mod output]
Use pagy for pagination in your Rails app.
Android weather app
Java learning day 5
Create a web app that is just right for learning [Spring Boot + Thymeleaf + PostgreSQL]
2017 IDE for Java
Java for statement
java learning day 2
java learning day 1
[Java] Let's create a mod for Minecraft 1.14.4 [0. Basic file]
Create a portfolio app using Java and Spring Boot
[Java] Sort ArrayList with elements of your own class
[Java] Let's create a mod for Minecraft 1.14.4 [4. Add tools]
Create a docker image that runs a simple Java app
How to build Docker + Springboot app (for basic learning)
[Java] Let's create a mod for Minecraft 1.14.4 [5. Add armor]
[Java] Let's create a mod for Minecraft 1.14.4 [Extra edition]
[Java] Let's create a mod for Minecraft 1.14.4 [6. Add recipe]
[Java] Let's create a mod for Minecraft 1.16.1 [Add item]
[Java] Let's create a mod for Minecraft 1.16.1 [Basic file]
[Java] Let's create a mod for Minecraft 1.14.4 [1. Add items]
How to use Truth (assertion library for Java / Android)
Learning memo when learning Java for the first time (personal learning memo)
[Java] Let's create a mod for Minecraft 1.14.4 [2. Add block]
[Java] Let's create a mod for Minecraft 1.16.1 [Add block]