Introduction

Welcome to your first Android application! In this tutorial, we’ll walk through creating a simple “Hello World” app in Android Studio. This is the foundation for all Android development and will introduce you to the basic structure of an Android project.

Prerequisites

Before starting this tutorial, make sure you have:

Video Tutorial

Follow along with this step-by-step video guide:

infoWatch the video for a complete walkthrough, then use the written instructions below as a reference!

Creating a New Project

Launch Android Studio

  1. Open Android Studio
  2. From the welcome screen, click New Project
  3. If you already have a project open, go to FileNewNew Project

Select Project Template

  1. In the “New Project” window, select Empty Activity
  2. Click Next

infoThe Empty Activity template provides a basic activity with minimal code, perfect for learning.

Configure Your Project

Fill in the following details:

  • Name: HelloWorld
  • Package name: com.example.helloworld
  • Save location: Choose your preferred directory
  • Language: Java or Kotlin (your choice)
  • Minimum SDK: API 21 (Android 5.0)

Click Finish when done.

Wait for Gradle Build

Android Studio will now:

  1. Create your project structure
  2. Download necessary dependencies
  3. Build your project

This may take a few minutes on first run.

Understanding the Project Structure

Key Files and Folders

Project Components

  • app/src/main/java/ - Contains your Java/Kotlin code
  • app/src/main/res/ - Contains all resources (layouts, images, strings)
  • app/src/main/AndroidManifest.xml - App configuration and permissions
  • build.gradle - Build configuration files

MainActivity

// Java version - Placeholder
public class MainActivity extends AppCompatActivity {
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
    }
}
// Kotlin version - Placeholder
class MainActivity : AppCompatActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)
    }
}

Layout XML

<!-- activity_main.xml - Placeholder -->
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

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

</androidx.constraintlayout.widget.ConstraintLayout>

Running Your App

Select Your Device

  1. Click the device dropdown in the toolbar
  2. Select your virtual device or connected physical device

Run the Application

  1. Click the Run button (green play icon) or press Shift + F10
  2. Wait for the app to build and deploy
  3. The app will launch on your selected device

View the Result

You should see “Hello World!” displayed on the screen!

Customizing Your Hello World App

Changing the Text

Detailed instructions coming soon from YouTube video transcription

Adding Colors

Detailed instructions coming soon from YouTube video transcription

Common Issues and Solutions

Next Steps

After completing your first Hello World app, you can:

  1. Modify the UI - Change colors, fonts, and layouts
  2. Add user interaction - Implement buttons and click listeners
  3. Learn about Activities - Understand the Android lifecycle
  4. Explore Views and Layouts - Build more complex interfaces
  5. Add tests - Add tests for your code
Video Tutorial

This lecture note will be updated with detailed content transcribed from the YouTube video tutorial. Stay tuned for comprehensive step-by-step instructions with screenshots and code examples!

Additional Resources


infoPractice by creating variations of this app - try different text, colors, and layouts to get comfortable with Android Studio!