{"id":61,"date":"2026-10-06T07:07:54","date_gmt":"2026-10-06T07:07:54","guid":{"rendered":"https:\/\/moiks.com\/blog\/?p=61"},"modified":"2026-11-06T08:48:47","modified_gmt":"2026-11-06T08:48:47","slug":"android-studio-project-structure-explained-for-beginners","status":"publish","type":"post","link":"https:\/\/moiks.com\/blog\/android-studio-project-structure-explained-for-beginners\/","title":{"rendered":"Android Studio Project Structure Explained for Beginners"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">In the previous tutorial, we created our <strong>first Android application using Kotlin and Jetpack Compose<\/strong>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Android Studio automatically generated several folders and files for us.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If you&#8217;re new to Android development, names such as <code>app<\/code>, <code>manifests<\/code>, <code>java<\/code>, <code>kotlin<\/code>, <code>res<\/code>, <code>build.gradle.kts<\/code>, <code>minSdk<\/code>, and <code>targetSdk<\/code> can initially look confusing.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In this tutorial, we&#8217;ll understand the <strong>Android Studio project structure step by step<\/strong> and learn what the most important files and folders are used for.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You don&#8217;t need to memorize everything immediately. The goal is to understand where the important parts of an Android application live.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">What You&#8217;ll Learn<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">In this tutorial, we&#8217;ll cover:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Android Studio project structure<\/li>\n\n\n\n<li>Project and app modules<\/li>\n\n\n\n<li><code>MainActivity.kt<\/code><\/li>\n\n\n\n<li>Kotlin source files<\/li>\n\n\n\n<li><code>AndroidManifest.xml<\/code><\/li>\n\n\n\n<li>Resources folder<\/li>\n\n\n\n<li>Drawable resources<\/li>\n\n\n\n<li>App icons<\/li>\n\n\n\n<li>String resources<\/li>\n\n\n\n<li>Theme resources<\/li>\n\n\n\n<li>Gradle build files<\/li>\n\n\n\n<li>Dependencies<\/li>\n\n\n\n<li><code>namespace<\/code><\/li>\n\n\n\n<li><code>applicationId<\/code><\/li>\n\n\n\n<li><code>minSdk<\/code><\/li>\n\n\n\n<li><code>targetSdk<\/code><\/li>\n\n\n\n<li><code>compileSdk<\/code><\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Let&#8217;s start by looking at the overall structure.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\">Android Studio Project Structure<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">A simple Android project may conceptually look like this:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>MyFirstApp\n\u2502\n\u251c\u2500\u2500 app\n\u2502   \u251c\u2500\u2500 manifests\n\u2502   \u2502   \u2514\u2500\u2500 AndroidManifest.xml\n\u2502   \u2502\n\u2502   \u251c\u2500\u2500 kotlin + java\n\u2502   \u2502   \u2514\u2500\u2500 com.example.myfirstapp\n\u2502   \u2502       \u251c\u2500\u2500 MainActivity.kt\n\u2502   \u2502       \u2514\u2500\u2500 ui.theme\n\u2502   \u2502\n\u2502   \u251c\u2500\u2500 res\n\u2502   \u2502   \u251c\u2500\u2500 drawable\n\u2502   \u2502   \u251c\u2500\u2500 mipmap\n\u2502   \u2502   \u251c\u2500\u2500 values\n\u2502   \u2502   \u2514\u2500\u2500 xml\n\u2502   \u2502\n\u2502   \u2514\u2500\u2500 build.gradle.kts\n\u2502\n\u251c\u2500\u2500 Gradle Scripts\n\u2502\n\u2514\u2500\u2500 settings.gradle.kts<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The exact files displayed can vary depending on your Android Studio version, project template, and project configuration.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Don&#8217;t worry if your project doesn&#8217;t look exactly the same.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\">What is a Module?<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">Android projects are organized into <strong>modules<\/strong>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">When we created our first application, Android Studio created a module called:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>app<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The <code>app<\/code> module contains the main Android application.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You can think of it like this:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Android Project\n      \u2193\n   app module\n      \u2193\nApplication code + resources + configuration<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Small applications may contain only one <code>app<\/code> module.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Larger Android projects can contain multiple modules.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For example:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>MyApp\n\u2502\n\u251c\u2500\u2500 app\n\u251c\u2500\u2500 core\n\u251c\u2500\u2500 data\n\u251c\u2500\u2500 domain\n\u251c\u2500\u2500 feature-home\n\u2514\u2500\u2500 feature-profile<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Multi-module architecture is an advanced topic that we&#8217;ll cover much later.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For now, we&#8217;ll work mainly inside the <code>app<\/code> module.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\">Understanding the app Module<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">Expand the <code>app<\/code> module in Android Studio.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You&#8217;ll see several important sections.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Typically, these include:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>manifests\nkotlin + java\nres<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Each has a different responsibility.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\">The Kotlin Source Folder<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">The Kotlin source section contains our application&#8217;s Kotlin code.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For our example project, you may see something similar to:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>com.example.myfirstapp<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Inside this package, you&#8217;ll find:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>MainActivity.kt<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">This is the file we worked with in the previous tutorial.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\">What is MainActivity.kt?<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\"><code>MainActivity.kt<\/code> contains our application&#8217;s main Activity.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">A simplified example looks like:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>class MainActivity : ComponentActivity() {\n\n    override fun onCreate(savedInstanceState: Bundle?) {\n        super.onCreate(savedInstanceState)\n\n        setContent {\n            MyFirstAppTheme {\n                WelcomeScreen()\n            }\n        }\n    }\n}<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The Activity acts as an entry point for displaying our application UI.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Our flow looks like:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>MainActivity\n     \u2193\nonCreate()\n     \u2193\nsetContent()\n     \u2193\nJetpack Compose UI<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">We&#8217;ll explore the Android Activity lifecycle in a dedicated tutorial.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\">What is a Package?<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">Our Kotlin files live inside a package.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For example:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>com.example.myfirstapp<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Packages help organize code and prevent naming conflicts.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">As our application grows, we might organize our code into packages such as:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>com.example.myfirstapp\n\n\u251c\u2500\u2500 ui\n\u251c\u2500\u2500 data\n\u251c\u2500\u2500 domain\n\u251c\u2500\u2500 navigation\n\u2514\u2500\u2500 utils<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Later, when we learn architecture, we&#8217;ll organize our application more professionally.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\">Understanding the ui.theme Package<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">A Compose project usually contains a theme package.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You may see files such as:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Color.kt\nTheme.kt\nType.kt<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">These files define the visual theme of your application.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For example:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ui.theme\n\u2502\n\u251c\u2500\u2500 Color.kt\n\u251c\u2500\u2500 Theme.kt\n\u2514\u2500\u2500 Type.kt<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">They can control things such as:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Colors<\/li>\n\n\n\n<li>Typography<\/li>\n\n\n\n<li>Light theme<\/li>\n\n\n\n<li>Dark theme<\/li>\n\n\n\n<li>Material Design configuration<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">We&#8217;ll learn how to customize <strong>Material 3 themes<\/strong> later in the Jetpack Compose series.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\">AndroidManifest.xml<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">Another important file is:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>AndroidManifest.xml<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">You&#8217;ll find it under the manifest section of the app module.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The Android Manifest provides important information about your application to the Android system.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">A simplified manifest might look like:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;manifest&gt;\n\n    &lt;application&gt;\n\n        &lt;activity\n            android:name=\".MainActivity\"\n            android:exported=\"true\"&gt;\n\n        &lt;\/activity&gt;\n\n    &lt;\/application&gt;\n\n&lt;\/manifest&gt;<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The actual generated manifest will contain additional configuration.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\">What is AndroidManifest.xml Used For?<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">The manifest can declare important application components and configuration, including:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Activities<\/li>\n\n\n\n<li>Services<\/li>\n\n\n\n<li>Broadcast Receivers<\/li>\n\n\n\n<li>Content Providers<\/li>\n\n\n\n<li>Permissions<\/li>\n\n\n\n<li>Application configuration<\/li>\n\n\n\n<li>Intent filters<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">For example, if an application needs internet access, it can declare:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;uses-permission android:name=\"android.permission.INTERNET\" \/&gt;<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Don&#8217;t start adding permissions unnecessarily.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Android permissions have important privacy and Google Play policy implications, which we&#8217;ll cover in dedicated tutorials.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\">Understanding the res Folder<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\"><code>res<\/code> stands for <strong>resources<\/strong>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This folder contains non-code resources used by the Android application.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You may see folders such as:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>res\n\u2502\n\u251c\u2500\u2500 drawable\n\u251c\u2500\u2500 mipmap\n\u251c\u2500\u2500 values\n\u2514\u2500\u2500 xml<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Let&#8217;s understand the important ones.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\">drawable<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">The <code>drawable<\/code> folder is commonly used for graphical resources.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Depending on the project, it can contain things such as:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Vector drawables<\/li>\n\n\n\n<li>Shape resources<\/li>\n\n\n\n<li>XML drawables<\/li>\n\n\n\n<li>Images<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Example:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>res\n\u2514\u2500\u2500 drawable\n    \u251c\u2500\u2500 background.xml\n    \u2514\u2500\u2500 app_banner.png<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Jetpack Compose can also access Android drawable resources.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\">mipmap<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">The <code>mipmap<\/code> directories are commonly used for launcher icon resources.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You may see folders such as:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>mipmap-hdpi\nmipmap-mdpi\nmipmap-xhdpi\nmipmap-xxhdpi\nmipmap-xxxhdpi<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">These represent different screen densities.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Android can choose an appropriate resource based on the device.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You don&#8217;t need to manually understand every density yet.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">We&#8217;ll cover Android resources and screen densities later.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\">values<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">The <code>values<\/code> directory contains XML resource values.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Depending on your project, you may see files such as:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>strings.xml\ncolors.xml\nthemes.xml<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Not every Compose project will have exactly the same files.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\">strings.xml<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">Instead of hardcoding every user-facing string directly in Kotlin, Android applications can store text in string resources.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For example:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;resources&gt;\n\n    &lt;string name=\"app_name\"&gt;My First App&lt;\/string&gt;\n\n&lt;\/resources&gt;<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">We can then access the string from Compose.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For example:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Text(\n    text = stringResource(R.string.app_name)\n)<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Using string resources becomes particularly important when supporting multiple languages.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\">Why Use Resources?<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">Resources allow us to separate application content from application logic.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Instead of placing everything directly inside Kotlin files, Android provides a structured resource system.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For example:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Kotlin Code\n    \u2193\nBusiness\/UI logic\n\nResources\n    \u2193\nStrings\nImages\nIcons\nThemes\nOther configuration<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">This makes applications easier to maintain and localize.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\">What is Gradle?<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">Now let&#8217;s look at one of the parts that often confuses new Android developers:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Gradle<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Gradle is the build system used by Android projects.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">It helps Android Studio:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Compile source code<\/li>\n\n\n\n<li>Manage dependencies<\/li>\n\n\n\n<li>Configure builds<\/li>\n\n\n\n<li>Create APKs<\/li>\n\n\n\n<li>Create Android App Bundles<\/li>\n\n\n\n<li>Manage debug and release variants<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">You don&#8217;t need to understand all of Gradle immediately.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">We&#8217;ll gradually learn the parts we actually use.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\">Project-Level and Module-Level Configuration<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">Android projects can contain Gradle configuration at different levels.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">A simplified structure might look like:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>MyFirstApp\n\u2502\n\u251c\u2500\u2500 build.gradle.kts\n\u2502\n\u251c\u2500\u2500 settings.gradle.kts\n\u2502\n\u2514\u2500\u2500 app\n    \u2514\u2500\u2500 build.gradle.kts<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">One of the files you&#8217;ll frequently edit is the module-level file:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>app\/build.gradle.kts<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\">What is build.gradle.kts?<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">Modern Android projects commonly use Kotlin-based Gradle build scripts with the <code>.kts<\/code> extension.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Inside the app module&#8217;s build configuration, you may see something conceptually similar to:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>android {\n\n    namespace = \"com.example.myfirstapp\"\n\n    compileSdk = ...\n\n    defaultConfig {\n\n        applicationId = \"com.example.myfirstapp\"\n\n        minSdk = ...\n\n        targetSdk = ...\n\n        versionCode = 1\n\n        versionName = \"1.0\"\n    }\n}<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The actual values depend on the project and Android Studio version.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Let&#8217;s understand the important properties.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\">What is namespace?<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">The <code>namespace<\/code> is used for your application&#8217;s generated Android classes and resource references.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Example:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>namespace = \"com.example.myfirstapp\"<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">For beginners, it may look similar to the application&#8217;s package name.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Later, we&#8217;ll understand the differences between namespaces, packages, and application IDs.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\">What is applicationId?<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">The <code>applicationId<\/code> uniquely identifies your Android application when it is installed and distributed.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Example:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>applicationId = \"com.example.myfirstapp\"<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">For a real application, you might use something such as:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>com.companyname.appname<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The application ID is particularly important when publishing an application to Google Play.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Choose production application IDs carefully.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\">What is minSdk?<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\"><code>minSdk<\/code> defines the minimum Android API level your application supports.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Conceptually:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>minSdk\n   \u2193\nOldest Android API level supported by the app<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">If a device runs an Android version below your application&#8217;s minimum supported API level, the application cannot normally be installed on that device.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\">What is targetSdk?<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\"><code>targetSdk<\/code> tells Android which API level your application is designed and tested to target.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Conceptually:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>targetSdk\n   \u2193\nAndroid behavior level your app targets<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Target SDK is important because Android platform behavior and Google Play requirements evolve over time.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">We&#8217;ll discuss SDK versions in much more detail in a dedicated article.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\">What is compileSdk?<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\"><code>compileSdk<\/code> determines which Android API level is available when compiling your application.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Conceptually:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>compileSdk\n   \u2193\nAPIs available while compiling the app<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">A simplified comparison is:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>minSdk\n\u2193\nOldest API level your app supports\n\ntargetSdk\n\u2193\nAPI level your app is designed to target\n\ncompileSdk\n\u2193\nAPI level used to compile the app<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">These three values are related but serve different purposes.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\">versionCode and versionName<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">You&#8217;ll also encounter:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>versionCode = 1\nversionName = \"1.0\"<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">versionCode<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\"><code>versionCode<\/code> is an integer used to identify different versions of your application.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For example:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Version 1 \u2192 versionCode 1\nVersion 2 \u2192 versionCode 2\nVersion 3 \u2192 versionCode 3<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">When publishing updates, the version code needs to increase.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">versionName<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\"><code>versionName<\/code> is the user-facing version label.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For example:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>1.0\n1.1\n2.0<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">You might therefore have:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>versionCode = 5\nversionName = \"1.2\"<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">We&#8217;ll discuss app versioning when we prepare an application for Google Play.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\">What are Dependencies?<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">Android applications rely on libraries.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">These libraries are added as <strong>dependencies<\/strong>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Inside the app module&#8217;s Gradle configuration, you&#8217;ll find a dependencies section.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Conceptually:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>dependencies {\n\n    \/\/ Android libraries\n    \/\/ Compose libraries\n    \/\/ Testing libraries\n\n}<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">As we progress through the series, we&#8217;ll add libraries for technologies such as:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Navigation\nRoom\nHilt\nRetrofit\nCoroutines\nTesting<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Gradle downloads and makes those libraries available to our application.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\">What is settings.gradle.kts?<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">Another project file is:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>settings.gradle.kts<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">This file helps Gradle understand the overall project structure.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For example, it can define which modules belong to the project.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">A simple project may contain:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>:app<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Later, a multi-module application could contain:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>:app\n:core\n:data\n:domain\n:feature:home<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">For now, you usually won&#8217;t need to modify this file often.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\">Android View vs Project View<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">Android Studio can display project files in different ways.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The <strong>Android<\/strong> view simplifies the project structure and groups related Android files together.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">A more general <strong>Project<\/strong> view shows a structure closer to the actual files and directories on disk.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This is why the same project can appear slightly different depending on the selected project view.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For beginners, the Android-oriented view is usually easier to navigate.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\">Files You&#8217;ll Use Frequently<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">At the beginning of your Android journey, you&#8217;ll spend most of your time working with a relatively small set of files.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For example:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>MainActivity.kt\n        \u2193\nCompose UI and Activity\n\nui.theme\n        \u2193\nApplication theme\n\nAndroidManifest.xml\n        \u2193\nApplication configuration\n\nres\/\n        \u2193\nResources\n\napp\/build.gradle.kts\n        \u2193\nBuild configuration and dependencies<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">As the application grows, we&#8217;ll introduce additional packages and files.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\">Don&#8217;t Try to Memorize Everything<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">Android projects can look complicated when you first open them.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You don&#8217;t need to memorize every folder.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Start with these five concepts:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>1. Kotlin files \u2192 Application code\n\n2. AndroidManifest.xml \u2192 Application configuration\n\n3. res \u2192 Application resources\n\n4. build.gradle.kts \u2192 Build configuration\n\n5. app module \u2192 Main Android application<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Once these are clear, the rest of the project structure becomes much easier to understand.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\">Common Beginner Mistakes<\/h1>\n\n\n\n<h2 class=\"wp-block-heading\">Editing Generated Files Without Understanding Them<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Some files are generated automatically by Android or Gradle.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Avoid randomly modifying generated files just to fix an error.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Understand what the file does first.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">Adding Dependencies Everywhere<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Dependencies should be added to the appropriate Gradle configuration.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Don&#8217;t copy random dependency snippets from old tutorials without checking whether they&#8217;re still appropriate for your project.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">Hardcoding Every String<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Instead of putting every user-facing string directly inside Kotlin code, consider using string resources when appropriate.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This becomes especially useful for localization.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">Changing applicationId Carelessly<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The <code>applicationId<\/code> is important for installed applications and Google Play distribution.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For production applications, plan it carefully.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\">Quick Project Structure Summary<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">Here&#8217;s a simplified reference:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>app\/\n\u2502\n\u251c\u2500\u2500 manifests\/\n\u2502   \u2514\u2500\u2500 AndroidManifest.xml\n\u2502       \u2192 App configuration\n\u2502\n\u251c\u2500\u2500 kotlin + java\/\n\u2502   \u2514\u2500\u2500 MainActivity.kt\n\u2502       \u2192 Kotlin application code\n\u2502\n\u251c\u2500\u2500 res\/\n\u2502   \u251c\u2500\u2500 drawable\/\n\u2502   \u2502   \u2192 Images and drawable resources\n\u2502   \u2502\n\u2502   \u251c\u2500\u2500 mipmap\/\n\u2502   \u2502   \u2192 Launcher icons\n\u2502   \u2502\n\u2502   \u2514\u2500\u2500 values\/\n\u2502       \u2192 Strings and other values\n\u2502\n\u2514\u2500\u2500 build.gradle.kts\n    \u2192 App build configuration\n      and dependencies<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">You can return to this reference whenever you get confused about where something belongs.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\">What We&#8217;ve Learned<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">In this tutorial, we learned about:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Android Studio project structure<\/li>\n\n\n\n<li>Modules<\/li>\n\n\n\n<li>The <code>app<\/code> module<\/li>\n\n\n\n<li>Kotlin source files<\/li>\n\n\n\n<li>Packages<\/li>\n\n\n\n<li><code>MainActivity.kt<\/code><\/li>\n\n\n\n<li>Compose theme files<\/li>\n\n\n\n<li><code>AndroidManifest.xml<\/code><\/li>\n\n\n\n<li>Android resources<\/li>\n\n\n\n<li><code>drawable<\/code><\/li>\n\n\n\n<li><code>mipmap<\/code><\/li>\n\n\n\n<li><code>values<\/code><\/li>\n\n\n\n<li>Gradle<\/li>\n\n\n\n<li><code>build.gradle.kts<\/code><\/li>\n\n\n\n<li>Dependencies<\/li>\n\n\n\n<li><code>namespace<\/code><\/li>\n\n\n\n<li><code>applicationId<\/code><\/li>\n\n\n\n<li><code>minSdk<\/code><\/li>\n\n\n\n<li><code>targetSdk<\/code><\/li>\n\n\n\n<li><code>compileSdk<\/code><\/li>\n\n\n\n<li><code>versionCode<\/code><\/li>\n\n\n\n<li><code>versionName<\/code><\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">You now have a much better understanding of the files Android Studio created for your application.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\">What&#8217;s Next?<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">Now that we understand the basic Android project structure, the next step is to understand some of the most important Android configuration concepts in more detail.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Next Tutorial<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Android SDK, API Level, minSdk, targetSdk &amp; compileSdk Explained<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">We&#8217;ll learn exactly what each SDK value means, how they differ, how they affect device compatibility, and why they matter when publishing applications to Google Play.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Happy Coding!<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Continue learning modern Android development with <strong>Moiks Developer Blog<\/strong>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Understand the Android Studio project structure, including the app module, Kotlin source files, AndroidManifest, resources, Gradle files, and build configuration.<\/p>\n","protected":false},"author":1,"featured_media":62,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"iawp_total_views":8,"footnotes":""},"categories":[4,333],"tags":[],"class_list":["post-61","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-android-basics","category-android-tutorials"],"_links":{"self":[{"href":"https:\/\/moiks.com\/blog\/wp-json\/wp\/v2\/posts\/61","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/moiks.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/moiks.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/moiks.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/moiks.com\/blog\/wp-json\/wp\/v2\/comments?post=61"}],"version-history":[{"count":1,"href":"https:\/\/moiks.com\/blog\/wp-json\/wp\/v2\/posts\/61\/revisions"}],"predecessor-version":[{"id":63,"href":"https:\/\/moiks.com\/blog\/wp-json\/wp\/v2\/posts\/61\/revisions\/63"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/moiks.com\/blog\/wp-json\/wp\/v2\/media\/62"}],"wp:attachment":[{"href":"https:\/\/moiks.com\/blog\/wp-json\/wp\/v2\/media?parent=61"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/moiks.com\/blog\/wp-json\/wp\/v2\/categories?post=61"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/moiks.com\/blog\/wp-json\/wp\/v2\/tags?post=61"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}