dcsimg
December 4, 2016
Hot Topics:

Project Layouts in Android Studio

  • March 11, 2016
  • By Vipul Patel
  • Send Email »
  • More Articles »

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.

Basics

The Android development workspace typically looks like what's shown in Figure 1.

Layout1
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.

Layout2
Figure 2: The Project Tool window

You can find out the other available views by clicking the dropdown and choosing the desired view.

Android View

The Android view resembles Figure 3.

Layout3
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.

Layout4
Figure 4: The fully expanded Android view

Project View

The Project view looks that shown in Figure 5.

Layout5
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.

Layout6
Figure 6: A semi-expanded Project view

Other views supported in Android Studio include:

  • Packages:This shows the layout ordered by packages.

    Layout7
    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.

Layout8
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.

Summary

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 vipul.patel@hotmail.com. You can visit his LinkedIn profile at https://www.linkedin.com/pub/vipul-patel/6/675/508.


Tags: Android, layouts, android studio, Gradle, development workspace




Comment and Contribute

 


(Maximum characters: 1200). You have characters left.

 

 


Enterprise Development Update

Don't miss an article. Subscribe to our newsletter below.

Sitemap | Contact Us

Thanks for your registration, follow us on our social networks to keep up-to-date
Rocket Fuel