Guozhen AIGlobal AI field notes and model intelligence

English translation

Setting Up the Android Development Environment and Creating Your First App Project

Published:

Category: Android Development

Read time: 3 min

Reads: 0

Lesson #6Views are counted together with the original Chinese articleImages are preserved from the source page

AI Article Decision Snapshot

Turn the lesson into workflow, model, budget, and security checks before choosing tools.

Use this quick snapshot before leaving the article. It keeps the next search tied to practical AI software, model/API, cost, privacy, and implementation questions.

Workflow fit

Identify the real job behind the article: coding, research, document review, support, analytics, content, or internal automation.

Model or tool decision

Decide whether the next step is a software shortlist, an AI tool comparison, an API platform choice, or a model benchmark.

Budget and usage signal

Estimate seats, API calls, prompt volume, retries, review time, and fallback work before assuming the workflow is cheap.

Security and privacy review

Check whether source code, customer data, private documents, prompts, logs, or embeddings will enter the AI workflow.

After configuring the Android SDK, we will now create our first Android application project. This process will help you become familiar with using the development environment and understanding the basic project structure. This article will guide you step-by-step through creating a simple “Hello World” application.

1. Launch Android Studio

First, ensure that Android Studio is installed on your system. Launch Android Studio, and you’ll see the welcome screen. Select “Start a new Android Studio project” to begin creating a new project.

2. Choose a Project Template

In the “Choose your Project” screen, you’ll see several project templates. For this tutorial, select the “Empty Activity” template — it provides the minimal foundation for building a simple app.

3. Configure Your Project

In the “Configure your project” screen, enter the following information:

  • Name: Enter your app’s name—for example, HelloWorld.
  • Package name: By default, this is auto-generated based on your app name—for example, com.example.helloworld.
  • Save location: Choose the folder where you’d like to save your project.
  • Language: Select your preferred programming language. We recommend either Java or Kotlin; in this guide, we’ll use Java.
  • Minimum API level: Choose the lowest Android API level your app will support. We recommend API 21: Android 5.0 (Lollipop) as a practical minimum.

Once all fields are filled, click “Finish” to complete project creation.

4. Understand the Project Structure

After creation, Android Studio opens your new project. You’ll see several key directories and files:

  • app/src/main/java/: Contains your app’s Java source code.
  • app/src/main/res/: Contains your app’s resources—such as layouts (layout/), images (drawable/), strings (values/), etc.
  • app/src/main/AndroidManifest.xml: The app’s configuration file, declaring essential metadata and components (e.g., activities, permissions).

5. Edit the Layout File

Navigate to app/src/main/res/layout/ and locate the activity_main.xml file. Open it and define the UI layout using XML. Replace its contents with the following to display “Hello World” centered on screen:

<?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 World"
        android:layout_centerInParent="true"
        android:textSize="24sp"/>
</RelativeLayout>

Here, we use a TextView to display the text “Hello World”, centered within its parent container.

6. Modify the Java Code

Next, open the MainActivity.java file and ensure its content matches the following:

package com.example.helloworld;

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

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

This code declares MainActivity as a subclass of AppCompatActivity. In the onCreate() method, it calls setContentView() to inflate and display the layout defined in activity_main.xml.

7. Run the App

You’ve now completed the basic app setup. Ensure your Android Virtual Device (AVD) is running—or that a physical Android device is connected and properly configured for development. Click the green “Run” button in the toolbar, then select your target device. Android Studio will compile the app and launch it automatically.

You should see a screen displaying “Hello World”—a clear sign that your first Android app project has been successfully created and executed.

8. Summary

In this chapter, after completing the development environment setup, we created a simple Android app project and explored its fundamental structure—including how to edit layout files. In the next chapter, we’ll dive into essential Java fundamentals to lay a solid foundation for robust Android application development. Keep learning—and let’s build more sophisticated apps together!

Apply This Lesson

Turn this article into AI software, model, API, and security decisions.

English Article FAQ

Use this article as evidence before choosing AI tools

How should I use this AI Tutorials article?

Use it as the implementation or learning layer, then connect the idea to AI software buyer guides, tool comparisons, benchmarks, API choices, and security checks before making a production decision.

Is this English article different from the Chinese original?

The English edition is localized for global AI readers while preserving the original diagrams, screenshots, prompts, code examples, and source context from the Chinese article.

What should I read after Setting Up the Android Development Environment and Creating Your First App Project?

Continue with AI Software Buyer Guides, AI Tools Workbench, Best AI Coding Agents, AI Model Benchmarks, OpenAI vs Anthropic API, or LLM Security Tools depending on the decision you need to make.

Can this article alone choose an AI product or model?

No. Treat the article as evidence and context, then validate fit with pricing, privacy requirements, integration effort, benchmark results, workflow tests, and fallback planning.

Continue

Keep reading from here

Browse English site

Reader Messages

Reader messages

Questions, corrections, extra sources, or hands-on results can be left here. No login is required.

Max 800 characters

To reduce spam, each message is checked for length, link count, and posting frequency.

0/800

Messages

0 messages
Loading messages...