Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

New Directory vs New Folder in Android Studio

What is the difference between creating a new directory and creating a new folder in Android Studio?

Here is an image of the menu choices:

enter image description here

like image 954
Suragch Avatar asked Apr 05 '15 05:04

Suragch


People also ask

What is a directory in Android Studio?

Android Studio stores the projects by default in the home folder of the user under AndroidStudioProjects. The main directory contains configuration files for Android Studio and the Gradle build files. The application relevant files are contained in the app folder.

How do I create a folder in Android Studio?

In the drop down menu click on the new option. After this a drop down menu opens here you will see directory option just click on that. After this enter the name of your directory / folder and press enter this will create a new folder / directory inside your root folder.

How do I change the directory in Android Studio?

Click on Appearance and Behavior option > System Settings options and then click on the Android SDK option to get to see the below screen. Inside this screen, you will get to see your SDK path. You can update your SDK path by clicking on the Edit option.

How do I create multiple folders on android?

To do this on your device: Access the home screen panel where the apps you want to put into a folder are located. Drag the first app and drop it on top of another and this will create a folder with both apps inside. Tap the folder to view the apps in it.


Video Answer


1 Answers

Short answer

Use folder when adding a folder to an Android Studio project. This is what Android Studio calls them. Directory is what IntelliJ calls a folder. Android Studio is built on top IntelliJ so there is some naming confusion.

Long answer

Although there is a technical difference between a folder and a directory (see here and here), they are often (correctly or incorrectly) used interchangeably. This can be seen even in the titles of these two SO questions:

  • Setting a custom assets directory for unit testing in Android Studio
  • Adding an assets folder in Android Studio

This can be confusing to new users of Android Studio when they see both choices in the menu structure. Further confusion results when users add a new directory and then it doesn't show up in the Android folder view. See these questions for example:

  • Android Studio: Newly Created Directory Not Appearing In Folders View
  • New created "values" folder is not visible in Android Studio

The folders actually do show up if you select the Project or Packages view from the menu:

enter image description here

However if you want an Android folder to show up automatically in the Android view you need to right click and use New > Folder > Assets folder (if you are adding an assets folder). You could then add a subfolder like "fonts" to this by choosing the New > Directory option.

Android Studio is built on top of IntelliJ IDEA. IntelliJ itself has a menu option to add a directory (as you can see here). But Android stores files in what it calls folders. So when these two platforms are put together in Android Studio, there gets to be some naming confusion. (This is my interpretation, but perhaps they really are trying to differentiate the subtle differences between directory and folder.)

You can see from your menu image that there is also an "Android resource directory" option. (You got that by right clicking on the res directory/folder rather than a subdirectory.) You would use this to add resource folders such as raw, menu, values, etc.

like image 156
Suragch Avatar answered Oct 13 '22 07:10

Suragch