How to Generate Class Diagram (Uml) on Android Studio (Intellij Idea)

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!

Generating UML diagram in Android Studio

Try Code Iris. You can install it in Android Studio as a plugin.

Open Android Studio Settings: File -> Settings. Look for Plugins, then hit "Browse repositories..." and type "Code Iris". Install and restart your IDE.

There is another plugin that could be interesting too, which is PlantUML. You may need to install Graphviz in order to make it work.

  • Code Iris allows to export your diagram into a json file.
  • PlantUML allows to save your diagram as a PNG file.

Hope it helps.

Use IntelliJ to generate class diagram

Use Diagrams | Show Diagram... from the context menu of a package. Invoking it on the project root will show module dependencies diagram.

If you need multiple packages, you can drag & drop them to the already opened diagram for the first package and press e to expand it.

Note: This feature is available in the Ultimate Edition, not the free Community Edition.



Related Topics



Leave a reply



Submit