Stop android studio grouping single-item directories with a dot - android-studio

If I have a directory which only (at present!) contains another directory Android Studio decides, for some strange reason, to not expand the directories in the usual manor - ie click folder1 to reveal folder2, then click folder2 to show its contents - but instead put them together in a single entry (folder1.folder2). This makes the directory structure incredibly difficult and inconsistent to deal with when trying to manipulate the contents. Right now I'm having to revert to doing so in windows explorer!
Is the any way to change this peculiar behavior.

Click the settings icon in the Project view and uncheck Compact Empty Middle Packages.
Note: this screenshot is from IntelliJ Ultimate, but it should look the same (or similar) in Android Studio.

I got it to work similarly by going to the Project View settings and then unchecking the Flatten Packages option. This then got my folder configuration to the desired subfolder configuration format as described above. This may be new compared to the answer of 5 years ago. In my case, only unchecking the Compact Empty Middle option was not enough.

Use combination of Ctrl+Shift+A inside Android studio, it's a shortcut for "Find Action..." and type in "package", there is "Compact Middle Packages", turn that off.

Related

How to make all files read-only in Android Studio

I would like to make all of the files in an Android Studio project read-only, so that if a cat runs across my keyboard it's safe.
In other words, I would like to have the same effect as if I clicked on the padlock icon in the right bottom corner for all of the files in a particular project or a specific folder:
Is this supported by the UI, or is it conveniently achievable somehow?
Mokay, this may have been an strange question... but just in case somebody else is trying to do the same thing:
chmod -R a-w app/src

how to create layout folder depending on api version?

i want to Create different layout depending api version as follows. Since the default folder layout is already available,when i create new layout as below screenshot it doesnt apppear in android studio folder list under res. but i right click on res and open with explorer those folder does shows. can any one please help me how to create those layout folder.
/res/layout/layout.xml (Default)
/res/layout-v14/layout.xml (Api 19)
/res/layout-v17/layout.xml (API 21)
I think the reason for not seeing the folders is due to the current viewing option you have selected in Android Studio. (please refer to the image below)
When Android is selected the folders are more compact, meaning it will focus on showing a single resource/folder regardless of qualifiers and I think that's what you experience. Switching to Project would solve it however.
This viewing option does have some great benefits by the way, for example I really love how gradle scripts are grouped together and it even shows the Global gradle.properties file (at least on MacOS) which it doesn't in Project view.

I want to compare two projects in Android studio

I have a couple Android Studio projects that are similar, and I want to know exactly where their source files differ. What is an easy way to do that?
Right click file/directory/project/module > click compare with > give the path to compare
EASY WAY TO FIND PATH : ( considering both projects are open in Android Studio)
Switch to project you want to compare > right click file/directory/project/module > copy path > paste it back in select path dialog.
BETTER to copy path first.
Verified : Android Studio 1.5.1
In Android studio 3.4.2 you can do by right click on
Select Android : app → Compare Directories select proper path for your files and done.
In Android Studio Bumblebee : app → Compare With or Ctrl+D :)
I'm highly recommend Compare Directories Plugin for Android Studio 2+.
Allows the fast comparison of two directories or archive files (jar,
zip, war... and also tar/gz) based on file contents. Compared
directories/archives are shown in a tree view to give a better and
easier-to-read overall view of the differences.
Installation:
Open: File > Settings > Plugins
Click on the button “Browse repositories”, find the “Compare Directories” plugin in the available plugins list, right click on it and choose install.
General usage instructions:
Execute the Compare Directories... menu command, select two directories or zip/jar/tar files containing files with the same file names and see the comparison results on the opened Compare Directories panel:
Files and directories are shown depending on the differences in their
contents: identical, different by blanks only, non-significantly
different, different, left-only, right-only.
Compared text file can be then edited within IDEA.
Compared text file differences can be then viewed with the usual IDEA diff window.
Compared class bytecode differences can be also viewed with the usual IDEA diff window.
Files and directories can be copied from one side to the other.
You will find many more details in the plugin page:
https://plugins.jetbrains.com/plugin/113-compare-directories

Android Studio project folders not showing

I am unable to see the folders that are physically existing, this is the case.
But in actual fact I have other folders as welll
So what can I do?
Above your the file directory view in Android Studio is a drop down which currently is most likely set to Android. Change it to Project and you should be able to see all your files.
I tried the all the approaches mentioned above but can't fix rather than fix it by a hardcore approach -
Step 1. Close your Android studio.
Step 2. Delete .gradle and .idea folder from your project directory.
Step 3. Open your project and you will see the files again.
go to View menu then click tool window then after click on project
view->toolwindow->project
it worked for me
for me doing the following works:
from menu go to: View--->tool windows ---> Project
then click the little gears icon (settings) you will see an option to change the empty middle packages. it looks like this:
disable "Hide Empty Middle Packages" under the Project View settings dropdown and then it should make everything show up.
If anyone ever does what I did maybe this will help:
Android Studio does not like it when module names begin with a number. I was learning from some tutorials and named the first module "1-name" and the next one "2-name". Setup was fine and it ran, but only the "Gradle" Scripts entry would show in the navigation window in "Android" mode.

visual studio 2010 not opening projects

i just installed visual studio 2010 and it is not opening any projects .I can make projects but i can not add any file in it and also it is not opening recent projects.
I am stuck here , kindly cooperate with me!
OK, sounds like the installaion got munged up.
first obvious questions: do you have any code that has actually been saved?
If "yes," copy that code to an alternate location, and use the simplest solution: use the Windows Control Panel to deinstall the MSVC instance and reinstall. If no code saved, just de-install and reinstall.
That's the obvious answer. You may also check the location for the project files, and the settings Visual Studios uses.
from the toolbar, click "tools".
From the drop-down list select "options"
Within the displayed list, scroll down to "projects and solutions"
expand that list (click on the little "+" box)
3 locations will be displayed.
Make sure you have write permission to all three locations
all the check boxes should be selected. Especially the one marked "save new projects when created"
click "OK" to accept the changes

Resources