Published Date : 2021年2月16日17:21

パート1: 給与所得者の所得税と住民税を計算するAndroidアプリ
Part 1: Android App Calculates Income and Resident Taxes for 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 tool I'm going to show you for calculating income and residence taxes for salaried workers is just a simple tool for playing.

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

​This tool 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 tool.

今回作るアンドロイドアプリはこのようになります。

The Android app we're going to create looks like this.

前回Pythonとジャンゴで作ったウェブアプリのアンドロイドバージョンです。

This is the Android version of the web app I made last time with Python and Django.

詳しいことは「給与所得者の所得税と住民税を計算してみよう」の動画を参考にしてください。

For details, please refer to the video of [Let's calculate the income tax and the resident tax of salaried workers].

アンドロイドのアプリにしておけば、いつでも素早く計算が可能になると思い、アンドロイドアプリに作り直しました。

I thought that it would be possible to calculate quickly anytime if it was an Android application, so I remade it into an Android application.

このアプリの簡単な説明です。

Here is a brief explanation of this application.

まず最初に月額の給与の範囲から社会保険料を算出します。

First, you calculate the social insurance fee from the monthly salary range.

簡単な計算がすぐにできるように電卓アプリを別のアクティビティで動かせるようにしました。

The calculator application can be launched in another activity so that simple calculation can be done immediately.

アンドロイドのデフォルトで備え付けられている電卓アプリを使用してもいいですが、切り替えが面倒くさいので、新たに作りました。

You can use the calculator application that is installed by default on Android, but switching is troublesome, so I newly made it.

他の電卓アプリ同様に計算結果をコピーアンドペーストできるようにしています。

It allows you to copy and paste calculation results like other calculator applications.

年の途中で会社を辞めている場合等にも社会保険料や給料を再計算できるのが利点です。

The advantage is that you can recalculate the social insurance premium and salary even if you quit the company in the middle of the year.

計算された社会保険料はそのまま税金計算用のアクティビティへ送って、その値をそのまま使用できるようになっています。

The calculated social insurance premiums are sent directly to the activity for tax calculation, and the value can be used as is.

その他の各種控除の入力項目欄は折り畳みができるようにしました。

The entry fields for other deductions can be folded.

その他の機能は以前作成したウェブアプリの時とそれほど変わりません。

The other features are not much different from the web apps we created before.

しばらくの間、アプリの動作をご覧ください。

For a while, see how the app works.

アンドロイドの実機を持っている方はいつも通りにUSBでアンドロイド実機をパソコンに繋げて、動作を確認してみてください。

If you have an actual Android phone, connect it to your computer using USB as usual and check the operation.

ではいつも通りにアンドロイドスタジオを立ち上げて、空のアクティビティを選択して、新しいプロジェクトを作成してください。

Start your Android studio as usual, select an empty activity, and create a new project.

レイアウトウィンドウはスプリットモードにすることをお勧めします。

It is recommended that the layout window be in split mode.

このようにすれば、コードを書き直したりした時に、右側のウィンドウページにレイアウトの変更がリアルタイムに見られるからです。

This way, when you rewrite the code, you can see the layout changes in the right window page in real time.

デフォルトで用意されているテキストビューを削除します。

Deletes the default text view.

スクロールレイアウトを新たに挿入してください。

Insert a new scroll layout.

<ScrollView
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@color/colorN" >
</ScrollView>

バックグラウンド等で使用されている独自の色のコードを[res]フォルダの中の[values]フォルダの中の[colors.xml]に書き込みましょう。

Write the code of your own color used in the background etc. in [colors.xml] file in [values] folder in [res] folder.

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <color name="purple_200">#FFBB86FC</color>
    <color name="purple_500">#FF6200EE</color>
    <color name="purple_700">#FF3700B3</color>
    <color name="teal_200">#FF03DAC5</color>
    <color name="teal_700">#FF018786</color>
    <color name="black">#FF000000</color>
    <color name="white">#FFFFFFFF</color>
->  <color name="colorN">#25153F</color>
</resources>

レイアウトの背景の色が変わりました。

The background color of the layout has changed.

パート2へ続く。

Continue to Part 2.



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

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