{"id":447939,"date":"2026-05-02T14:23:27","date_gmt":"2026-05-02T08:53:27","guid":{"rendered":"https:\/\/techvidvan.com\/tutorials\/?p=447939"},"modified":"2026-05-02T14:20:41","modified_gmt":"2026-05-02T08:50:41","slug":"employee-tracker-android-project","status":"publish","type":"post","link":"https:\/\/techvidvan.com\/tutorials\/employee-tracker-android-project\/","title":{"rendered":"Android Project &#8211; Employee Tracker Application"},"content":{"rendered":"<p>We will try to make a TechVidvan Employee Tracker Application using Android. We will apply our Android knowledge in a simple yet exciting way to create the application.<\/p>\n<h3>About Android Employee Tracker Application<\/h3>\n<p>An Employee Tracker Application helps organisations in maintaining records of their employees. It provides a simple and easy way to manage and track employee details, attendance, and performance. We can also determine the employee&#8217;s location to see if they are working correctly or roaming around.<\/p>\n<p>We will learn to build an Employee Tracker Application using Android Studio (Java and XML). Our application will have the following features:<\/p>\n<ul>\n<li>You can add as many employee records as needed.<\/li>\n<li>You can edit the employee records.<\/li>\n<li>You can view the location of each employee.<\/li>\n<\/ul>\n<h3>Prerequisites for Android Employee Tracker Application<\/h3>\n<p>You should know the basics of these to start this project :<br \/>\n1. Android Studio<br \/>\n2. XML Designing and Resource Files<br \/>\n3. Java<br \/>\n4. Location Services<br \/>\n5. Firebase<\/p>\n<h3>Download Android Employee Tracker Application Code<\/h3>\n<p>Please download the source code of the Android Employee Tracker Application: <a href=\"https:\/\/drive.google.com\/file\/d\/15jzg4eI5SyYZJxk5yGgCYz0NaL1bPpYP\/view?usp=sharing\" target=\"_blank\" rel=\"noopener\"><strong>Android Employee Tracker Application Code<\/strong><\/a><\/p>\n<h3>Steps to Implement the Android Employee Tracker Application Project<\/h3>\n<p>To run the application on your device, you need to follow these steps :<br \/>\n1. Download the source code of the Employee Tracker App from above. Now, locate the file on your system and unzip it.<br \/>\n2. Open Android Studio and click on Open an Existing Project.<br \/>\n3. The Project will be opened in Android Studio, and you will be able to see the files mentioned above.<br \/>\n4. Make sure to check the versions mentioned in the build.gradle file and those which are present in your System.<br \/>\n5. Run the App now. It will install the application on your emulator or device.<\/p>\n<h3>Step-by-Step Code Explanation of Android Employee Tracker Application<\/h3>\n<h4>1. LandingScreenActivity.java<\/h4>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">package com.example.employeetrackerapplication;\r\n\r\nimport android.Manifest;\r\nimport android.content.Intent;\r\nimport android.content.pm.PackageManager;\r\nimport android.os.Bundle;\r\nimport android.view.View;\r\n\r\nimport androidx.annotation.NonNull;\r\nimport androidx.appcompat.app.AppCompatActivity;\r\nimport androidx.core.app.ActivityCompat;\r\nimport androidx.core.content.ContextCompat;\r\n\r\nimport com.google.android.gms.location.FusedLocationProviderClient;\r\nimport com.google.android.gms.location.LocationServices;\r\nimport com.google.android.gms.tasks.OnSuccessListener;\r\nimport com.google.android.gms.tasks.Task;\r\nimport com.google.android.material.button.MaterialButton;\r\n\r\npublic class LandingScreenActivity extends BaseActivity {\r\n   MaterialButton btnEmployer;\r\n   MaterialButton btnEmployee;\r\n\r\n   private FusedLocationProviderClient fusedLocationClient;\r\n   private static final int LOCATION_PERMISSION_REQUEST_CODE = 1;\r\n\r\n   @Override\r\n   public void onCreate(Bundle savedInstanceState) {\r\n       super.onCreate(savedInstanceState);\r\n       setContentView(R.layout.landing_screen);\r\n\r\n       \/\/ Initialize class-level variables\r\n       btnEmployer = findViewById(R.id.landingEmployerButton);\r\n       btnEmployee = findViewById(R.id.landingEmployeeButton);\r\n\r\n       fusedLocationClient = LocationServices.getFusedLocationProviderClient(this);\r\n\r\n       requestLocationPermission();\r\n       changeLayout();\r\n   }\r\n  \r\n   public void changeLayout() {\r\n       View.OnClickListener handler = new View.OnClickListener() {\r\n           public void onClick(View v) {\r\n               if (v == btnEmployer) {\r\n                   Intent intentMain = new Intent(LandingScreenActivity.this, EmployerViewActivity.class);\r\n                   LandingScreenActivity.this.startActivity(intentMain);\r\n               }\r\n               if (v == btnEmployee) {\r\n                   Intent intentMain = new Intent(LandingScreenActivity.this, EmployeeViewActivity.class);\r\n                   LandingScreenActivity.this.startActivity(intentMain);\r\n               }\r\n           }\r\n       };\r\n\r\n       btnEmployee.setOnClickListener(handler);\r\n       btnEmployer.setOnClickListener(handler);\r\n   }\r\n\r\n   private void requestLocationPermission() {\r\n       if (ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED) {\r\n           ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.ACCESS_FINE_LOCATION}, LOCATION_PERMISSION_REQUEST_CODE);\r\n       } else {\r\n           getLocation();\r\n       }\r\n   }\r\n\r\n   private void getLocation() {\r\n       if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED &amp;&amp; ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {\r\n           return;\r\n       }\r\n       Task&lt;android.location.Location&gt; locationResult = fusedLocationClient.getLastLocation();\r\n       locationResult.addOnSuccessListener(this, new OnSuccessListener&lt;android.location.Location&gt;() {\r\n           @Override\r\n           public void onSuccess(android.location.Location location) {\r\n               if (location != null) {\r\n                 \r\n               }\r\n           }\r\n       });\r\n   }\r\n\r\n   @Override\r\n   public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {\r\n       super.onRequestPermissionsResult(requestCode, permissions, grantResults);\r\n       if (requestCode == LOCATION_PERMISSION_REQUEST_CODE) {\r\n           if (grantResults.length &gt; 0 &amp;&amp; grantResults[0] == PackageManager.PERMISSION_GRANTED) {\r\n               getLocation();\r\n           }\r\n       }\r\n   }\r\n}<\/pre>\n<p><strong>Explanation:<\/strong><\/p>\n<ul>\n<li><span style=\"box-sizing: border-box; margin: 0px; padding: 0px;\">First, we include the necessary\u00a0<strong>Android libraries<\/strong>\u00a0and\u00a0<strong>Google Location<\/strong>\u00a0Services libraries, and define\u00a0<strong>LandingScreenActivity,<\/strong>\u00a0which extends\u00a0<strong>BaseActivity,<\/strong> which contains our toolbar.<\/span><\/li>\n<li>We define two\u00a0<strong>MaterialButtons:<\/strong> FusedLocationProviderClient, which gets the location,\u00a0and <strong>LOCATION_PERMISSION_REQUEST_CODE,<\/strong> which handles location permission request results.<\/li>\n<li>We created <strong>OnCreate()<\/strong> to initialise UI components and request location permission. It also connects UI buttons to the corresponding variables.<\/li>\n<li><strong>changeLayout()<\/strong> is used to define what happens when the employer or employee button is clicked. <strong>setOnClickListener<\/strong> sets the click listener on buttons, and <strong>Intent<\/strong> helps us navigate to the respective activity.<\/li>\n<li><strong>requestLocationPermission()<\/strong> checks if location permission is granted. If not, request permission. <strong>getLocation()<\/strong> retrieves the location if permissions are granted. The <strong>OnSuccessListener<\/strong> handles the location result.<\/li>\n<\/ul>\n<h4>2. EmployeeViewActivity.java<\/h4>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">package com.example.employeetrackerapplication;\r\n\r\nimport android.content.Intent;\r\nimport android.os.Bundle;\r\nimport android.view.View;\r\nimport android.widget.EditText;\r\nimport android.widget.Toast;\r\n\r\nimport androidx.annotation.NonNull;\r\nimport androidx.appcompat.app.AppCompatActivity;\r\n\r\nimport com.google.android.gms.tasks.OnFailureListener;\r\nimport com.google.android.gms.tasks.OnSuccessListener;\r\nimport com.google.android.material.button.MaterialButton;\r\nimport com.google.firebase.firestore.DocumentReference;\r\nimport com.google.firebase.firestore.FirebaseFirestore;\r\n\r\nimport java.text.SimpleDateFormat;\r\nimport java.util.Date;\r\nimport java.util.HashMap;\r\nimport java.util.Map;\r\n\r\npublic class EmployeeViewActivity extends AppCompatActivity {\r\n\r\n   private EditText editTextName;\r\n   private EditText editTextId;\r\n   private MaterialButton btnIn;\r\n   private MaterialButton btnOut;\r\n   private FirebaseFirestore db;\r\n\r\n   @Override\r\n   protected void onCreate(Bundle savedInstanceState) {\r\n       super.onCreate(savedInstanceState);\r\n       overridePendingTransition(R.anim.fade_in, R.anim.fade_out);\r\n       setContentView(R.layout.employee_view);\r\n\r\n       editTextName = findViewById(R.id.editTextName);\r\n       editTextId = findViewById(R.id.editTextId);\r\n       btnIn = findViewById(R.id.empViewInButton);\r\n       btnOut = findViewById(R.id.empViewOutButton);\r\n\r\n       db = FirebaseFirestore.getInstance();\r\n\r\n       changeLayout();\r\n   }\r\n\r\n   \/\/ Transition between layouts\r\n   public void changeLayout() {\r\n       View.OnClickListener handler = new View.OnClickListener() {\r\n           public void onClick(View v) {\r\n               if (v == btnIn) {\r\n                   saveEmployeeData();\r\n               }\r\n               if (v == btnOut) {\r\n                   Intent intentMain = new Intent(EmployeeViewActivity.this, LandingScreenActivity.class);\r\n                   EmployeeViewActivity.this.startActivity(intentMain);\r\n               }\r\n           }\r\n       };\r\n\r\n       btnIn.setOnClickListener(handler);\r\n       btnOut.setOnClickListener(handler);\r\n   }\r\n\r\n   public void saveEmployeeData() {\r\n       String name = editTextName.getText().toString();\r\n       String id = editTextId.getText().toString();\r\n\r\n       if (name.isEmpty() || id.isEmpty()) {\r\n           Toast.makeText(this, \"Please enter both name and ID\", Toast.LENGTH_SHORT).show();\r\n           return;\r\n       }\r\n\r\n       String checkInTime = getCurrentTime(); \/\/ Get current time as check-in time\r\n\r\n       Map&lt;String, Object&gt; employee = new HashMap&lt;&gt;();\r\n       employee.put(\"name\", name);\r\n       employee.put(\"id\", id);\r\n       employee.put(\"checkInTime\", checkInTime); \r\n       employee.put(\"attendance\", \"Present\");\r\n\r\n       db.collection(\"employees\")\r\n               .add(employee)\r\n               .addOnSuccessListener(new OnSuccessListener&lt;DocumentReference&gt;() {\r\n                   @Override\r\n                   public void onSuccess(DocumentReference documentReference) {\r\n                       Toast.makeText(EmployeeViewActivity.this, \"Employee data saved\", Toast.LENGTH_SHORT).show();\r\n                       Intent intent = new Intent(EmployeeViewActivity.this, WelcomeActivity.class);\r\n                       intent.putExtra(\"EMPLOYEE_NAME\", name);\r\n                       intent.putExtra(\"EMPLOYEE_ID\", id);\r\n                       startActivity(intent);\r\n                   }\r\n               })\r\n               .addOnFailureListener(new OnFailureListener() {\r\n                   @Override\r\n                   public void onFailure(@NonNull Exception e) {\r\n                       Toast.makeText(EmployeeViewActivity.this, \"Error saving data\", Toast.LENGTH_SHORT).show();\r\n                   }\r\n               });\r\n   }\r\n\r\n   private String getCurrentTime() {\r\n       SimpleDateFormat sdf = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\");\r\n       return sdf.format(new Date());\r\n   }\r\n}\r\n\r\n<\/pre>\n<p><strong>Explanation:<\/strong><\/p>\n<ul>\n<li><strong>First, we import the necessary\u00a0<strong>Android libraries<\/strong>\u00a0and the\u00a0<strong>Firebase Firestore<\/strong>\u00a0libraries and define\u00a0<strong>EmployeeViewActivity.<\/strong>\u00a0<\/strong>We define 2 <strong>Input Fields,<\/strong> 2 <strong>Material buttons<\/strong> and a <strong>Firestore instance<\/strong> to interact with the Firestore database.<\/li>\n<li>We define the <strong>onCreate()<\/strong> to initialize UI components and set up layout transitions and click listeners. It also connects the UI elements to the corresponding variables.<\/li>\n<li><strong>changeLayout()<\/strong> is used to define what happens when the check-in or check-out button is clicked. <strong>Intent<\/strong> navigates back to <strong>LandingScreenActivity<\/strong> when the check-out button is clicked.<\/li>\n<li><strong>saveEmployeeData()<\/strong> saves employee data to Firestore. It retrieves <strong>Name<\/strong> and <strong>ID<\/strong> from the input fields. Gets the current check-in time and adds the data to the employees collection in Firestore.<\/li>\n<li><strong>getCurrentTime()<\/strong> returns the current date and time in the given format.<\/li>\n<\/ul>\n<h4>3. EmployerViewActivity.java<\/h4>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">package com.example.employeetrackerapplication;\r\n\r\nimport android.content.Intent;\r\nimport android.graphics.Typeface;\r\nimport android.os.Bundle;\r\nimport android.view.View;\r\nimport android.widget.RadioButton;\r\nimport android.widget.RadioGroup;\r\nimport android.widget.Toast;\r\n\r\nimport androidx.annotation.NonNull;\r\nimport androidx.appcompat.app.AppCompatActivity;\r\n\r\nimport com.google.android.gms.tasks.OnCompleteListener;\r\nimport com.google.android.gms.tasks.Task;\r\nimport com.google.android.material.button.MaterialButton;\r\nimport com.google.firebase.firestore.DocumentSnapshot;\r\nimport com.google.firebase.firestore.FirebaseFirestore;\r\nimport com.google.firebase.firestore.QuerySnapshot;\r\n\r\npublic class EmployerViewActivity extends AppCompatActivity {\r\n\r\n   private RadioGroup employerViewRadioGroup;\r\n   private MaterialButton employerViewButton;\r\n   private MaterialButton employerViewExitButton;\r\n   private FirebaseFirestore db;\r\n\r\n   @Override\r\n   protected void onCreate(Bundle savedInstanceState) {\r\n       super.onCreate(savedInstanceState);\r\n       setContentView(R.layout.employer_view);\r\n\r\n       employerViewRadioGroup = findViewById(R.id.employerViewRadioGroup);\r\n       employerViewButton = findViewById(R.id.employerViewButton);\r\n       employerViewExitButton = findViewById(R.id.employerViewExitButton);\r\n\r\n       db = FirebaseFirestore.getInstance();\r\n\r\n       employerViewButton.setOnClickListener(new View.OnClickListener() {\r\n           @Override\r\n           public void onClick(View v) {\r\n               int selectedId = employerViewRadioGroup.getCheckedRadioButtonId();\r\n               RadioButton selectedEmployee = findViewById(selectedId);\r\n\r\n               if (selectedEmployee != null) {\r\n                   Intent intent = new Intent(EmployerViewActivity.this, EmployeeLocationActivity.class);\r\n                  \r\n                   intent.putExtra(\"EMPLOYEE_ID\", selectedEmployee.getTag().toString());\r\n                   startActivity(intent);\r\n               }\r\n           }\r\n       });\r\n\r\n       employerViewExitButton.setOnClickListener(new View.OnClickListener() {\r\n           @Override\r\n           public void onClick(View v) {\r\n               finish();\r\n           }\r\n       });\r\n\r\n       fetchEmployeeData();\r\n   }\r\n\r\n   private void fetchEmployeeData() {\r\n       db.collection(\"employees\").get().addOnCompleteListener(new OnCompleteListener&lt;QuerySnapshot&gt;() {\r\n           @Override\r\n           public void onComplete(@NonNull Task&lt;QuerySnapshot&gt; task) {\r\n               if (task.isSuccessful()) {\r\n                   QuerySnapshot querySnapshot = task.getResult();\r\n                   if (querySnapshot != null) {\r\n                       for (DocumentSnapshot document : querySnapshot.getDocuments()) {\r\n                           String name = document.getString(\"name\");\r\n                           String id = document.getString(\"id\");\r\n\r\n                           if (name != null &amp;&amp; id != null) {\r\n                               addRadioButton(name, id);\r\n                           }\r\n                       }\r\n                   }\r\n               } else {\r\n                   Toast.makeText(EmployerViewActivity.this, \"Error fetching employee data\", Toast.LENGTH_SHORT).show();\r\n               }\r\n           }\r\n       });\r\n   }\r\n\r\n   private void addRadioButton(String name, String id) {\r\n       RadioButton radioButton = new RadioButton(this);\r\n       radioButton.setText(name);\r\n       radioButton.setTag(id);\r\n       radioButton.setTextColor(getResources().getColor(android.R.color.black));\r\n       radioButton.setTextSize(20f);\r\n       radioButton.setTypeface(radioButton.getTypeface(), Typeface.BOLD);\r\n\r\n       radioButton.setButtonTintList(getResources().getColorStateList(android.R.color.black));\r\n\r\n       employerViewRadioGroup.addView(radioButton);\r\n   }\r\n}\r\n<\/pre>\n<p><strong>Explanation:<\/strong><\/p>\n<ul>\n<li>First, we import the necessary Android libraries and the Firebase Firestore libraries and define EmployerViewActivity. We define a group of Radio buttons, 2 Material buttons and a Firestore instance to interact with the Firestore database.<\/li>\n<li>onCreate() is used to initialize UI components and set up click listeners. It also connects the UI elements to the corresponding variables.<\/li>\n<li>employerViewButton.setOnClickListener helps in navigating to EmployeeLocationActivity when an employee is selected.<\/li>\n<li>fetchEmployeeData() fetches employee data from the employees collection in Firestore. It calls addRadioButton() to add each employee as a radio button in the RadioGroup.<\/li>\n<li>addRadioButton() adds a radio button for each employee. It creates a new RadioButton instance and sets the text and tag to the employee&#8217;s name and ID.<\/li>\n<\/ul>\n<h4>4. EmployeeLocationActivity.java<\/h4>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">package com.example.employeetrackerapplication;\r\n\r\nimport static android.content.ContentValues.TAG;\r\n\r\nimport android.content.Intent;\r\nimport android.location.Location;\r\nimport android.os.Bundle;\r\nimport android.util.Log;\r\nimport android.view.View;\r\nimport android.widget.Button;\r\nimport android.widget.TextView;\r\nimport android.widget.Toast;\r\n\r\nimport androidx.annotation.NonNull;\r\nimport androidx.appcompat.app.AppCompatActivity;\r\n\r\nimport com.google.android.gms.location.FusedLocationProviderClient;\r\nimport com.google.android.gms.location.LocationServices;\r\nimport com.google.android.gms.tasks.OnCompleteListener;\r\nimport com.google.android.gms.tasks.OnSuccessListener;\r\nimport com.google.android.gms.tasks.Task;\r\nimport com.google.firebase.firestore.DocumentSnapshot;\r\nimport com.google.firebase.firestore.FirebaseFirestore;\r\nimport com.google.firebase.firestore.QuerySnapshot;\r\n\r\npublic class EmployeeLocationActivity extends AppCompatActivity {\r\n\r\n   private TextView latitudeText, longitudeText, employeeIdText, checkInTimeText, attendanceText;\r\n   private Button homeButton;\r\n   private FusedLocationProviderClient fusedLocationClient;\r\n   private FirebaseFirestore db;\r\n\r\n   @Override\r\n   protected void onCreate(Bundle savedInstanceState) {\r\n       super.onCreate(savedInstanceState);\r\n       setContentView(R.layout.activity_employee_location);\r\n\r\n       latitudeText = findViewById(R.id.latitudeText);\r\n       longitudeText = findViewById(R.id.longitudeText);\r\n       employeeIdText = findViewById(R.id.employeeIdText);\r\n       checkInTimeText = findViewById(R.id.checkInTimeText);\r\n       attendanceText = findViewById(R.id.attendanceText);\r\n       homeButton = findViewById(R.id.homeButton);\r\n\r\n       fusedLocationClient = LocationServices.getFusedLocationProviderClient(this);\r\n       db = FirebaseFirestore.getInstance();\r\n\r\n       \/\/ Get employee data passed from previous activity\r\n       String employeeId = getIntent().getStringExtra(\"EMPLOYEE_ID\");\r\n       Log.d(TAG, \"Received employee ID: \" + employeeId);\r\n\r\n       if (employeeId != null) {\r\n           fetchEmployeeData(employeeId);\r\n       }\r\n\r\n       \/\/ Fetch current location\r\n       fetchLocation();\r\n\r\n       \/\/ Set up the home button\r\n       homeButton.setOnClickListener(new View.OnClickListener() {\r\n           @Override\r\n           public void onClick(View v) {\r\n               Intent intent = new Intent(EmployeeLocationActivity.this, LandingScreenActivity.class);\r\n               startActivity(intent);\r\n               finish();\r\n           }\r\n       });\r\n   }\r\n\r\n   private void fetchEmployeeData(String employeeId) {\r\n       db.collection(\"employees\")\r\n               .whereEqualTo(\"id\", employeeId)\r\n               .get()\r\n               .addOnCompleteListener(new OnCompleteListener&lt;QuerySnapshot&gt;() {\r\n                   @Override\r\n                   public void onComplete(@NonNull Task&lt;QuerySnapshot&gt; task) {\r\n                       if (task.isSuccessful() &amp;&amp; task.getResult() != null &amp;&amp; !task.getResult().isEmpty()) {\r\n                           DocumentSnapshot document = task.getResult().getDocuments().get(0);\r\n                           if (document.exists()) {\r\n                               String id = document.getString(\"id\");\r\n                               String checkInTime = document.getString(\"checkInTime\");\r\n                               String attendance = document.getString(\"attendance\"); \/\/ Fetch attendance\r\n\r\n                               Log.d(\"Firestore\", \"Document data: \" + document.getData());\r\n\r\n                               employeeIdText.setText(id != null ? id : \"N\/A\");\r\n                               checkInTimeText.setText(checkInTime != null ? checkInTime : \"N\/A\");\r\n                               attendanceText.setText(attendance != null ? attendance : \"N\/A\");\r\n                           } else {\r\n                               Log.d(\"Firestore\", \"No such document\");\r\n                               employeeIdText.setText(\"N\/A\");\r\n                               checkInTimeText.setText(\"N\/A\");\r\n                               attendanceText.setText(\"N\/A\");\r\n                           }\r\n                       } else {\r\n                           Log.d(\"Firestore\", \"Error getting documents: \", task.getException());\r\n                           employeeIdText.setText(\"N\/A\");\r\n                           checkInTimeText.setText(\"N\/A\");\r\n                           attendanceText.setText(\"N\/A\");\r\n                       }\r\n                   }\r\n               });\r\n   }\r\n\r\n   private void fetchLocation() {\r\n       try {\r\n           fusedLocationClient.getLastLocation().addOnSuccessListener(this, new OnSuccessListener&lt;Location&gt;() {\r\n               @Override\r\n               public void onSuccess(Location location) {\r\n                   if (location != null) {\r\n                       double latitude = location.getLatitude();\r\n                       double longitude = location.getLongitude();\r\n                       latitudeText.setText(String.valueOf(latitude));\r\n                       longitudeText.setText(String.valueOf(longitude));\r\n                   }\r\n               }\r\n           });\r\n       } catch (SecurityException e) {\r\n           e.printStackTrace();\r\n           Toast.makeText(this, \"Permission denied\", Toast.LENGTH_SHORT).show();\r\n       }\r\n   }\r\n}\r\n\r\n<\/pre>\n<p><strong>Explanation:<\/strong><\/p>\n<ul>\n<li>We include the necessary\u00a0<strong>Android<\/strong>\u00a0libraries,\u00a0<strong>Google Location<\/strong>\u00a0services, and\u00a0<strong>Firebase Firestore<\/strong> libraries, and we define <strong>EmployeeLocationActivity.<\/strong><\/li>\n<li><span style=\"box-sizing: border-box; margin: 0px; padding: 0px;\">We define\u00a0<strong>TextViews<\/strong>\u00a0for displaying important information, a button, a\u00a0<strong>FusedLocationProviderClient<\/strong> for accessing location services,\u00a0and a Firestore instance.<\/span><\/li>\n<li><strong>onCreate()<\/strong> initializes UI components and sets up the necessary instances for location services and Firestore. <strong>getIntent().getStringExtra()<\/strong> retrieves the employee ID passed from the previous activity.<\/li>\n<li><strong>fetchEmployeeData()<\/strong> fetches employee data from the employees collection in Firestore based on the employee ID. It retrieves the first result matching the query and extracts employee details.<\/li>\n<li><strong>fetchLocation()<\/strong> is used to fetch the device&#8217;s location using the <strong>FusedLocationProviderClient<\/strong> and updates the latitude and longitude.<\/li>\n<li><strong>Logout()<\/strong> helps in logging out, and <strong>Intent<\/strong> navigates us back to LandingScreen.<\/li>\n<\/ul>\n<h3>Android Employee Tracker Application Output<\/h3>\n<p><a href=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2025\/10\/android-employee-tracker-landing-screen.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-447942 size-full\" src=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2025\/10\/android-employee-tracker-landing-screen.webp\" alt=\"android employee tracker landing screen\" width=\"836\" height=\"884\" \/><\/a><\/p>\n<h3><a href=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2025\/10\/employee-welcome.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-447943 size-full\" src=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2025\/10\/employee-welcome.webp\" alt=\"employee welcome\" width=\"814\" height=\"884\" \/><\/a><\/h3>\n<h3><a href=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2025\/10\/employee-location.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-447944 size-full\" src=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2025\/10\/employee-location.webp\" alt=\"employee location\" width=\"410\" height=\"887\" \/><\/a><\/h3>\n<h3>Conclusion<\/h3>\n<p>We have succeeded in implementing our TechVidvan Employee Tracker Application using Java and XML. We have discussed project details and prerequisites for this project. Also, we discussed the code explanation to make it easy to understand. We have used Firebase to store the data. I hope you liked this project. Thank You.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>We will try to make a TechVidvan Employee Tracker Application using Android. We will apply our Android knowledge in a simple yet exciting way to create the application. About Android Employee Tracker Application An&#46;&#46;&#46;<\/p>\n","protected":false},"author":710,"featured_media":447941,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2791],"tags":[5761,5763,5765,3007,3010,5760,5764,5762,5766],"class_list":["post-447939","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-android","tag-android-employee-tracker-application","tag-android-employee-tracking-application","tag-android-employee-tracking-system","tag-android-project-ideas","tag-android-projects","tag-android-projects-for-practice","tag-employee-tracker-using-android","tag-employee-tracking-application-using-android","tag-employee-tracking-system-using-android"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Android Project - Employee Tracker Application - TechVidvan<\/title>\n<meta name=\"description\" content=\"An Android Employee Tracker Application helps organisations in maintaining records and tracking their employees.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/techvidvan.com\/tutorials\/employee-tracker-android-project\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Android Project - Employee Tracker Application - TechVidvan\" \/>\n<meta property=\"og:description\" content=\"An Android Employee Tracker Application helps organisations in maintaining records and tracking their employees.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/techvidvan.com\/tutorials\/employee-tracker-android-project\/\" \/>\n<meta property=\"og:site_name\" content=\"TechVidvan\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/TechVidvan\/\" \/>\n<meta property=\"article:published_time\" content=\"2026-05-02T08:53:27+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2025\/10\/android-employee-tracker-application.webp\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"628\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/webp\" \/>\n<meta name=\"author\" content=\"TechVidvan Team\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@vidvantech\" \/>\n<meta name=\"twitter:site\" content=\"@vidvantech\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"TechVidvan Team\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Android Project - Employee Tracker Application - TechVidvan","description":"An Android Employee Tracker Application helps organisations in maintaining records and tracking their employees.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/techvidvan.com\/tutorials\/employee-tracker-android-project\/","og_locale":"en_US","og_type":"article","og_title":"Android Project - Employee Tracker Application - TechVidvan","og_description":"An Android Employee Tracker Application helps organisations in maintaining records and tracking their employees.","og_url":"https:\/\/techvidvan.com\/tutorials\/employee-tracker-android-project\/","og_site_name":"TechVidvan","article_publisher":"https:\/\/www.facebook.com\/TechVidvan\/","article_published_time":"2026-05-02T08:53:27+00:00","og_image":[{"width":1200,"height":628,"url":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2025\/10\/android-employee-tracker-application.webp","type":"image\/webp"}],"author":"TechVidvan Team","twitter_card":"summary_large_image","twitter_creator":"@vidvantech","twitter_site":"@vidvantech","twitter_misc":{"Written by":"TechVidvan Team","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/techvidvan.com\/tutorials\/employee-tracker-android-project\/#article","isPartOf":{"@id":"https:\/\/techvidvan.com\/tutorials\/employee-tracker-android-project\/"},"author":{"name":"TechVidvan Team","@id":"https:\/\/techvidvan.com\/tutorials\/#\/schema\/person\/829765a79c50bfc57ec4a1049442c1d5"},"headline":"Android Project &#8211; Employee Tracker Application","datePublished":"2026-05-02T08:53:27+00:00","mainEntityOfPage":{"@id":"https:\/\/techvidvan.com\/tutorials\/employee-tracker-android-project\/"},"wordCount":844,"commentCount":0,"publisher":{"@id":"https:\/\/techvidvan.com\/tutorials\/#organization"},"image":{"@id":"https:\/\/techvidvan.com\/tutorials\/employee-tracker-android-project\/#primaryimage"},"thumbnailUrl":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2025\/10\/android-employee-tracker-application.webp","keywords":["android employee tracker application","android employee tracking application","android employee tracking system","android project ideas","android projects","android projects for practice","employee tracker using android","employee tracking application using android","employee tracking system using android"],"articleSection":["Android Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/techvidvan.com\/tutorials\/employee-tracker-android-project\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/techvidvan.com\/tutorials\/employee-tracker-android-project\/","url":"https:\/\/techvidvan.com\/tutorials\/employee-tracker-android-project\/","name":"Android Project - Employee Tracker Application - TechVidvan","isPartOf":{"@id":"https:\/\/techvidvan.com\/tutorials\/#website"},"primaryImageOfPage":{"@id":"https:\/\/techvidvan.com\/tutorials\/employee-tracker-android-project\/#primaryimage"},"image":{"@id":"https:\/\/techvidvan.com\/tutorials\/employee-tracker-android-project\/#primaryimage"},"thumbnailUrl":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2025\/10\/android-employee-tracker-application.webp","datePublished":"2026-05-02T08:53:27+00:00","description":"An Android Employee Tracker Application helps organisations in maintaining records and tracking their employees.","breadcrumb":{"@id":"https:\/\/techvidvan.com\/tutorials\/employee-tracker-android-project\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/techvidvan.com\/tutorials\/employee-tracker-android-project\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/techvidvan.com\/tutorials\/employee-tracker-android-project\/#primaryimage","url":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2025\/10\/android-employee-tracker-application.webp","contentUrl":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2025\/10\/android-employee-tracker-application.webp","width":1200,"height":628,"caption":"android employee tracker application"},{"@type":"BreadcrumbList","@id":"https:\/\/techvidvan.com\/tutorials\/employee-tracker-android-project\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/techvidvan.com\/tutorials\/"},{"@type":"ListItem","position":2,"name":"Android Project &#8211; Employee Tracker Application"}]},{"@type":"WebSite","@id":"https:\/\/techvidvan.com\/tutorials\/#website","url":"https:\/\/techvidvan.com\/tutorials\/","name":"TechVidvan Blogs","description":"","publisher":{"@id":"https:\/\/techvidvan.com\/tutorials\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/techvidvan.com\/tutorials\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/techvidvan.com\/tutorials\/#organization","name":"TechVidvan","url":"https:\/\/techvidvan.com\/tutorials\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/techvidvan.com\/tutorials\/#\/schema\/logo\/image\/","url":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2024\/03\/techvidvan-logo-200x50-1.webp","contentUrl":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2024\/03\/techvidvan-logo-200x50-1.webp","width":200,"height":50,"caption":"TechVidvan"},"image":{"@id":"https:\/\/techvidvan.com\/tutorials\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/TechVidvan\/","https:\/\/x.com\/vidvantech"]},{"@type":"Person","@id":"https:\/\/techvidvan.com\/tutorials\/#\/schema\/person\/829765a79c50bfc57ec4a1049442c1d5","name":"TechVidvan Team"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/posts\/447939","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/users\/710"}],"replies":[{"embeddable":true,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/comments?post=447939"}],"version-history":[{"count":5,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/posts\/447939\/revisions"}],"predecessor-version":[{"id":447975,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/posts\/447939\/revisions\/447975"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/media\/447941"}],"wp:attachment":[{"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/media?parent=447939"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/categories?post=447939"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/tags?post=447939"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}