World-renowned artists are known not only for their art, but also how for they leverage their tools. For Android developers, that tool is Android Studio, the most popular development suite for Android development. In this article, we will learn about working with the project layouts in Android Studio.
The Android development workspace typically looks like what's shown in Figure 1.
Figure 1: The Android development workspace
On the left is the Project Tool window, the code editor is on the right, and the debug view is on the bottom. The Project Tool window supports multiple views, with the Android view being the one shown by default.
Figure 2: The Project Tool window
You can find out the other available views by clicking the dropdown and choosing the desired view.
The Android view resembles Figure 3.
Figure 3: The Android view
It shows the most important top-level source directories. It also helps group the build and manifest files for all modules in respective common folders. It shows resource files from all Gradle source sets, and groups resources for different locales, orientations, and screen types in a single group per resource type.
Figure 4 shows a fully expanded Android view of the project.
Figure 4: The fully expanded Android view
The Project view looks that shown in Figure 5.
Figure 5: The Project view
The content in the Project view is the same as Android view, but the presentation order is different. The Project view has a root node for each module in the project. All source code for the module is under the "app/src" folder and the module build configuration is in build.gradle.
Resources are under "/app/src/res".
Here is a semi-expanded Project view of the project that shows the source code folders expanded.
Figure 6: A semi-expanded Project view
Other views supported in Android Studio include:
- Packages:This shows the layout ordered by packages.
Figure 7: A package-ordered layout view
- Scratches: This shows all scratch notes you have taken for the project.
- Project files: This shows the project ordered by files, as shown in File Explorer.
Figure 8: A file-ordered layout view
- Problem: If there are any problems in the project, they will be shown in this view.
- Production: This shows the code view of production.
- Test: This shows the test code for the project.
It is important for developers to know how to switch between the view modes for maximum productivity. Knowing which view to use for the work at hand can save previous time that you can use to work on building new features or polishing the existing app.
In this article, we learned about the project layouts in Android Studio. I hope you have found this information useful.
About the Author
Vipul Patel is a technology geek based in Seattle. He can be reached at firstname.lastname@example.org. You can visit his LinkedIn profile at https://www.linkedin.com/pub/vipul-patel/6/675/508.