Basic App using Android Studio: create new android project, write message and run, understanding different components

You create an app in Android Studio by choosing a template (Empty Activity), naming it and setting the package and minimum SDK; the generated project has a fixed shape (manifest, Java, res/layout, res/values, Gradle files) and pressing Run builds it and launches it on the emulator.

9 min read · 9 cards · 2 checks

Read in: English · हिन्दी · ગુજરાતી


Theory

From nothing to 'Welcome' on screen

You are ready to make FestConnect Mobile real. In Android Studio a new project is not one file, it is a whole folder of files with fixed roles, generated for you from a template.

This lesson does two things: walk the few clicks to create the project and run it, then tour the components Studio generated, because knowing what each folder is for is how you find where to add your code, and a very common exam question.

Theory

A flat-pack house arrives labelled

Creating a project is like receiving a flat-pack house with every part in a labelled box: 'wiring plan' (manifest), 'room logic' (Java), 'room layouts' (res/layout), 'paint and text' (res/values), 'assembly instructions' (Gradle). You do not start from raw timber; you get a working shell and then customise the labelled parts. Learn the labels once and you always know where to reach.

Follow along

Create and run FestConnect Mobile

  1. New Project File > New > New Project, choose the Empty Views Activity template.
  2. Configure it app name FestConnect, package com.college.festconnect, language Java, minimum SDK (e.g. API 24).
  3. Let Gradle build Studio generates the project and Gradle downloads dependencies and compiles it.
  4. Write a message edit the TextView's android:text (or a string in res/values/strings.xml) to 'Welcome to FestConnect'.
  5. Press Run the green play button builds the app and installs it on your AVD, where the message appears.

At a glance

What the generated components are for

ComponentHolds
AndroidManifest.xmlapp declaration, activities, permissions
java/ (your package)Activity classes (behaviour)
res/layout/XML layouts (appearance)
res/values/strings, colors, themes
build.gradlebuild config and dependencies

Think first

Where does the text belong?

You want the welcome message to be reusable and translatable, not hard-coded in the layout. Which component should hold the actual text 'Welcome to FestConnect', and how does the layout use it?

Show the answer

Put the text in res/values/strings.xml as a named string, for example <string name="welcome">Welcome to FestConnect</string>. The layout then references it with android:text="@string/welcome" instead of a literal. This keeps text in one place (easy to change) and makes translation possible (a separate strings file per language). Hard-coding text in the layout works but is discouraged and often flagged in reviews.

Quiz

Which tool actually compiles your Android project and assembles the installable app?

  1. Gradle, the build system Android Studio runs
  2. AndroidManifest.xml, which builds the app
  3. The AVD, which compiles the code
  4. res/values/strings.xml, which links the classes
Show the answer

Gradle, the build system Android Studio runs

Gradle is Android's build system; Studio invokes it to compile your Java, process resources, and package the APK (A). The manifest only declares the app's parts, it does not build them (B). The AVD is the virtual device that runs the finished app, not a compiler (C). strings.xml just holds text resources (D). When a build fails, it is usually a Gradle message you read.

Watch out

First-project traps

1. Hard-coding strings in the layout: put user-facing text in strings.xml so it is reusable and translatable.

2. Confusing where code goes: behaviour in java/, appearance in res/layout/, declarations in the manifest. Editing the wrong file is a classic beginner loop.

3. Ignoring Gradle errors: a red build almost always has a specific Gradle message; read it rather than randomly changing files.

Theory

Next: the manifest and R.java in depth

Two generated pieces deserve their own lesson: the AndroidManifest.xml, which every app must have and which declares each Activity, and R.java, the auto-generated file that turns your resource ids (@+id/title, @string/welcome) into the R. references your Java uses. The next lesson opens both.

Summary

Key takeaways

  • Create an app via New Project > Empty Views Activity, setting name, package, language, and minimum SDK.
  • The generated project has fixed components: AndroidManifest.xml, java/ (Activities), res/layout/ (XML), res/values/ (strings/colors), and Gradle build files.
  • Gradle is the build system that compiles the code and assembles the installable app.
  • Press Run (green play) to build and deploy to the AVD, where your message appears.
  • Keep user-facing text in strings.xml, not hard-coded in the layout.
  • Memory hook: a flat-pack house with every part labelled.

Study this properly

This page is the lesson to read. In Gri-Learn the same topic is a graded deck: the self-checks are scored and your weak topics are tracked. Free to start.

Start this topic

Already have an account? Sign in

More from Creating basic App

Gri-Learn · syllabus-mapped B.C.A. lessons in English, Hindi and Gujarati

Basic App using Android Studio: create new android project, write message and run, understanding different components · Mobile Application Development - 1 (option B) · Gri-Learn