Java Android App Development Course, Creating an Image Sharing App

Today, we will learn how to create an image sharing app in an Android environment using Java.
This course is for those who have a basic understanding of Android application development.
We will proceed step by step from project setup using Gradle, UI design, to implementing image selection and sharing features.

1. Setting Up the Development Environment

To start the project, you need to install Android Studio.
Android Studio is the official IDE for Android application development and offers various features.
Here’s how to create a project after installing Android Studio.

  1. Open Android Studio and select “New Project”.
  2. Select “Empty Activity” as the template and click the “Next” button.
  3. Set the project name to “ImageSharingApp” and configure the package name and save location as needed.
  4. Select “Java” for the Language and click “Finish” to create the project.

2. UI Configuration

Now let’s configure the user interface of the app.
We will create a simple UI that allows users to select and share images.

2.1 Modifying the Layout File

First, open the res/layout/activity_main.xml file and modify it as follows.

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <Button
        android:id="@+id/button_select_image"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Select Image"
        android:layout_centerHorizontal="true"
        android:layout_marginTop="50dp"/>

    <ImageView
        android:id="@+id/image_view"
        android:layout_width="250dp"
        android:layout_height="250dp"
        android:layout_below="@id/button_select_image"
        android:layout_centerHorizontal="true"
        android:layout_marginTop="20dp"
        android:scaleType="centerCrop"/>

    <Button
        android:id="@+id/button_share"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Share"
        android:layout_below="@id/image_view"
        android:layout_centerHorizontal="true"
        android:layout_marginTop="20dp"/>

</RelativeLayout>

3. Implementing Image Selection Functionality

Let’s add functionality for users to select images in the app.
To do this, we will use an image selection intent.
Open the MainActivity.java file and add the following code.

public class MainActivity extends AppCompatActivity {
    private static final int PICK_IMAGE_REQUEST = 1;

    private ImageView imageView;
    private Button buttonSelectImage, buttonShare;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        imageView = findViewById(R.id.image_view);
        buttonSelectImage = findViewById(R.id.button_select_image);
        buttonShare = findViewById(R.id.button_share);

        buttonSelectImage.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                openFileChooser();
            }
        });
    }

    private void openFileChooser() {
        Intent intent = new Intent();
        intent.setType("image/*");
        intent.setAction(Intent.ACTION_GET_CONTENT);
        startActivityForResult(Intent.createChooser(intent, "Choose an image"), PICK_IMAGE_REQUEST);
    }

    @Override
    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
        super.onActivityResult(requestCode, resultCode, data);
        if (requestCode == PICK_IMAGE_REQUEST && resultCode == RESULT_OK && data != null && data.getData() != null) {
            Uri imageUri = data.getData();
            imageView.setImageURI(imageUri);
        }
    }
}

4. Implementing Image Sharing Functionality

Now it’s time to add a feature that allows users to share the selected image with other apps.
We will add code for the sharing functionality to MainActivity.java.

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        // ... keep the existing code

        buttonShare.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                shareImage();
            }
        });
    }

    private void shareImage() {
        imageView.setDrawingCacheEnabled(true);
        Bitmap bitmap = Bitmap.createBitmap(imageView.getDrawingCache());
        imageView.setDrawingCacheEnabled(false);

        String path = MediaStore.Images.Media.insertImage(getContentResolver(), bitmap, "Title", "Description");
        Uri uri = Uri.parse(path);

        Intent shareIntent = new Intent();
        shareIntent.setAction(Intent.ACTION_SEND);
        shareIntent.putExtra(Intent.EXTRA_STREAM, uri);
        shareIntent.setType("image/jpeg");
        startActivity(Intent.createChooser(shareIntent, "Share the image"));
    }

5. Adding Required Permissions

To use the sharing functionality, storage permissions are required.
Add the following permission to the AndroidManifest.xml file.

<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>

6. Completion and Testing

All implementations are completed.
Now we will test the app to ensure that the image selection and sharing functionalities work correctly.
Click the “Run” button in Android Studio to run the app on an emulator or a real device.

If the app is working correctly, the user can click the “Select Image” button to choose an image, and
click the “Share” button to share the selected image with other apps.

7. Conclusion

Through this tutorial, we learned how to implement image selection and sharing functionality in an Android app using Java.
This feature provides a useful experience for users and is an important element in creating practical apps.
In the future, adding additional features or improving the UI of this app will also be good learning opportunities.

Thank you! In the next tutorial, we will create an app that can be used in real situations by adding even more diverse features.

Java Android App Development Course, Using the App Bar

1. What is AppBar?

AppBar is an essential component that makes up the basic user interface in Android apps. It is typically positioned at the top of the screen, displaying the title of the current screen and providing users with tools to access the app’s main features.
The AppBar in Android is implemented through the Toolbar class. It can include various buttons, logos, menu icons, and more, playing a significant role in enhancing user experience.

2. Basic Components of AppBar

AppBar consists of several components:

  • Title: Displays the title of the current screen.
  • Navigation Icon: An icon that helps users return to the previous screen.
  • Menu Items: Icons that provide additional features.
  • Action Buttons: Buttons that provide frequently used functionalities.

3. Implementing AppBar

This section explains how to actually implement an AppBar. First, create a new project in Android Studio and set up a basic layout for the AppBar.

3.1 Create a New Android Project

1. Open Android Studio and select “New Project”.
2. Select “Empty Activity” and enter the project name.
3. Choose Java as the language and click “Finish”.

3.2 Modify build.gradle File

There is no need to add `Toolbar` in the `build.gradle` file to use AppBar. The AndroidX library is included by default, so just ensure that the required SDK version is checked.

3.3 Modify activity_main.xml

Next, add the AppBar in the `activity_main.xml` file. Refer to the code below:

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout 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">

    <androidx.appcompat.widget.Toolbar
        android:id="@+id/toolbar"
        android:layout_width="match_parent"
        android:layout_height="?attr/actionBarSize"
        android:background="?attr/colorPrimary"
        app:popupTheme="@style/ThemeOverlay.AppCompat.Light" />

    <TextView
        android:id="@+id/textView"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Hello, World!"
        android:layout_below="@id/toolbar"
        android:layout_centerInParent="true" />

</RelativeLayout>

3.4 Write Code in MainActivity.java

Next, add the code related to the AppBar in the MainActivity.java file. Refer to the example below:

package com.example.myapplication;

import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
import androidx.appcompat.widget.Toolbar;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        // Setting up the toolbar
        Toolbar toolbar = findViewById(R.id.toolbar);
        setSupportActionBar(toolbar);
        getSupportActionBar().setTitle("AppBar Example");
    }
}

4. Adding Menu Items

The next step is to add menu items to the AppBar. First, create a menu resource file.

4.1 Create Menu Resource File

1. Right-click the res/menu folder and select “New” > “Menu Resource File”.
2. Name the file `menu_main.xml` and click “OK”.

4.2 Modify menu_main.xml File

<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">

    <item
        android:id="@+id/action_settings"
        android:title="Settings"
        android:orderInCategory="100"
        android:showAsAction="never" />

</menu>

4.3 Add Menu to MainActivity.java

Override the `onCreateOptionsMenu` method to add the newly created menu to the AppBar.

import android.view.Menu;
import android.view.MenuItem;

// Add to MainActivity.java
@Override
public boolean onCreateOptionsMenu(Menu menu) {
    getMenuInflater().inflate(R.menu.menu_main, menu);
    return true;
}

@Override
public boolean onOptionsItemSelected(MenuItem item) {
    int id = item.getItemId();

    if (id == R.id.action_settings) {
        // Action when settings item is clicked
        return true;
    }

    return super.onOptionsItemSelected(item);
}

5. Adding Icons to AppBar

Next, we will add icons to the AppBar so that users can access more features. This section explains how to add and configure icons.

5.1 Add Icon to drawable Folder

Add the icon image to the res/drawable folder.
For example, create a file named `ic_settings.xml` and set it up as follows:

<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
    android:width="24dp"
    android:height="24dp"
    android:viewportWidth="24"
    android:viewportHeight="24">
    <path
        android:fillColor="#FF000000"
        android:pathData="M12,16.5c-1.33,0 -2.48,0.51 -3.41,1.41l-1.59,-1.59c-2.5,2.5 -2.5,6.57 0,9.08s6.57,2.5 9.08,0s2.5,-6.57 0,-9.08l-1.59,1.59C14.48,17.01,13.33,16.5,12,16.5z M12,8.5c1.33,0 2.48,-0.51 3.41,-1.41l1.59,1.59c2.5,-2.5 2.5,-6.57 0,-9.08s-6.57,-2.5 -9.08,0 -2.5,6.57 0,9.08l1.59,-1.59C9.52,8.99,10.67,8.5,12,8.5z"/>
</vector>

5.2 Add Icon to Menu Item

<item
    android:id="@+id/action_settings"
    android:title="Settings"
    android:icon="@drawable/ic_settings"
    android:orderInCategory="100"
    android:showAsAction="ifRoom" />

6. Design and Customizing the AppBar

The AppBar provides default design, but it can be customized as needed.
The following section discusses how to modify the style of the AppBar and additional customization options.

6.1 Modify AppBar Style in styles.xml

<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
    <item name="colorPrimary">#3F51B5</item>
    <item name="colorPrimaryDark">#303F9F</item>
    <item name="colorAccent">#FF4081</item>
    </style>

6.2 Change Colors

To change colors and styles, define colors in res/values/colors.xml and use them in
styles.xml. You can modify the color codes appropriately to change them.

7. Conclusion

Through this tutorial, you learned about the role and implementation of the AppBar in Android app development using Java.
The AppBar is an essential component of the app, providing users with an intuitive interface that enhances their experience.
By customizing the AppBar in various ways, you can improve the overall style and functionality of your app.
Now you have the ability to integrate the AppBar into your app to provide a variety of features.
Continue to practice and add various functionalities to create a more advanced app!

Java Android App Development Course, Launching an App

Android app development is one of the essential skills in the modern era. In particular, Java is a widely used language for Android application development, providing excellent compatibility with the Android framework and various libraries for scalability. This course will explain in detail the process of developing and releasing Android apps using Java.

1. Setting Up the Environment

To develop an app, you must first set up the development environment. Android Studio is the official IDE (Integrated Development Environment) for Android development.

  • Install Android Studio: Download and install Android Studio from Google’s official website.
  • Install Java JDK: Install the Java Development Kit (JDK) to enable Java application development.
  • Configure SDK: Set up the SDK (Software Development Kit) within Android Studio.

2. Creating a Project

This section covers the process of opening Android Studio and creating a new project.

  1. Run Android Studio and click ‘Start a new Android Studio project’.
  2. Select a project template. You may choose ‘Empty Activity’ as the default.
  3. Set the project name, package name, save location, and language (Java), then click ‘Finish’.

3. Designing the User Interface

Now, let’s design the app’s user interface (UI) using XML.


        <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:orientation="vertical">

            <TextView
                android:id="@+id/welcome_text"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="Hello, welcome to Android app development!"/>

            <Button
                android:id="@+id/start_button"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="Get Started"/>

        </LinearLayout>
        

4. Implementing Functionality

Now, we will implement features that interact with the UI through Java code. Let’s add a button click event.


        package com.example.myfirstapp;

        import androidx.appcompat.app.AppCompatActivity;
        import android.os.Bundle;
        import android.view.View;
        import android.widget.Button;
        import android.widget.TextView;

        public class MainActivity extends AppCompatActivity {
            @Override
            protected void onCreate(Bundle savedInstanceState) {
                super.onCreate(savedInstanceState);
                setContentView(R.layout.activity_main);

                final TextView welcomeText = findViewById(R.id.welcome_text);
                Button startButton = findViewById(R.id.start_button);

                startButton.setOnClickListener(new View.OnClickListener() {
                    @Override
                    public void onClick(View v) {
                        welcomeText.setText("Starting the app!");
                    }
                });
            }
        }
        

5. Debugging and Testing

Before launching the app, you need to ensure that all necessary features work properly. You can use the Android Emulator or perform tests on a real device for this purpose.

  • Debugging: Check error messages and use Logcat to resolve issues.
  • Testing: Check how the app functions on various screen sizes and resolutions.

6. Preparing for App Release

Once the app is complete, you need to prepare for its release.

  1. App Signing: To distribute the app on Google Play, you need to sign it. This is an important process for secure app distribution.
  2. Creating a Release Build: Create a release build separate from the debug build. Select ‘Build’ from the Android Studio menu, then choose ‘Build Bundle(s)/APK(s)’.

7. Distributing on Google Play Store

To distribute the app on Google Play, you must follow certain procedures:

  1. Creating a Google Play Developer Account: Sign up for a Google Play Console and create a developer account.
  2. Registering the App: Click ‘Add App’ and fill in various information to register the app.
  3. Uploading the APK: Upload the created release build.
  4. Adding Marketing Images: Add the app icon, screenshots, and description.
  5. Launch: Once all processes are complete, launch the app.

8. Managing App Updates

After launching the app, it requires ongoing updates and management. It’s important to fix bugs and add new features by reflecting user feedback.

Conclusion

Developing Android apps using Java is an interesting and rewarding process. By following several steps, you can release and maintain an app that provides value to users. I hope this course enables you to develop and successfully launch the app you dream of.

Java Android App Development Course, Running the App

Android app development is one of the popular fields for many developers today. In particular, Java is one of the most widely used programming languages for Android app development. In this course, we will explain in detail how to develop and run Android apps using Java. This course will comprehensively cover everything from setting up the Android development environment to creating and running a simple example app.

1. Setting Up the Android Development Environment

To start Android app development, you must first set up the development environment. Officially, install Android Studio, which is provided by Google. Android Studio is an integrated development environment (IDE) for developing Android apps that offers various features to help make development easier.

1.1 Installing Android Studio

  1. Visit the Android Studio website (developer.android.com/studio) and download the installation file.
  2. Run the downloaded file and follow the installation wizard to proceed with the installation.
  3. Once installation is complete, run Android Studio.

1.2 Installing JDK

To develop Android apps, you need the Java Development Kit (JDK). If the JDK is not already installed, you must download and install it from Oracle’s official website.

2. Creating a New Project

Once the development environment is set up, let’s create a new Android project. Please follow the steps below.

  1. Run Android Studio and click ‘New Project’.
  2. Select ‘Empty Activity’ and click the ‘Next’ button.
  3. Choose the project name, package name, project location, and language (Java), then click the ‘Finish’ button.

3. Understanding the App Structure

An Android app consists of multiple files and folders. The main components are as follows:

  • AndroidManifest.xml: A file that defines the app’s metadata. It allows you to configure the app’s components, permissions, API levels, etc.
  • res/: A folder that stores resource files (images, layouts, strings, etc.) used by the app.
  • java/: A folder where Java source files are stored, which is where you implement the main logic of the app.

4. Developing a Simple App

Here, we will create a simple app that displays the message “Hello, Android!” when the button is clicked.

4.1 Setting Up the Layout

First, modify the activity_main.xml file to add a button and a text view. This file is located in the res/layout/ folder. Please enter the following code:

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <TextView
        android:id="@+id/text_view"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Hello!"
        android:layout_centerInParent="true"
        android:textSize="24sp" />

    <Button
        android:id="@+id/button"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Click Me"
        android:layout_below="@id/text_view"
        android:layout_centerHorizontal="true"
        android:layout_marginTop="20dp" />

</RelativeLayout>

4.2 Writing the Java Code

Next, modify the main activity file (MainActivity.java) to handle the button click event. It is located in the java/com.example.yourapp/ folder. Please modify it with the following code:

package com.example.yourapp;

import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
import androidx.appcompat.app.AppCompatActivity;

public class MainActivity extends AppCompatActivity {

    private TextView textView;
    private Button button;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        textView = findViewById(R.id.text_view);
        button = findViewById(R.id.button);

        button.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                textView.setText("Hello, Android!");
            }
        });
    }
}

5. Running the App

Now it’s time to run the app. Please follow the steps below.

  1. Click the “Run” button on the Android Studio toolbar.
  2. Select a virtual device or physical device. If you want to use a virtual device, you need to set up an Android Virtual Device (AVD). If AVD is not installed by default, you can set it up through the AVD Manager.
  3. Once the app is built, it will run on the selected device.

5.1 Setting Up AVD

To set up a virtual device, follow these steps:

  1. Click the “AVD Manager” icon in Android Studio.
  2. Click “Create Virtual Device” and choose the desired device.
  3. Select the system image to use for the selected device.
  4. Click “Finish” to create the virtual device.

6. App Execution Result

If the app runs successfully, clicking the button will display the message “Hello, Android!” in the TextView. This simple app helps you understand the basic flow of Android development.

7. Conclusion

In this course, we covered the start of Android app development using Java. We explained the installation of Android Studio, creating a new project, understanding app structure, developing and running a simple app in a total of 7 steps. Through this process, developers can easily create and run basic apps, and later move on to more complex app development.

Now you have the fundamentals to develop your own apps using Java and Android Studio. In the future, explore various features related to Java and Android development through more extensive exploration.

8. Next Steps: Getting Familiar

To take a step further, it is essential to use various resources to enhance your app. It would be beneficial to explore the following topics:

  • Android UI Components: ListView, RecyclerView, Toolbar, etc.
  • Data Storage: SQLite, Shared Preferences
  • Networking: Retrofit, Volley
  • Multimedia: Camera, audio recording functionality, etc.

All these processes will be important guides to help you grow into a better Android developer.

© 2023 Android Development Education (Author: [Your Name])

Java Android App Development Course, App Configuration File Analysis

One of the most important elements in the process of developing an Android app is the app’s configuration files. In this article, we will analyze the main configuration files used in Android app development and explore how they affect the app’s operation. Android apps are primarily composed of XML format configuration files and Java code, and we will focus on how these two types of files interact.

1. Configuration Files of Android Apps

Configuration files of Android apps can be broadly divided into two categories: manifest files and resource files. These files provide basic information about the app and define various resources such as the app’s UI, strings, images, and more.

1.1. Manifest File (AndroidManifest.xml)

The manifest file is a composite file for Android apps that must contain all the information necessary for the app to function properly. The AndroidManifest.xml file defines the metadata related to the app’s components (activities, services, broadcast receivers, etc.).

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.myapp">

    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:supportsRtl="true"
        android:theme="@style/Theme.MyApp">

        <activity android:name=".MainActivity">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>

    </application>

</manifest>

The code above shows the basic structure of the manifest file. The key elements are as follows:

  • package: Defines the unique package name of the app.
  • application: Specifies the app’s fundamental properties, including icon, theme, label, and more.
  • activity: Defines the activities that the app will use, specifying the main activity and adding an intent filter to start it.

1.2. Resource Files

Resource files define various resources related to the app’s UI and business logic. This includes strings, images, layouts, and styles. Resource files are located within the project’s /res directory and support various resolutions and languages through a folder structure.

1.2.1. String Resources (res/values/strings.xml)

<resources>
    <string name="app_name">My App</string>
    <string name="welcome_message">Welcome!</string>
</resources>

String resources define strings that can be reused in other UI components, which helps avoid hard-coded strings in layout files.

1.2.2. Layout Resources (res/layout/activity_main.xml)

Layout files define the UI of the app. In Android, layouts can be defined in XML format.

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical">

    <TextView
        android:id="@+id/welcome_text"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="@string/welcome_message"/>

    <Button
        android:id="@+id/button"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Button"/>

</LinearLayout>

The layout code above defines a LinearLayout arranged vertically. It contains a TextView and a Button, with the TextView using the welcome_message defined in the string resources.

2. Role of Configuration Files When Running the App

When an Android app is run, the information in the manifest file is interpreted by the system to meet the app’s requirements. The activities defined in the manifest serve as the starting point that determines what UI will be shown when the user launches the app. For instance, when the user clicks the app icon, MainActivity is executed based on the MAIN action and LAUNCHER category set in the manifest file.

Resource files seamlessly connect the information of UI components with the business logic. Layout files define how UI elements are arranged, and these elements can be easily referenced in the code.

3. Comprehensive Example

Now, through a practical example, we will show how the manifest file and resource files actually work. The complete app is structured to display a welcome message to the user and navigate to another page upon button click.

3.1. Manifest File (AndroidManifest.xml)

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.welcomeapp">

    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:supportsRtl="true"
        android:theme="@style/Theme.AppCompat.Light">

        <activity android:name=".MainActivity">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>

        <activity android:name=".SecondActivity"></activity>

    </application>

</manifest>

3.2. String Resources (res/values/strings.xml)

<resources>
    <string name="app_name">Welcome App</string>
    <string name="welcome_message">Welcome!</string>
    <string name="second_activity_title">Second Activity</string>
</resources>

3.3. Main Layout (res/layout/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">

    <TextView
        android:id="@+id/welcome_text"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="@string/welcome_message"/>

    <Button
        android:id="@+id/button"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Next Page"/>

</LinearLayout>

3.4. Second Layout (res/layout/activity_second.xml)

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical">

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="@string/second_activity_title"/>

</LinearLayout>

3.5. MainActivity.java

package com.example.welcomeapp;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
import androidx.appcompat.app.AppCompatActivity;

public class MainActivity extends AppCompatActivity {
    
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        TextView welcomeText = findViewById(R.id.welcome_text);
        Button nextButton = findViewById(R.id.button);

        nextButton.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(MainActivity.this, SecondActivity.class);
                startActivity(intent);
            }
        });
    }
}

3.6. SecondActivity.java

package com.example.welcomeapp;

import android.os.Bundle;
import androidx.appcompat.app.AppCompatActivity;

public class SecondActivity extends AppCompatActivity {
    
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_second);
    }
}

4. Conclusion

Configuration files play a central role in Android app development and are essential for understanding the app’s structure and functionality. The manifest file defines how the app is executed and how the components interact, while the resource files provide the necessary elements to adjust what is presented to the user. Understanding their relationships is key to successful app development.

Although analyzing the configuration files of an Android app can be challenging, I hope this article is helpful. It aims to enhance your understanding of how each component connects to complete the app, leading to more effective app development.