Skip to main content
This guide will walk you through creating your first Android project, writing code, and building an APK - all on your Android device.

Prerequisites

Before starting, ensure you have:
  • Completed the installation process
  • Installed Android build tools through the onboarding process
  • Granted necessary storage permissions
  • At least 2GB of free storage space for your project
Android Code Studio requires Android Gradle Plugin (AGP) v7.2.0 or newer. The IDE automatically creates projects with compatible versions.

Creating Your First Project

1

Open Project Wizard

  1. Launch Android Code Studio
  2. On the main screen, tap Create New Project or the + button
  3. The project creation wizard will open
If you already have projects open, access the wizard via File > New > New Project.
2

Select a Template

Choose from several project templates:
  • Empty Activity - Basic activity with minimal UI (recommended for beginners)
  • Basic Activity - Activity with a toolbar and floating action button
  • Bottom Navigation Activity - Three-fragment app with bottom navigation
  • Navigation Drawer Activity - Side navigation drawer with multiple fragments
  • Tabbed Activity - ViewPager-based tabbed interface
  • Compose Empty Activity - Jetpack Compose-based activity
  • Native C++ Activity - Activity with C++ JNI support
  • No Activity - Empty project with no default activity
For this guide, select Empty Activity and tap Next.
3

Configure Your Project

Fill in the project details:
  • Name: Enter your app name (e.g., “My First App”)
  • Package name: Enter a unique package name (e.g., “com.example.myfirstapp”)
  • Save location: Choose where to save your project (default: /sdcard/AndroidCodeStudio/projects/)
  • Language: Select Kotlin or Java
  • Minimum SDK: Choose minimum Android version (API 21+ recommended)
  • Use AndroidX: Keep this enabled (recommended)
The package name must be unique and follow Java naming conventions (e.g., com.company.app). It cannot be changed after project creation.
Tap Finish to create your project.
4

Wait for Project Initialization

Android Code Studio will:
  1. Generate project structure and files
  2. Create Gradle build scripts
  3. Configure project dependencies
  4. Perform initial Gradle sync
This process takes 2-5 minutes on first project creation. Subsequent projects initialize faster.
The first Gradle sync downloads required dependencies and may take longer depending on your internet speed.

Understanding Project Structure

After project creation, you’ll see the following structure:
MyFirstApp/
├── app/
│   ├── src/
│   │   ├── main/
│   │   │   ├── java/com/example/myfirstapp/
│   │   │   │   └── MainActivity.kt
│   │   │   ├── res/
│   │   │   │   ├── layout/
│   │   │   │   │   └── activity_main.xml
│   │   │   │   ├── values/
│   │   │   │   │   ├── strings.xml
│   │   │   │   │   ├── colors.xml
│   │   │   │   │   └── themes.xml
│   │   │   │   └── drawable/
│   │   │   └── AndroidManifest.xml
│   │   └── androidTest/
│   └── build.gradle.kts
├── gradle/
├── build.gradle.kts
└── settings.gradle.kts

Key Files

  • MainActivity.kt - The main activity class
  • activity_main.xml - The main layout file
  • AndroidManifest.xml - App configuration and permissions
  • build.gradle.kts - Module-level build configuration
  • strings.xml - String resources for localization

Editing Your First Activity

Let’s modify the default activity to display a custom message.
1

Open MainActivity

  1. In the project tree, expand app > src > main > java
  2. Navigate to your package (e.g., com.example.myfirstapp)
  3. Tap MainActivity.kt to open it in the editor
You’ll see code like this:
MainActivity.kt
package com.example.myfirstapp

import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import com.example.myfirstapp.databinding.ActivityMainBinding

public class MainActivity : AppCompatActivity() {

    private var _binding: ActivityMainBinding? = null
    
    private val binding: ActivityMainBinding
      get() = checkNotNull(_binding) { "Activity has been destroyed" }
    
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)

        // Inflate and get instance of binding
        _binding = ActivityMainBinding.inflate(layoutInflater)

        // set content view to binding's root
        setContentView(binding.root)
    }
    
    override fun onDestroy() {
        super.onDestroy()
        _binding = null
    }
}
Android Code Studio uses View Binding by default, which provides type-safe access to views without findViewById().
2

Edit the Layout

  1. Open res > layout > activity_main.xml
  2. You’ll see the XML layout in the editor
  3. Android Code Studio provides both XML editing and visual UI designer
The default layout contains a TextView:
activity_main.xml
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    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:textSize="18sp"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent" />

</androidx.constraintlayout.widget.ConstraintLayout>
Tap the Designer tab at the top to switch to the visual UI designer for drag-and-drop layout editing.
3

Use the UI Designer (Optional)

Android Code Studio includes a powerful UI designer:
  1. Tap the Designer tab
  2. Drag widgets from the palette onto the canvas
  3. Adjust properties in the attributes panel
  4. Add constraints by dragging connection points
Features:
  • Live layout preview
  • Drag & drop interface
  • Visual attribute editor
  • Resource value auto-completion
  • Real-time constraint visualization

Adding Functionality

Let’s add a button that shows a toast message when clicked.
1

Update the Layout

Add a Button to activity_main.xml:
activity_main.xml
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    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:textSize="18sp"
        app:layout_constraintBottom_toTopOf="@+id/button"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent" />

    <Button
        android:id="@+id/button"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Click Me"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@+id/text_view" />

</androidx.constraintlayout.widget.ConstraintLayout>
2

Add Click Listener

Update MainActivity.kt to handle button clicks:
MainActivity.kt
package com.example.myfirstapp

import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.widget.Toast
import com.example.myfirstapp.databinding.ActivityMainBinding

public class MainActivity : AppCompatActivity() {

    private var _binding: ActivityMainBinding? = null
    
    private val binding: ActivityMainBinding
      get() = checkNotNull(_binding) { "Activity has been destroyed" }
    
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        _binding = ActivityMainBinding.inflate(layoutInflater)
        setContentView(binding.root)
        
        // Add click listener to button
        binding.button.setOnClickListener {
            Toast.makeText(
                this,
                "Button clicked!",
                Toast.LENGTH_SHORT
            ).show()
        }
    }
    
    override fun onDestroy() {
        super.onDestroy()
        _binding = null
    }
}
View Binding automatically generates binding classes with properties for each view ID in your layout, providing null-safe and type-safe view access.

Building Your Project

1

Save All Files

Ensure all your changes are saved by tapping the Save All button or using Ctrl+S.
2

Start the Build

Initiate a build in one of these ways:
  • Tap the Build menu and select Build APK
  • Tap the Run button (▶) in the toolbar
  • Use the keyboard shortcut Ctrl+B
The first build takes longer (5-10 minutes) as Gradle downloads dependencies. Subsequent builds are much faster thanks to caching.
3

Monitor Build Progress

The build panel at the bottom shows:
  • Gradle sync status
  • Compilation progress
  • Task execution details
  • Warnings and errors
You can view detailed logs by expanding the build output panel.
If the build fails, carefully read the error messages. Common issues include missing dependencies, syntax errors, or incorrect AGP versions.
4

Build Success

When the build completes successfully:
  1. You’ll see “BUILD SUCCESSFUL” in the build output
  2. The APK is generated in app/build/outputs/apk/debug/
  3. A notification appears with options to install or share
Tap Install to install the APK on your device.

Running Your App

1

Install the APK

After a successful build:
  1. Tap the Install notification
  2. Grant installation permission if prompted
  3. Wait for installation to complete
2

Launch Your App

  1. Open your app drawer
  2. Find “My First App” (or your chosen name)
  3. Tap to launch
  4. Test the button functionality
3

View Logs

To debug your running app:
  1. Open the Logcat panel in Android Code Studio
  2. Filter logs by your package name
  3. View real-time logs as your app runs
  4. Identify errors or unexpected behavior
Use Log.d(), Log.i(), and Log.e() in your code to add custom log messages for debugging.

Using Code Features

Android Code Studio provides powerful code editing features:

Code Completion

  • Type to see intelligent suggestions
  • Auto-complete class names, methods, and variables
  • Resource value auto-completion in XML
  • Import suggestions for unresolved symbols
Press Ctrl+Space to manually trigger code completion at any time.

Language Servers

Android Code Studio includes language servers for:
  • Java - Full Java language support with syntax checking
  • Kotlin - Kotlin language features and analysis
  • XML - XML validation and resource resolution
These provide real-time error checking, code navigation, and refactoring support.

Code Navigation

  • Go to Definition - Long-press a symbol and select “Go to Definition”
  • Find References - Find all usages of a class, method, or variable
  • File Search - Quickly search for files by name (Ctrl+P)
  • Symbol Search - Search for classes and methods (Ctrl+Shift+N)

Git Integration

Android Code Studio has built-in Git support:
  1. Initialize a repository: VCS > Enable Version Control
  2. Commit changes: VCS > Commit
  3. View diff: Compare current changes with last commit
  4. Branch management: Create, switch, and merge branches
Git operations can also be performed via the integrated terminal using standard Git commands.

AI-Powered Assistance

Android Code Studio includes an AI Agent that understands your project:
  1. Tap the AI Assistant button in the toolbar
  2. Ask questions about your code or request help
  3. The AI analyzes your project structure and provides context-aware suggestions
  4. Use it for debugging, code generation, and learning
Example queries:
  • “How do I add a RecyclerView to my activity?”
  • “Why is my button not responding to clicks?”
  • “Generate a data class for a user profile”
The AI Agent is project-aware and understands your specific code structure, making it more helpful than generic AI assistants.

Next Steps

Now that you’ve created and built your first Android app, explore these features:

Additional Tools

  • Asset Studio - Create icons and drawables
  • UI Designer - Visually design complex layouts
  • Terminal - Access full command-line tools
  • SDK Manager - Manage Android SDK components via terminal
  • Plugin Creator - Create sub-modules in your project

Advanced Templates

Try other project templates:
// Includes a toolbar and floating action button
public class MainActivity : AppCompatActivity() {
    
    private var _binding: ActivityMainBinding? = null
    
    private val binding: ActivityMainBinding
      get() = checkNotNull(_binding) { "Activity has been destroyed" }
    
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        _binding = ActivityMainBinding.inflate(layoutInflater)
        setContentView(binding.root)
        
        setSupportActionBar(binding.toolbar)
        
        binding.fab.setOnClickListener {
            Toast.makeText(this@MainActivity, "Replace with your action", Toast.LENGTH_SHORT).show()
        }
    }
    
    override fun onDestroy() {
        super.onDestroy()
        _binding = null
    }
}

Learning Resources

Remember that Android Code Studio requires Android Gradle Plugin v7.2.0 or newer. If you’re importing an existing project with an older AGP version, you’ll need to migrate it first.

Troubleshooting

Build Failures

If your build fails:
  1. Check the error message in the build output
  2. Ensure you have sufficient storage space
  3. Try Build > Clean Project then rebuild
  4. Verify your internet connection for dependency downloads
  5. Check that your project uses AGP 7.2.0+

Slow Performance

To improve performance:
  • Close unused files in the editor
  • Disable unused language servers in settings
  • Reduce the number of open projects
  • Clear Gradle cache if builds are slow: ./gradlew clean

Installation Issues

If the built APK fails to install:
  • Uninstall previous versions of your app
  • Check if storage is full
  • Verify the APK is not corrupted
  • Ensure you have installation permissions
For more detailed troubleshooting, check the Installation Guide or ask in the community Telegram group.

Build docs developers (and LLMs) love