Android Studio

Employee Salary Calculation in Android Studio

This tutorial will teach you  to calculating the employee salary calculation using Android Studio.android studio projects are easy for developing.This type of android studio projects is so imponent those who want to be good android studio developer. this is the right where you learn android studio projects examples.

Features of the Project

Input the employee name and the basic salary calculate and display the netsalary using following condition

  • if the basic salary is more than 50000 then include 10% tax.
  • if the basic salary is more than 30000 then include 5% tax.
  • otherwise no tax.

Design the UI Design

Android studio folder structure there is folder which is res this is the folder will help us to make a UI Design of the App.inside res folder you can see the layout folder if you expand the layout folder there is a file
activity_main.xml
in this file we will design App Layout i have design the registration UI design below.

activity_main.xml

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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"
    android:orientation="vertical"
    android:gravity="center">


    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical"
        android:gravity="center"
        >

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginBottom="30dp"
            android:gravity="center"
            android:text="@string/emptitle"
            android:textSize="25sp"
            android:textStyle="bold"
            android:textColor="@color/colorAccent"
            />

        <ImageView
            android:layout_width="200sp"
            android:layout_height="100sp"
            android:gravity="center"
            android:src="@drawable/payroll"
            />
        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="horizontal"
            android:gravity="center">

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginLeft="20sp"
                android:text="@string/empname"
                android:textColor="@color/colorPrimary"
                />

            <EditText
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:id="@+id/empname"
                android:textColor="@color/colorAccent"
                android:gravity="center"

                />

            </LinearLayout>


        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="horizontal"
            android:gravity="center">

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginLeft="20sp"
                android:text="@string/empsalary"
                android:textColor="@color/colorPrimary"
                />

            <EditText
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:id="@+id/empsal"
                android:textColor="@color/colorAccent"
                android:gravity="center"
                />

        </LinearLayout>

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="horizontal"
            android:gravity="center">

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginLeft="20sp"
                android:text="@string/emptax"
                android:textColor="@color/colorPrimary"
                />

            <EditText
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:id="@+id/emptax"
                android:textColor="@color/colorAccent"
                android:gravity="center"

                />

        </LinearLayout>


        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="horizontal"
            android:gravity="center">

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginLeft="20sp"
                android:text="@string/netsal"
                android:textColor="@color/colorPrimary"
                />

            <EditText
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:id="@+id/netsal"
                android:textColor="@color/colorAccent"
                android:gravity="center"

                />

        </LinearLayout>


        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="horizontal"
            android:gravity="center">

            <Button
                android:id="@+id/btn1"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"

                android:text="@string/ok" />


            <Button
                android:id="@+id/btn2"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"

                android:text="@string/cancel" />

        </LinearLayout>

        </LinearLayout>
        </LinearLayout>

Inside the Value Folder we have to Make the App Style.

colors.xml

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <color name="colorPrimary">#008577</color>
    <color name="colorPrimaryDark">#00574B</color>
    <color name="colorAccent">#D81B60</color>
</resources>

strings.xml

admin

Recent Posts

Laravel 11 CRUD Application

In this tutorial will teach Laravel 11 CRUD Application step by step. Laravel  11 CRUD…

3 weeks ago

How to make Times Table in React

in this tutorials we will be talk about how to make a times table in…

4 weeks ago

Laravel Tutorial: How to Add Numbers Easily Laravel 10

In this tutorials will teach How to add two numbers in Laravel 10. (more…)

1 month ago

Build Full-Stack Node.js MongoDB CRUD App with JWT Authentication

In this tutorial, we will teach the process of building a full-stack application using Node.js,…

2 months ago

Hospital Management System using OOP Java and MySQL

In this tutorial, we will explin you through the process of building a Hospital Management…

3 months ago

Mastering JavaScript OOP Inheritance

Inheritance in JavaScript using classes. You have a Person class as the superclass, an Employee…

3 months ago