How to generate Class Diagram (UML) on Android Studio (IntelliJ Idea)
I found a free plugin that can generate class diagrams with android studio. It's called SimpleUML.
Update Android Studio 2.2+: To install the plugin, follow steps in this answer: https://stackoverflow.com/a/36823007/1245894
Older version of Android Studio
On Mac: go to Android Studio
-> Preferences
-> Plugins
On Windows: go to Android Studio
-> File
-> Settings
-> Plugins
Click on Browse repositories...
and search for SimpleUMLCE
(CE means Community Edition, this is what android studio is based on).
Install it, restart, then you can do a right click on the folder containing the classes you want to visualize, and select Add to simpleUML Diagram
.
That's it; you have you fancy class diagram generated from your code!
For those who want to use simpleUML in Android Studio and having issues in running SimpleUML.
First download simpleUML jar from here https://plugins.jetbrains.com/plugin/4946-simpleumlce
Now follow the below steps.
Step 1:
Click on File and go to Settings (File → Settings)
Step 2
Select Plugins from Left Panel and click Install plugin from disk
Step 3:
Locate the SimpleUML jar file and select it.
Step 4:
Now Restart Android Studio (File → Invalidate Caches/Restart → Just Restart)
Step 5:
After you restart Right Click the Package name and Select New Diagram or Add to simpleUML Diagram → New Diagram.
Step 6:
Set a file name and create UML file. I created with name NewDiagram
Step 7:
Now Right Click the Package name and Select the file you created. In my case it was NewDiagram
Step 8:
All files are stacked on top of one another. You can just drag and drop them and set a hierarchy.
Like this below, you can drag these classes
I have managed to to do it in a way. Perform all the steps as referenced by Michal Rowicki above.
- Open Visual Paradigm software.
- Create a new Project
- There would be an option on the
Tools
bar above that statesCode
and selectInstant Reverse...
from the drop down menu with Java language(or other) - Select your application folder where your project is located and add it to the project(i have selected the complete folder application)
- The application should now appear on the left pane in Class Repository
- Then all you do is right click the project that you have added and select Reverse to new class diagram
- Select either you wish to have the packages included in the class diagram or just the class diagram of the project
Then it should appear on your screen and customize it as you wish
However i do not know if the plugin in Android Studio was necessary nevertheless it has worked in a way for me.
- type Ctrl+Alt+S (or go to Preferences)
- go to the Plugins tab, press "Browse repositories" button
- search:
Visual Paradigm SDE for IntellIJ (Community edition) Modelling Case Tool
- install it.
You need to install proper software. Now it should works well.
I guess that UML Class Diagram is only available on Ultimate Edition.
To show UML diagram click right mouse button on specific class -> Diagrams -> Show diagram... Or you can in editor click Ctrl+Alt+Shift+U. You could append new classes to diagram by drag and drop. On the top of window you could choose more options. To save UML you should just click on save icon.
There is Code Iris which you can install by going to File -> Settings -> Plugins -> Browse Repositories, then find and choose Code Iris. Restart then you will have a new Code Iris tab.