How to create a Stopwatch App using Android Studio
Last Updated :
29 Aug, 2024
In this article, an Android app is created to display a basic Stopwatch. The layout for Stopwatch includes:
- A TextView: showing how much time has passed
- Three Buttons:
- Start: To start the stopwatch
- Stop: To stop the stopwatch
- Reset: To reset the stopwatch to 00:00:00
Step-by-Step Implementation of Stopwatch Application in Android Studio
Step 1: Create a new project for the Stopwatch App
- Create a new Android project for an application named "Stopwatch" with a company domain of "geeksforgeeks.org", making the package name org.geeksforgeeks.stopwatch.
- The minimum SDK should be API 14 so it can run on almost all devices.
- An empty activity called "StopwatchActivity" and a layout called "activity_stopwatch" will be created.
Step 2: Android Manifest
<activity android:name=".StopwatchActivity"></activity>
Step 3: Using Resource Files
Add String resources We are going to use three String values in our stopwatch layout, one for the text value of each button. These values are String resources, so they need to be added to strings.xml.
Add the String values below to your version of strings.xml:
Strings.xml
<resources>
<string name="app_name">GFG|Stopwatch</string>
<string name="start">Start</string>
<string name="stop">Stop</string>
<string name="reset">Reset</string>
</resources>
Update the Stopwatch layout code Here is the XML for the layout. It describes a single text view that's used to display the timer, and three buttons to control the stopwatch. Replace the XML currently in activity_stopwatch.xml with the XML shown here: activity_main.xml
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:padding="16dp">
<TextView
android:id="@+id/tvMainTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Welcome to MainActivity"
android:textSize="18sp"
android:layout_gravity="center_horizontal"
android:paddingBottom="20dp"/>
<Button
android:id="@+id/btnGoToStopwatch"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Go to Stopwatch"
android:layout_gravity="center_horizontal"/>
</LinearLayout>
activity_stopwatch.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"
android:orientation="vertical"
android:background="#0F9D58"
android:padding="16dp"
tools:context=".MainActivity">
<TextView
android:id="@+id/time_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:textAppearance="@android:style/TextAppearance.Large"
android:textSize="56sp" />
<Button
android:id="@+id/start_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="20dp"
android:onClick="onClickStart"
android:text="@string/start" />
<Button
android:id="@+id/stop_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="8dp"
android:onClick="onClickStop"
android:text="@string/stop" />
<Button
android:id="@+id/reset_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="8dp"
android:onClick="onClickReset"
android:text="@string/reset" />
</LinearLayout>
Step 4: How the activity code will work
The layout defines three buttons that we will use to control the stopwatch. Each button uses its onClick attribute to specify which method in the activity should run when the button is clicked. When the Start button is clicked, the onClickStart() method gets called, when the Stop button is clicked the onClickStop() method gets called, and when the Reset button is clicked the onClickReset() method gets called. We will use these methods to start, stop and reset the stopwatch.
We will update the stopwatch using a method we will create called runTimer(). The runTimer() method will run code every second to check whether the stopwatch is running, and, if it is, increment the number of seconds and display the number of seconds in the text view.
To help us with this, we will use two private variables to record the state of the stopwatch. We will use an int called seconds to track how many seconds have passed since the stopwatch started running, and a boolean called running to record whether the stopwatch is currently running.
We will start by writing the code for the buttons, and then we will look at the runTimer() method.
- Add code for the buttons When the user clicks on the Start button, we will set the running variable to true so that the stopwatch will start. When the user clicks on the Stop button, we will set running to false so that the stopwatch stops running. If the user clicks on the Reset button, we will set running to false and seconds to 0 so that the stopwatch is reset and stops running.
- The runTimer() method The next thing we need to do is to create the runTimer() method. This method will get a reference to the text view in the layout; format the contents of the seconds variable into hours, minutes, and seconds; and then display the results in the text view. If the running variable is set to true, it will increment the seconds variable.
- Handlers allow you to schedule code A Handler is an Android class you can use to schedule code that should be run at some point in the future. You can also use it to post code that needs to run on a different thread than the main Android thread. In our case, we are going to use a Handler to schedule the stopwatch code to run every second. To use the Handler, you wrap the code you wish to schedule in a Runnable object, and then use the Handle post() and postDelayed() methods to specify when you want the code to run.
- The post() method The post() method posts code that needs to be run as soon as possible(which is usually immediately). This method takes one parameter, an object of type Runnable. A Runnable object in Androidville is just like a Runnable in plain old Java: a job you want to run. You put the code you want to run in the Runnable's run() method, and the Handler will make sure the code is run as soon as possible.
- The postDelayed() method The postDelayed() method works in a similar way to the post() method except that you use it to post code that should be run in the future. The postDelayed() method takes two parameters: a Runnable and a long. The Runnable contains the code you want to run in its run() method, and the long specifies the number of milliseconds you wish to delay the code by. The code will run as soon as possible after the delay.
Below is the following code to StopwatchActivity.java:
MainActivity.java
package com.gfg.stopwatch_app_java;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.graphics.Insets;
import androidx.core.view.ViewCompat;
import androidx.core.view.WindowInsetsCompat;
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Button btnGoToStopwatch = findViewById(R.id.btnGoToStopwatch);
btnGoToStopwatch.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// Create an Intent to start StopwatchActivity
Intent intent = new Intent(MainActivity.this, StopwatchActivity.class);
startActivity(intent);
}
});
}
}StopwatchActivity.javapackage com.gfg.stopwatch_app_java;
import android.app.Activity;
import android.os.Handler;
import android.view.View;
import android.os.Bundle;
import java.util.Locale;
import android.widget.TextView;
public class StopwatchActivity extends Activity {
// Use seconds, running and wasRunning respectively
// to record the number of seconds passed,
// whether the stopwatch is running and
// whether the stopwatch was running
// before the activity was paused.
// Number of seconds displayed
// on the stopwatch.
private int seconds = 0;
// Is the stopwatch running?
private boolean running;
private boolean wasRunning;
@Override
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_stopwatch);
if (savedInstanceState != null) {
// Get the previous state of the stopwatch
// if the activity has been
// destroyed and recreated.
seconds
= savedInstanceState
.getInt("seconds");
running
= savedInstanceState
.getBoolean("running");
wasRunning
= savedInstanceState
.getBoolean("wasRunning");
}
runTimer();
}
// Save the state of the stopwatch
// if it's about to be destroyed.
@Override
public void onSaveInstanceState(
Bundle savedInstanceState)
{
savedInstanceState
.putInt("seconds", seconds);
savedInstanceState
.putBoolean("running", running);
savedInstanceState
.putBoolean("wasRunning", wasRunning);
}
// If the activity is paused,
// stop the stopwatch.
@Override
protected void onPause()
{
super.onPause();
wasRunning = running;
running = false;
}
// If the activity is resumed,
// start the stopwatch
// again if it was running previously.
@Override
protected void onResume()
{
super.onResume();
if (wasRunning) {
running = true;
}
}
// Start the stopwatch running
// when the Start button is clicked.
// Below method gets called
// when the Start button is clicked.
public void onClickStart(View view)
{
running = true;
}
// Stop the stopwatch running
// when the Stop button is clicked.
// Below method gets called
// when the Stop button is clicked.
public void onClickStop(View view)
{
running = false;
}
// Reset the stopwatch when
// the Reset button is clicked.
// Below method gets called
// when the Reset button is clicked.
public void onClickReset(View view)
{
running = false;
seconds = 0;
}
// Sets the NUmber of seconds on the timer.
// The runTimer() method uses a Handler
// to increment the seconds and
// update the text view.
private void runTimer()
{
// Get the text view.
final TextView timeView
= (TextView)findViewById(
R.id.time_view);
// Creates a new Handler
final Handler handler
= new Handler();
// Call the post() method,
// passing in a new Runnable.
// The post() method processes
// code without a delay,
// so the code in the Runnable
// will run almost immediately.
handler.post(new Runnable() {
@Override
public void run()
{
int hours = seconds / 3600;
int minutes = (seconds % 3600) / 60;
int secs = seconds % 60;
// Format the seconds into hours, minutes,
// and seconds.
String time
= String
.format(Locale.getDefault(),
"%d:%02d:%02d", hours,
minutes, secs);
// Set the text view text.
timeView.setText(time);
// If running is true, increment the
// seconds variable.
if (running) {
seconds++;
}
// Post the code again
// with a delay of 1 second.
handler.postDelayed(this, 1000);
}
});
}
}
Output:
Output of Stopwatch App.
Similar Reads
Android Studio Tutorial It is stated that "If you give me six hours to chop down a tree then I will spend the first four hours in sharpening the axe". So in the Android Development World if we consider Android Development as the tree then Android Studio should be the axe. Yes, if you are starting Android Development then y
9 min read
Basics
How to Install and Set up Android Studio on Windows | Step by Step GuideIf you are starting your Android learning journey, Andriod Studio is the first thing you will install to write code on your system. This article will guide you on how to install and set up Android Studio on Windows 10, and 11 and what the actual Android Studio system requirements are. Quick Brief of
4 min read
Android Studio Main WindowAndroid Studio is the official IDE (Integrated Development Environment) for Android app development and it is based on JetBrainsâ IntelliJ IDEA software. Android Studio provides many excellent features that enhance productivity when building Android apps, such as: A blended environment where one can
4 min read
Different Types of Activities in Android StudioAndroid Studio is the official IDE (Integrated Development Environment) for Android application development and it is based on JetBrains' IntelliJ IDEA software. Android Studio provides many excellent features that enhance productivity when building Android apps, such as: A flexible Gradle-based bui
7 min read
Android | Running your first Android appAfter successfully Setting up an Android project, all of the default files are created with default code in them. Let us look at this default code and files and try to run the default app created. The panel on the left side of the android studio window has all the files that the app includes. Under
3 min read
How to Install Genymotion Emulator and Add itâs Plugin to Android Studio?If you're an Android developer looking for a powerful and efficient emulator, installing the Genymotion emulator might be the perfect solution for you. Known for its speed and reliability, the Genymotion emulator for Android development offers a seamless experience. In this guide, we'll walk you thr
5 min read
How to Install Android Virtual Device(AVD)?In android development, we need an android device to run the application. So, developers of Android Studio provide an option to install android virtual device to run it. In this article, we will learn how to install Android Virtual Device (AVD). Follow the below steps to install Android Virtual Devi
1 min read
File Structure
Android Project folder StructureAndroid Studio is the official IDE (Integrated Development Environment) developed by the JetBrains community which is freely provided by Google for android app development. After completing the setup of Android Architecture we can create an android application in the studio. We need to create a new
3 min read
Android | Android Application File StructureIt is very important to know about the basics of Android Studio's file structure. In this article, some important files/folders, and their significance is explained for the easy understanding of the Android studio work environment. In the below image, several important files are marked: All of the f
4 min read
Android Manifest File in AndroidEvery project in Android includes a Manifest XML file, which is AndroidManifest.xml, located in the root directory of its project hierarchy. The manifest file is an important part of our app because it defines the structure and metadata of our application, its components, and its requirements. This
5 min read
Android | res/values folderThe res/values folder is used to store the values for the resources that are used in many Android projects including features of color, styles, dimensions, etc. In this article, we will learn about the res/values folder. Below explained are a few basic files, contained in the res/values folder: colo
3 min read
Android | build.gradleGradle is a build system (open source) that is used to automate building, testing, deployment, etc. "build.gradle" are script where one can automate the tasks. For example, the simple task of copying some files from one directory to another can be performed by the Gradle build script before the actu
4 min read
Assets Folder in Android StudioIt can be noticed that unlike Eclipse ADT (App Development Tools), Android Studio doesnât contain an Assets folder in which we usually use to keep the web files like HTML. Assets provide a way to add arbitrary files like text, XML, HTML, fonts, music, and video in the application. If one tries to ad
4 min read
Resource Raw Folder in Android StudioThe raw (res/raw) folder is one of the most important folders and it plays a very important role during the development of android projects in android studio. The raw folder in Android is used to keep mp3, mp4, sfb files, etc. The raw folder is created inside the res folder: main/res/raw. So we will
4 min read
Logcat Window in Android StudioLogCat Window is the place where various messages can be printed when an application runs. Suppose, you are running your application and the program crashes, unfortunately. Then, Logcat Window is going to help you to debug the output by collecting and viewing all the messages that your emulator thro
2 min read
Important Tips and Tricks in Android Studio
How to Create/Start a New Project in Android Studio?After successfully installing the Android Studio and opening it for the first time. We need to start with some new projects to start our journey in Android.In this article, we will learn about How to Create a New Project in Android Studio.Steps to Create/Start a New Android Project in Android Studio
2 min read
How to Speed Up Android Studio?A slow Android Studio is a pain in the butt for an android developer. Developing an application with a slow IDE is not a cakewalk. It's also annoying that when you are focusing on the logic building for your app, and you got a kick to work and at that time your android studio suddenly starts lagging
7 min read
How to Upload Project on GitHub from Android Studio?Learning how to upload a project to GitHub from Android Studio is an essential skill for developers, as it allows you to share your code, collaborate with others, and manage version control. With GitHub integration in Android Studio, it's easy to push your project to a repository. This guide will wa
3 min read
How to Convert SVG, PSD Images to Vector Drawable File in Android Studio?In order to use the SVG (Scalable Vector Graphics) or PSD (Photoshop document) image file in your android studio project, you have to first convert them into an XML (Vector Drawable) file. Why XML (Vector Drawable) file? small in sizescalability (It scaled without loss of display quality)height and
3 min read
How to Create Drawable Resource XML File in Android Studio?Prerequisite: Android Project folder Structure A drawable resource is a common concept for a graphic that can be drawn to the screen and which one can retrieve with APIs such as getDrawable(int) or apply to another XML resource with attributes such as android:drawable and android:icon. There are sev
3 min read
How to Add Local HTML File in Android Studio?HTML stands for HyperText Markup Language. It is used to design web pages using a markup language. HTML is the combination of Hypertext and Markup language. Hypertext defines the link between the web pages. A markup language is used to define the text document within the tag which defines the struct
3 min read
How to Import External JAR Files in Android Studio?A JAR (Java Archive) is a package file format typically used to aggregate many Java class files and associated metadata and resources (text, images, etc.) into one file to distribute application software or libraries on the Java platform. In simple words, a JAR file is a file that contains a compres
3 min read
How to Add Different Resolution Images in Android Studio?Android supports a broad range of devices and if one wants to create an application in android then the application must be compatible with the different mobile devices. For supporting the different screen sizes one must have different size images that will save in multiple folders. Normally Android
2 min read
How to Create Classes in Android Studio?In Android during the project development most of the time there is a need for classes in the projects. For example, in the case of CRUD operation, we need a model class to insert and retrieve data. Also to hold the info in our custom view we need to create a getter setter class. So basically in and
3 min read
How to Create Interfaces in Android Studio?Interfaces are a collection of constants, methods(abstract, static, and default), and nested types. All the methods of the interface need to be defined in the class. The interface is like a Class. The interface keyword is used to declare an interface. public interface AdapterCallBackListener { void
4 min read
Frequently Occurring Errors and Solutions
How to Enable Vt-x in BIOS Security Settings in Intel Processors For Android Studio?When a newbie tries to set up the Android Studio for the first time, the users will face this error, and this kind of error normal for the geeky guy or tech guru, But for beginner people, this is a tedious task. Letâs break down all the related words and try to put some light on these techie things.
4 min read
Different Ways to Fix "Error type 3 Error: Activity class {} does not exist" in Android StudioWhenever we try to launch an activity we encounter the error "Error type 3: Activity class {} does not exist" in the Android Studio. The MainActivity Page throws the error as: Error while executing: am start -n âLauncherActivityâ -a android.intent.action.MAIN -c android.intent.category.LAUNCHER Star
3 min read
Different Ways to fix âcannot resolve symbol Râ in Android StudioYou must have encountered the error âCannot resolve symbol Râ many times while building android projects. When you first create a new activity or new class, The R is red and Android Studio says it can't recognize the symbol R. So you may hover over the R symbol, press Alt + Enter to import missing a
3 min read
Different Ways to Fix âSelect Android SDKâ Error in Android StudioAndroid SDK is one of the most useful components which is required to develop Android Applications. Android SDK is also referred to as the Android Software Development Kit which provides so many features which are required in Android which are given below: A sample source code.An Emulator.Debugger.R
5 min read
Different Ways to fix âDefault Activity Not Foundâ Issue in Android StudioThis is the most common issue faced by so many developers when creating a new Android Studio Project. This issue occurs because Android Studio was not able to detect the default MainActivity in your Android Studio Project. In this article, we will take a look at four different ways with which we can
3 min read
Different Ways to fix Cannot resolve symbol 'AppCompatActivity' in Android StudioWhen you create a project and extends activity AppCompatActivity, sometimes you must have observed Android Studio throws an error that is: Cannot resolve symbol 'AppCompatActivity' and this error doesn't go away easily. In this article, we are going to cover topics: why there is a need to solve this
2 min read
Different Ways to fix "Execution failed for task ':app:clean'. Unable to delete file" error in Android StudioWhen you try to rebuild or clean and build your project (containing mostly Kotlin code) in Android Studio, it fails and throws the error: Execution failed for task ':app:clean'. Unable to delete file: SpecificFileLocation So, In this article, we are going to see the topics: why there is a need to so
3 min read
Different Ways to fix "Execution failed for task ':processDebugManifest'" in Android StudioAndroidManifest.xml file is one of the most important files in your Android Project. This file handles all other files in your Android Studio Project and also provides apk name and app logo for the generated apk in Android. Many times while building an Android project our Manifest file gets overwrit
4 min read
Different Ways to fix "DELETE_FAILED_INTERNAL_ERROR" Error while Installing APK in Android StudioIn Android Studio when building a new APK or while installing an application from Android Studio. You will get to see errors as shown in the title such as "DELETE FAILED INTERNAL ERROR". This error is generally due to conflicts in the APK version while installing a new Android app. This is how the e
4 min read
Different Ways to fix "Error running android: Gradle project sync failed" in Android StudioGradle is one of the most important components of Android apps. It handles all the backend tasks and manages all the external dependencies which we will be going to use in building our Android Application. Sometimes due to any issue or after formatting of your pc. Some of the Gradle files may get de
3 min read
Integrating Plugins
How to Install and Uninstall Plugins in Android Studio?Android Studio provides a platform where one can build apps for Android phones, tablets, Android Wear, Android TV, and Android Auto. Android Studio is the official IDE for Android application development, and it is based on the IntelliJ IDEA. One can develop Android Applications using Kotlin or Java
3 min read
Integrating JsonToKotlin Plugin With Android StudioAndroid Studio is the best IDE for android development. Plenty of plugins are available and they can be installed easily via Android Studio itself. In computing, a plug-in is a software component that adds a particular characteristic to an existing computer program. When a program supports plug-ins,
5 min read
Integrating Codeglance Plugin With Android StudioAndroid Studio is the best IDE for android development. Plenty of plugins are available and they can be installed easily via Android Studio itself. In computing, a plug-in is a software component that adds a particular characteristic to an existing computer program. When a program supports plug-ins,
3 min read
How to Use ButterKnifeZelezny X Plugin in Android Studio?Laziness is one of the most powerful properties of a good programmer, most android developers know about JakeWharton's ButterKnife annotation library. Without writing repeated elements like findViewById() and setONClickListner(), we use this library, so it can reduce the developer burden to write th
2 min read
Integrating Key Promoter X Plugin with Android StudioAndroid Studio is the best IDE for android development. Plenty of plugins are available and they can be installed easily via Android Studio itself. A plugin is software written in Java/Kotlin which adds custom features to our Android Studio IDE. The main purpose of installing a plugin is to make the
3 min read
Building Sample Android UI using Android Studio
Building Some Cool Android Apps Using Android Studio
How to create a COVID-19 Tracker Android AppThe world is facing one of the worst epidemics, the outbreak of COVID-19, you all are aware of that. So during this lockdown time let's create a COVID-19 Tracker Android App using REST API which will track the Global Stats only. Step by Step Implementation to Create Covid-19 Tracker Android Applicat
5 min read
Complete guide on How to build a Video Player in AndroidThis article explains the stepwise process as to how to build a Video Player using Android Studio. For viewing videos in android, there is a special class called "Exoplayer". In this article, we will be having 2 videos which are connected by the "Dialog box", i.e. a dialog box will come after comple
5 min read
How to create a Stopwatch App using Android StudioIn this article, an Android app is created to display a basic Stopwatch. The layout for Stopwatch includes: A TextView: showing how much time has passedThree Buttons:Start: To start the stopwatchStop: To stop the stopwatchReset: To reset the stopwatch to 00:00:00Step-by-Step Implementation of Stopwa
8 min read
How to Build a Simple Music Player App Using Android StudioThis is a very simple app suitable for beginners to learn the concepts. The following things you will learn in this article: Implementing MediaPlayer class and using its methods like pause, play and stop. Using external files ( images, audio, etc ) in our project.Building the interface of our Music
5 min read
How to Build a Simple Notes App in Android?Notes app is used for making short text notes, updating when you need them, and trashing when you are done. It can be used for various functions as you can add your to-do list in this app, some important notes for future reference, etc. The app is very useful in some cases like when you want quick a
9 min read
How to build a simple Calculator app using Android Studio?Create a simple calculator which can perform basic arithmetic operations like addition, subtraction, multiplication, or division depending upon the user input. A sample video is given below to get an idea about what we are going to do in this article. Note that we are going to implement this project
6 min read
How to Build a Sticky Notes Application in Android Studio?We as humans tend to forget some small but important things, and to resolve this we try to write those things up and paste them somewhere, we often have eyes on. And in this digital era, the things we are most likely to see are laptop, computer, or mobile phone screens. For this, we all have once us
11 min read
How to Build a Simple Flashlight/TorchLight Android App?All the beginners who are into the android development world should build a simple android application that can turn on/off the flashlight or torchlight by clicking a Button. So at the end of this article, one will be able to build their own android flashlight application with a simple layout. A sam
6 min read
How to Build Spin the Bottle Game Application in Android?In this article, we will be building a Spin the Bottle Game Project using Java/Kotlin and XML in Android. The application is based on a multiplayer game. One player spins the bottle and the direction in which the bottle spins will determine the player who gets selected for a task or any other stuff.
5 min read
Miscellaneous
How to Add OpenCV library into Android Application using Android Studio?OpenCV is the huge open-source library for computer vision, machine learning, and image processing and now it plays a major role in real-time operation which is very important in todayâs systems. By using it, one can process images and videos to identify objects, faces, or even the handwriting of a
3 min read
10 Important Android Studio Shortcuts You Need the MostAndroid Studio is the official integrated development environment (IDE) for Android application development. In this article, some of the most imp shortcuts are explained in Android, with the help of examples. Some of the most important Shortcut keys used in Android Studio are: 1. CTRL + E -> Rec
3 min read
How to Create Your Own Shortcut in Android Studio?Android Studio is the official integrated development environment for Googleâs Android operating system, built on JetBrainsâ IntelliJ IDEA software and designed specifically for Android app development. Android Studio offers a lot of shortcuts to users. It also provides to configure Keymap and add y
2 min read
How to Add Firebase Analytics to Android App in Android Studio?Analytics is one of the important tools that developers should definitely used while building their applications. It is very helpful to target your apps for various audience ranges and to track on which screen the users are spending a long time. So it is one of the important features which one shoul
4 min read
How to Capture a Screenshot and Screen Recording of an Android Device Using Android Studio?Android Studio is the official IDE (Integrated Development Environment) for Android app development and it is based on JetBrainsâ IntelliJ IDEA software. Android Studio provides many excellent features that enhance productivity when building Android apps. Whenever we are developing an app and in tha
2 min read
How to Create a New Branch on GitHub using Android Studio?Creating a new branch on GitHub using Android Studio can help your development workflow by allowing you to work on new features or fixes without affecting the main codebase. In this article, we will walk you through the steps to create a new branch directly from Android Studio and push it to your Gi
2 min read
How to Create a Pull Request on GitHub using Android Studio?Creating a pull request is an important part of collaborating on projects hosted on GitHub. It allows you to propose changes to a repository, enabling others to review, discuss, and merge your changes. Hereâs a step-by-step guide on how to create a pull request on GitHub using Android Studio. Steps
2 min read
Different Ways to Analyze APK Size of an Android App in Android StudioAPK size is one of the most important when we are uploading our app to Google Play. APK size must be considered to be as small as possible so users can visit our app and download our app without wasting so much data. In this article, we will take a look at How we can analyze our APK in Android Studi
3 min read
How to Print to the Console in Android Studio?In computer technology, the console is simply a combination of a monitor and an input device. Generally, the input device is referred to here as the pair of mouse and keyboard. In order to proceed with the topic, we have to understand the terminology of computer science, which is an important part o
6 min read
Android Animation using Android StudioIn today's world which is filled with full of imagination and visualizations, there are some areas that are covered with the word animation. When this word will come to anyoneâs mind they always create a picture of cartoons and some Disney world shows. As we already know that among kids, animation m
5 min read