Published Date : 2021年4月11日19:51

【Androidアプリ:パート2】個人事業主と給与所得者の所得税と住民税を計算するAndroidアプリ
【Android app:Part 2】Android App Calculates Income and Resident Taxes for sole proprietors and salaried workers


This blog has an English translation


ニコニコ動画にアップした動画のまとめ記事です。

This is a summary blog post about a video I uploaded to NicoNico.

細かい部分は動画を参考にしてください。

Please refer to the video for details.


目次

Table of Contents




① 動画の説明
① Video Description



警告:

今回説明する給与所得者と個人事業主等の所得税及び住民税を計算するアプリは、あくまで簡易的なお遊び用のアプリです。

正確な数値、計算方法は各自で調べて下さい。

このアプリは大雑把に大体の見積りを計算して楽しむ為のアプリです。

決して従業員の年末調整や個人の確定申告等に使用しないでください。

さらに、税金の計算方法は変更される場合があり、控除についても同様です。

また、控除や税金の計算方法が間違っている可能性もありますので、

あまり信用せずに、各自で調べてから実験してみてください。

このアプリを使って何かしらの損害が発生したとしても、私は一切の責任を負いません。

Warning:

​The app I'm going to show you for calculating income and residence taxes for salaried workers and Individual employers, etc. is just a simple application for playing.

​Please check the exact number and calculation method by yourself.

​This app is used to calculate rough estimates and enjoy them.

​Do not use for year-end adjustment of employees or for individual tax return.

In addition, the method of calculating taxes and deductions may change.

Also, there is a possibility that the deduction and tax calculation methods are incorrect.

Don't trust it too much, and test it yourself.

​I will not be liable for any damage caused by using this app.

個人事業主と給与所得者の所得税と住民税を計算するAndroidアプリパート2。

Android App Calculates Income and Resident Taxes for sole proprietors and salaried workers, Part 2.

前回の続きです。

Continued from last time.

commonライブラリのdrawableフォルダの中身を作成しましょう。

Create the contents of the drawable folder in the common library.

動画の手順でファイルを作成します。

Create a file as described in the video.

名前に頭に[common]を付けただけで、内容は前回作成した[border]ファイルと変わりません。

You just prefix the name with [common], and the content remains the same as the last [border] file you created.

common_border.xml
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
    android:shape="rectangle">
    <stroke
        android:width="1dp"
        android:color="#000" />
    <padding
        android:top="3dp"
        android:bottom="3dp"
        android:left="3dp"
        android:right="3dp" />

    <corners
        android:radius="3dp" />
</shape>

ひとまず全てのファイルを内容を空の状態で作成しましょう。

In this case, create all the files. However, only the file is created and the contents remain empty.

前回の動画シリーズで使用したボタンの画像ファイルも格納します。

The image file of the button used in the previous tutorial video series is also stored.

アプリの切り替えボタンに使用する画像ファイルも作成します。

You can also create an image file to use for the application's switch button.

この画像はフリーアイコン素材サイトの[icoon mono]からダウンロードして使用しています。

I downloaded this image from free icon material site [icoon mono] and use it.

各自で独自に作るか、このようなサイトからダウンロードしてボタンの画像として活用してください。

You can create your own or download it from a site like this and use it as a button image.

次にレイアウトファイルを一気に全て空の状態で作成してきます。

Next, create the layout file all at once, empty.

基礎控除用のレイアウトファイル。

Layout file for basic deduction.

タイトル用のレイアウトファイル。

Layout file for the title.

クリアボタン用のレイアウトファイル。

Layout file for the Clear button.

所得税と住民税の所得控除用のレイアウトファイル。

Layout file for income tax and resident tax deductions.

所得税の所得控除用のレイアウトファイル。

Layout file for income tax deduction.

所得税用のレイアウトファイル。

Layout file for income tax.

リセットボタン用のレイアウトファイル。

The layout file for the reset button.

住民税の所得控除用のレイアウトファイル。

Layout file for resident tax deduction.

住民税用のレイアウトファイル。

Layout file for resident tax.

社会保険料用のレイアウトファイル。

Layout file for social insurance premiums.

手取り額用のレイアウトファイル。

Layout file for take-home pay.

所得税と住民税の課税所得用のレイアウトファイル

Layout file for taxable income of income tax and resident tax。

ユーザーをメイン画面へ変移させる為のボタンのレイアウトファイル。

Layout file for a button that allows the user to return to the main screen.

ユーザーを個人事業主の税金計算アプリへ変移させる為のボタンのレイアウトファイル。

A layout file for the button that allows the user to use the tax calculation app of the sole proprietor.

ユーザーを給与所得者の税金計算アプリへ変移させる為のボタンのレイアウトファイル。

A layout file for the button that allows the user to use the tax calculation app of the salaried worker.

ユーザーを電卓アプリへ変移させる為のボタンのレイアウトファイル。

A layout file for the button that allows the user to use the calculator application.

各種控除欄を開いた時にパネルの下に出現するレイアウトファイル。

A layout file that appears below the panel when you expand the various deductions.

各種控除欄用のレイアウトファイル。

Layout files for various deduction fields.

各種控除欄を開いたり閉じたりする時用のパネルの上にあるレイアウトファイル。

A layout file on top of a panel for expanding and collapsing various deductions.

これで共通のレイアウトファイルを全て空の状態で作成しました。

You have now created all the common layout files empty.

続いてvaluesフォルダにアプリ全体で共通で使用する色を設定するファイルを作成しましょう。

Next, create a file in the values folder that sets the colors to be used by the entire app.

さらにアプリ全体で共通で使用されるテキストの文字列を設定するファイルも作成します。

You can also create a file that sets the text string that is common to the entire app.


Responsive image


Responsive image


Responsive image


Responsive image

給与所得者の税金計算アプリのアクティビティとその他のファイルを作成します。

Create activities and other files for the tax calculation app for salaried workers.

前回作成したアプリとファイル構成は変わらないので前回の動画を参考にしてください。

The file structure is the same as the application I made last time, so please refer to the previous video.

お次は個人事業主の税金計算アプリ用のアクティビティとその他のファイルを作成します。

Next, you will create activities and other files for the tax calculation app for sole proprietors.

動画の指示に従って作成してください。

Follow the instructions on the video to create one.

ファイル構成は給与所得者の税金計算アプリとさほど変わりませんが、若干の違いがあります。

The file structure is not much different from the tax calculation app for salaried workers, but there are some differences.

これで今回のアプリに必要なファイル構成は整いました。

The file structure required for this application is now complete.

次回はこれら空のファイルの中身のコードを書いていきましょう。

Next time you'll write code for the contents of these empty files.

パート3へ続く。

Continue to Part 3.



以上です。お疲れ様です。

That's all. Thank you for your hard work.