HelloWorldApp is a basic Android application designed to display a simple "Hello, World!" message on the screen. This project serves as an introductory example for beginners starting with Android development, covering essential concepts like activity lifecycle, XML layouts, UI components, and basic project structure.
✔ Simple UI Displays a clear, centered message: “Hello, World!”
✔ Beginner-Friendly Provides a clean and minimal codebase ideal for learning Android development basics.
✔ Activity Lifecycle Introduces the concept of an Activity (MainActivity.java) as the main entry point.
✔ XML Layout Shows how the UI is created using Android’s XML layout system.
✔ Easy to Modify You can change the text message, styling, colors, or add more controls easily.
Minimum SDK: API 21 (Android 5.0 Lollipop)
Target SDK: API 33+
Programming Language: Java 8 or higher
Development Environment: Android Studio (recommended)
The project follows a standard Android application format:
HelloWorldApp/ ├── app/ │ ├── src/ │ │ ├── main/ │ │ │ ├── java/com/example/helloworldapp/MainActivity.java // Main logic │ │ │ ├── res/layout/activity_main.xml // UI layout │ │ │ ├── AndroidManifest.xml // App manifest
1. Create or Import the Project Open Android Studio
Select New Project → Empty Activity
Enter:
Application Name: HelloWorldApp
Package Name: com.example.helloworldapp
2. Sync with Gradle
Android Studio will automatically sync, or click: File → Sync Project with Gradle Files
3. Build & Run
-Connect an Android device OR launch an emulator
-Press the Run (▶) button
-The app will install and display "Hello, World!"
Once launched, the app shows: 📍 A centered “Hello, World!” message on a clean white screen.
This is the most basic Android application and serves as the starting point for building more complex apps.
This file contains the logic that displays the layout and acts as the entry point to the application.
MainActivity.java (Java) package com.example.helloworldapp;
import android.os.Bundle; import androidx.appcompat.app.AppCompatActivity;
/**
-
MainActivity is the primary entry point of the HelloWorldApp.
-
It loads the layout and displays the "Hello, World!" message. */ public class MainActivity extends AppCompatActivity {
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState);
// Set the UI layout for this Activity. setContentView(R.layout.activity_main);} }
This file defines the visual interface shown to the user.
<TextView
android:id="@+id/helloText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Hello, World!"
android:textSize="24sp"
android:textColor="#000000" />
Includes application configuration, theme, and activity declaration.
<activity
android:name=".MainActivity"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
-Scenario Expected Output -Launch app “Hello, World!” displayed in center ✔ -Rotate device Layout adjusts automatically ✔ -App in background & resume Message remains visible ✔ -App restart Loads message instantly ✔
You can extend this project by:
🎨 Changing text size, color, or font
🌈 Adding background images or gradients
🔘 Adding buttons, inputs, or navigation
🌐 Moving to multi-screen apps using Activities/Fragments
💬 Adding user interaction events
🛠 Switching to Kotlin for modern development
Feel free to customize, fork, or improve this project. Pull requests are welcome!
This project is open-sourced under the MIT License.