[android] How to generate Class Diagram (UML) on Android Studio (IntelliJ Idea)

I've try to search and found this link, but Ctrl+Alt+Shift+D doesn't work.

I also use find Action Ctrl+Shift+A to find action about diagram and uml but found nothing.

I also search for the uml plugin, but most of them didn't work with new version of intelliJ (I didn't try it I just read the comment).

This question is related to android android-studio intellij-idea ide class-diagram

The answer is


I have managed to to do it in a way. Perform all the steps as referenced by Michal Rowicki above.

  1. Open Visual Paradigm software.
  2. Create a new Project
  3. There would be an option on the Tools bar above that states Code and select Instant Reverse... from the drop down menu with Java language(or other)
  4. Select your application folder where your project is located and add it to the project(i have selected the complete folder application)
  5. The application should now appear on the left pane in Class Repository
  6. Then all you do is right click the project that you have added and select Reverse to new class diagram
  7. 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.


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


1]

Step 3:

Locate the SimpleUML jar file and select it.

2]

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.

3

Step 6:

Set a file name and create UML file. I created with name NewDiagram

enter image description here Step 7:

Now Right Click the Package name and Select the file you created. In my case it was NewDiagram

enter image description here

Step 8:

All files are stacked on top of one another. You can just drag and drop them and set a hierarchy.

enter image description here

Like this below, you can drag these classes

enter image description here


I'm developing with android studio 2+.

to create class diagrams I did the following: - install "ObjectAid UML Explorer" as plugin for eclipse(in my case luna with android sdk but works with younger versions as well) ... go to eclipse marketplace and search for "ObjectAid UML Explorer". it's further down in the search results. after installation and restart of eclipse ...

open an empty android or what-ever-java-project in eclipse. then right click on the empty eclipse project in the project explorer -> select 'build path' then I link my ANDROID STUDIO SRC PATH into my eclipse android project. doesn't matter if there are errors. again right click on the eclipse-android project and select: New in the filter type 'class' then you should see among others an option 'class diagram' ... select it and confgure it ... png stuff, visibility, etc. drag/drop your ANDROID STUDIO project classes into the open diagram -> voila :)

hth

I open eclipse(luna, but that doesn't matter). I got the "ObjectAid UML Explorer"
that installed I open an empty android project oin eclipse, right


  1. type Ctrl+Alt+S (or go to Preferences)
  2. go to the Plugins tab, press "Browse repositories" button
  3. search:
    Visual Paradigm SDE for IntellIJ (Community edition) Modelling Case Tool
  4. 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.


You can use the simple program StarUML. The trial version is unlimited and can do almost anything.

Onced installed you can use it to generate great number of uml digrams just by pasting the source code. Class diagram is just one type of it. (It understands not only Java language but C#, C++ and other)

P.S. The program is great for drawing architectural diagrams before you start to code the program.


Update 24.3.2016

I have found this guide from VP https://knowhow.visual-paradigm.com/technical-support/running-vp-in-android-studio/ created on September 8, 2015.

Good to know - it is possible to integrate VP into Android studio (in my case 1.5.1) now. Do not forget to backup your Android Studio settings (you can find them in Users%userName/.AndroidStudioX.X on Windows) ahead of installation.

I was trying to make it work, but created vp project did not contain any diagrams. Maybe someone else will have more luck.


I was using this manual http://www.visual-paradigm.com/support/documents/vpuserguide/2381/2385/66578_creatingauml.html to make Visual Paradigm working in Android studio, but action in 2. did not invoke dialogue in 3. So I Have asked Visual Paradigm support for help and they replied that Android Studio integration is not supported right now.

Reply from Visual paradigm reply from Apr 17 2015:

Thank you for your inquiry and I'm very sorry that at the moment we only support integrate with the standard IntelliJ IDEA, but not integrate with the Android Studio. We may consider to support it in our future release, and I'll keep you post once there any update on this topics. Feel free to contact me for any questions and wish you have a good day!

This post was deleted, so I will try to make it more clear.

As such I am considering previous answers as misleading and not useful. Therefore I thing that it is important for others to know that, before they lose their time trying to make it working.


Solution:

  1. Run Visual Paradigm
  2. Do as below, pointing to Android Atudio directory on step 4

enter image description here

  1. Open Android Studio and right click on project

enter image description here


This Kotlin state machine library has PlantUML export feature, it is not integrated with Android Studio but it is easy to visualize state machine structure on PlantUML web site.

https://github.com/nsk90/kstatemachine


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.


Examples related to android

Under what circumstances can I call findViewById with an Options Menu / Action Bar item? How to implement a simple scenario the OO way My eclipse won't open, i download the bundle pack it keeps saying error log getting " (1) no such column: _id10 " error java doesn't run if structure inside of onclick listener Cannot retrieve string(s) from preferences (settings) strange error in my Animation Drawable how to put image in a bundle and pass it to another activity FragmentActivity to Fragment A failure occurred while executing com.android.build.gradle.internal.tasks

Examples related to android-studio

A failure occurred while executing com.android.build.gradle.internal.tasks "Failed to install the following Android SDK packages as some licences have not been accepted" error Android Gradle 5.0 Update:Cause: org.jetbrains.plugins.gradle.tooling.util This version of Android Studio cannot open this project, please retry with Android Studio 3.4 or newer WARNING: API 'variant.getJavaCompile()' is obsolete and has been replaced with 'variant.getJavaCompileProvider()' Flutter plugin not installed error;. When running flutter doctor ADB.exe is obsolete and has serious performance problems Android design support library for API 28 (P) not working Flutter command not found How to find the path of Flutter SDK

Examples related to intellij-idea

IntelliJ: Error:java: error: release version 5 not supported Has been compiled by a more recent version of the Java Runtime (class file version 57.0) Error: Java: invalid target release: 11 - IntelliJ IDEA IntelliJ can't recognize JavaFX 11 with OpenJDK 11 Error: JavaFX runtime components are missing, and are required to run this application with JDK 11 ERROR Source option 1.5 is no longer supported. Use 1.6 or later Cannot inline bytecode built with JVM target 1.8 into bytecode that is being built with JVM target 1.6 How to configure "Shorten command line" method for whole project in IntelliJ intellij idea - Error: java: invalid source release 1.9 Failed to resolve: com.google.android.gms:play-services in IntelliJ Idea with gradle

Examples related to ide

How can I view the Git history in Visual Studio Code? How to ignore a particular directory or file for tslint? How do I completely rename an Xcode project (i.e. inclusive of folders)? Where is the visual studio HTML Designer? How to disable gradle 'offline mode' in android studio? Android studio Error "Unsupported Modules Detected: Compilation is not supported for following modules" Android Studio was unable to find a valid Jvm (Related to MAC OS) QtCreator: No valid kits found Difference between WebStorm and PHPStorm package android.support.v4.app does not exist ; in Android studio 0.8

Examples related to class-diagram

How to generate Class Diagram (UML) on Android Studio (IntelliJ Idea) Use IntelliJ to generate class diagram Eclipse plugin for generating a class diagram Generate UML Class Diagram from Java Project How to use doxygen to create UML class diagrams from C++ source In UML class diagrams, what are Boundary Classes, Control Classes, and Entity Classes? PHP UML Generator