158

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).

UmAnusorn
  • 10,420
  • 10
  • 72
  • 100
  • 2
    I noticed the UML Modeling feature only available in Ultimate Edition but not in Community Edition see http://www.jetbrains.com/idea/features/ – yancyn Mar 14 '14 at 07:27

10 Answers10

118

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!

RonU
  • 5,525
  • 3
  • 16
  • 13
Distwo
  • 11,569
  • 8
  • 42
  • 65
95

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

Ellen Spertus
  • 6,576
  • 9
  • 50
  • 101
farhangdon
  • 2,003
  • 2
  • 21
  • 30
  • 11
    is there some way of auto arranging 200++ stacked classes?! – Ewoks Aug 05 '16 at 09:46
  • Unfortunately no, I also did individually. – farhangdon Aug 05 '16 at 09:51
  • 14
    Actually I just found it. There is grayed icon, second from the bottom in second column of icons, that does auto-layout and it is not disabled as it looks. "Toggle-Automatic-Layout". – Ewoks Aug 05 '16 at 12:41
  • That's great, I will check it, and will update in answer. – farhangdon Aug 05 '16 at 14:05
  • @farhangdon Please confirm the Sequence diagram, Package Diagram and DependenciesDiagram generates empty objects and you have to do t manually - unless if there is something I am missing – iOSAndroidWindowsMobileAppsDev Oct 26 '16 at 06:59
  • @farhangdon Please confirm the Sequence diagram, Package Diagram and DependenciesDiagram generates empty objects and you have to do t manually - unless if there is something I am missing – iOSAndroidWindowsMobileAppsDev Oct 26 '16 at 06:59
  • 1
    FYI I had to import twice (AS 2.3), the first time AS (Android Studio) didn't restart, it just closed (shut down). I gave it another try (ran through the import steps above) and everything worked. – James Nelson Apr 05 '17 at 03:19
  • @JamesNelson m glad it worked for you, first time there might be some issue with android studio as its quite slow and often lags. For me it worked in the very first time. – farhangdon Apr 10 '17 at 21:09
  • How to save this class diagram ? – AbdulSaleem Jul 10 '17 at 07:09
  • Well, you can just use the snipping tool of windows so save each page. – farhangdon Jul 27 '17 at 22:53
  • Just finished complete set of diagrams with SimpleUML just to find out that print fuction is printing text (xml) not image of diagram and export not working. Only way to use those diagrams in documentation is to screenshot .... Skip this tool – Ivan Marjanovic Aug 17 '17 at 11:07
  • Do you have any recommendation in version 3.1? – soalrib Nov 21 '18 at 09:20
  • As of March 2019, can confirm that this still works. – chowden Mar 25 '19 at 18:40
  • @chowden how were you able to actually see anything? My UI display is empty. – portfoliobuilder Jun 13 '19 at 22:46
  • Class diagram generation works as of June 2019. Using AS 3.4.1. This is great. – user3269589 Jun 26 '19 at 16:36
  • 2
    Ok, its working great but it omits long class members/methods names which makes it hard to guess their names. Is there any way to fix the 3-dots at the end of members/methods names? – blueware Dec 30 '19 at 15:32
  • Hi @blueware unfortunately NO, there are certain limitation and I believe this is one of them, if you find some way also update me Thanks – farhangdon Jan 14 '20 at 01:04
  • 1
    Hi @farhangdon, I found a solution. Its to install **IntelliJ Ultimate** edition and use its superior `UML Class Diagram` buy selecting a class/package then right click and choose the option `UML Class Diagram` and trigger related buttons to see your classes with their dependencies, parents and relations. Thanks to **IntelliJ** for that. Also consider buying a license for it if you want to continue using it. – blueware Jan 15 '20 at 08:17
  • 4
    fyi: As of Android Studio Arctic Fox | 2020.3.1, I am unable to install the specified *.jar. There are unfortunately compatibility issues. – Coach Roebuck Aug 09 '21 at 17:25
  • @CoachRoebuck, me the same. It indicates that the versions are explicitly incompatible. :? – Ehsan Ghasaei Oct 12 '21 at 01:26
26

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.

not2qubit
  • 14,531
  • 8
  • 95
  • 135
Chris
  • 261
  • 3
  • 3
19
  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.

jezrael
  • 822,522
  • 95
  • 1,334
  • 1,252
Michał Rowicki
  • 1,372
  • 1
  • 16
  • 28
  • 2
    I have already added it. But I don't know how to use it. I also try to search with many keyword eg.visual paradigm sde for intellij example,how to use,user manual etc. – UmAnusorn Jun 17 '13 at 12:53
  • 1
    I just try to download Visual Paradigm SDE (Community edition) but cannot integrated to Android Studio because not an IntelliJ support version – UmAnusorn Jun 17 '13 at 13:19
  • 2
    i dl'ed this: http://plugins.jetbrains.com/plugin/download?pr=&updateId=1149 and this: http://www.visual-paradigm.com/download/vpuml.jsp?edition=ce .. but, how we use it? – Paschalis Jul 05 '13 at 04:30
  • 1
    @MichalRowicki So how do you use Visual Paradigm in Android Studio after you install it? – IgorGanapolsky May 15 '14 at 17:01
  • 5
    So is there no support for UML diagrams for Studio yet? – John Shelley Jul 04 '14 at 01:34
  • I installed the plug in android studio but how can I generate UML diagram for my code. – Ashwin N Bhanushali Sep 08 '14 at 06:41
  • It states that this feature is only available in the `Standard edition` and above. Thus they contradict themselves from their own feature page... What a rip-off! – not2qubit Feb 20 '15 at 12:24
  • 1
    At the moment being, my the plugin is 10 year old. I hardly beleive it works: http://snag.gy/vIuQG.jpg – Andrew May 15 '15 at 20:24
19

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.

15

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.

sonavolob
  • 354
  • 5
  • 8
  • thanks I've already lost my time trying make it work, so do you know of any other alternative, since almost everywere they point you to the missleading option visual Paradigm plugin – Pedro Teran Sep 15 '15 at 16:06
  • Hi Pedro, for now - I do not know any solution I have tried some UML solutions but none that I like. We probably should wait for VP till they implement it or somebody else come's up with something useful. Please if you thing this answer is right and others not - up vote it. It helps others not to go through this time waist full experience. Thank you. – sonavolob Sep 16 '15 at 11:51
9

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

JM Lord
  • 1,031
  • 1
  • 13
  • 29
ceph3us
  • 7,326
  • 3
  • 36
  • 43
2

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

nsk
  • 310
  • 2
  • 9
1

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

more.code
  • 11
  • 1
  • 2
0

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.

Seagull
  • 1,063
  • 1
  • 11
  • 18
  • 1
    But you have to use it outside of Android Studio. It's manual creation. By the time you finish creating a class module, it would have been changed in the code. The better solutions auto generate these graphs. – portfoliobuilder Jun 13 '19 at 23:18