Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

android studio folders inside packages

how can I have a directory structure like

src/main/java/com.L33Tcode.example/Adapters

src/main/java/com.L33Tcode.example/Fragments

android studio doesn't seem to want to let me have source folders inside a package folder for some reason. Also if I want to have jni libraries and native c++ code how can I have this inside the same package. The android studio is a great program but the directory structure is really confusing please help. Right now my project doesn't even have a package folder and none of the source code has "package" at the top but it seems to find everything alright.

like image 436
user3492641 Avatar asked Dec 07 '14 13:12

user3492641


People also ask

Where is the packages folder in Android?

The package for each android application resides within the src/main/java directory of the application module.

What is a package folder?

Package Folders Packages are special folders that can contain class folders, function, and class definition files, and other packages. The names of classes and functions are scoped to the package folder.

How do I create a folder in Android Studio?

Select layouts , right-click and select New → Folder → Res Folder. This resource folder will represent a “feature category” that you want. You can easily create any type of file/folder in Android Studio.


2 Answers

Yes, the "Package" is the folder

like image 56
Juan Sancho Avatar answered Oct 14 '22 17:10

Juan Sancho


Right click on your package name(src/main/java/com.L33Tcode.example). After that select New->Package and enter folder name(Fragments) watever you want. Here you can see that your package is created. package in it's self is your folder. So, you can see it from right click on your created folder(Fragments)-> show in history and show your folder init.

like image 32
jignyasa tandel Avatar answered Oct 14 '22 15:10

jignyasa tandel