r/androiddev • u/andreasschrade • Sep 06 '16
hey Devs, I made an Android Studio Plugin to increase productivity and reduce frustration during coding
http://exynap.com11
u/Sunstriked Sep 06 '16
Good job, keep it up! Some questions:
Is it open-source?
Is there any possibility to dedicate code and snippets quality to the open-source community?(less bugs, better code).
9
u/andreasschrade Sep 07 '16
24 hours ago, I did not even know if there is anyone out there who would like this plugin. Therefore I did not make any plans about open sourcing the code. However, a constant progress of the plugin is very important for me.
It seems reasonable to involve the power of an open source community :) I'll make a plan in the upcoming days.
1
u/alostpacket Sep 08 '16
If you open source it you could always still monetize it by providing private snippet repositories for teams. You could even generalize this for other languages/jetbrains IDEs
Anyways, very nice work.
10
u/Zarlon Sep 06 '16
Awesome. How did you gather all the code snippets? Scripted or manually?
8
u/andreasschrade Sep 07 '16
tl;dr It is a combination of automation and a manual association of "knowledge".
The class templates (Activity template, Fragment template, ...) are handcraftet. Everything else is a mixture of harvesting the Android API platform (parsing API source and the official Docs to get a further understanding of Classes, Methods, Arguments etc.), combining this raw knowledge with a handcrafted abstract knowledge about Android (based on an ontology) and manually associating API calls.
The "code engine" builds an AST (abstract syntax tree) based on the query/command and makes the rendering of the snippet.
The cool part about this functionality is, that the engine really "knows" what a certain part of a "snippet" does.
For example: If a snippets needs an AlarmManager object and there is already a variable from this type available in your code, it can simply skip this part of the snippet and can reuse the existing instance (instead of creating an additional instance of AlarmManager).
That is someting you can't do with "static" code snippets.
14
u/FreemanAMG Sep 06 '16
Just a Heads up, it didn't work for me in 2.2 RC. I got an error "could not initialize class retrofit.platform". It works great on 2.1, though. Thanks for your work, it's awesome!
8
u/andreasschrade Sep 06 '16 edited Sep 06 '16
Many thanks for reporting! I am working on a bugfix. Just give me an hour :)
Update: Issue is probably fixed. Please see here for more details.
2
u/andreasschrade Sep 06 '16
I just uploaded a new (experimental) version (1.0.2 beta) that seems to work on Android Studio 2.2 beta. This version is not available via the plugin repository yet, but available via the exynap website. Please see the installation instruction for further details on the exynap website. Thanks for reporting!
3
u/marl1234 Sep 06 '16
Yup, same on me, 2.2 RC showing "NoClassDefFoundError: Could not initialize class retrofit.Platform"
4
u/SirPali Dev @ Egeniq Sep 06 '16
Sounds pretty useful! I gave the plugin a try, but as soon as Android Studio restarts after enabling the plugin it crashes.
I'm using Android Studio 2.1.3 on El Capitan (10.11.4). I hope you can figure out what's up from the error message, I'd love to try this out in the future.
7
u/eaglex Graticule dev Sep 06 '16
Looks like it was compiled for Java 1.7 and you have something older.
16
u/andreasschrade Sep 06 '16 edited Sep 06 '16
Yes, that is true! Right now, the plugin works only with 1.8 and above. BUT: I'll make it compatible with Java 1.7 - but it will take a few hours... Sorry :-(
Update: Please ignore my sentence above: The plugin does work with Java 1.7 and Java 1.8. It does only not work with 1.6 or older. Sorry for the false alarm.
8
u/eaglex Graticule dev Sep 06 '16
Hey, it happens, don't worry about it.
You built something really cool, don't ever forget that.
3
u/SirPali Dev @ Egeniq Sep 07 '16 edited Sep 07 '16
Interesting, my JDK is showing as 1.8.0_92 but I'll keep trying! Nice work mate :-)
Edit: Found it! My Info.plist file had records for both 1.6 and 1.7, probably from before the RC release. Edited it to just include 1.7+ and it works like a charm now!
1
9
u/jojocockroach Sep 06 '16
That's a really neat tool. Will definitely install once it's stable on 2.2.
Is there any plans to support crowd sourced contributions? And how is it currently populated if you don't mind me asking?
1
u/deinlandel Sep 09 '16
Hi! This plugin looks awesome. Please add a setting to change key combination. I use ctrl+shift to switch languages, and it looks like it prevents ctrl+shift+d from working. :(
1
u/andreasschrade Sep 10 '16
Thanks for the feedback! I'll try to add such an option. Workaround: If you're interested, you can easily change the key combination in Android Studio:
File -> Settings -> Keymap -> Enter "Enter Command" in the search field.
Make a double click on the search result (Exynap -> Enter Command) and select a new key combination.
1
u/wronganalogy Sep 07 '16
OP, is it like using live templates ?
2
u/andreasschrade Sep 07 '16
It is nearly the same but has the following main differences:
Exynap uses commands instead of live template abbreviations (you do not have to remember the exact template abbrevation)
Exynap supports much more templates than you will find "regular" Android Studio Live templates on earth. :)
The code insertion of Exynap is pretty smart. For example, it can reuse existing local variables and members.
1
1
u/netcyrax Sep 06 '16
Seems really cool, can't wait to try it out! Maybe setup a mailing list or another way to communicate when the plugin will be fixed for 2.2?
1
u/andreasschrade Sep 07 '16
Good idea! I updated the website: You can either use Google+, Twitter or E-Mail (mailing list) to stay updated on the progress.
1
Sep 06 '16
Looks promising. Could use some xml love? like wrap a view inside layout or sth.
Why the requirement to have to be inside a codeblock to start?
1
u/andreasschrade Sep 07 '16
Thanks for the suggestions! Yes, support is planned for xml.
Why the requirement to have to be inside a codeblock to start?
Good question! To be honest, this was a quick solution :) I know, that does not make sense for a command like "create subclass of Activity". But it does make sense if you have selected a Java file and your cursor is inside an import statement. What should happen in this case after you have entered a command?
I'll fine tune this constellation in an upcoming release. Thanks for the feedback!
0
Sep 07 '16
But it does make sense if you have selected a Java file and your cursor is inside an import statement. What should happen in this case after you have entered a command?
I'm not sure what it all means to be 'inside an import statement' but i would think a new line would be a good place to insert new stuff
1
u/spyhunter99 Sep 07 '16
2.1.2 failed to start up
1
u/andreasschrade Sep 07 '16
Do you have any exception message?
Have you installed the plugin from the plugin repository?
Is it possible that you try to use Exynap on Mac with Java 1.6 as runtime? In this case, please take a look here to fix the issue.
1
u/spyhunter99 Sep 07 '16
Plugin 'com.exynap.plugin' failed to initialize and will be disabled. Please restart Android Studio.
com.intellij.diagnostic.PluginException: com/exynap/plugin/idea/base/AppComponent : Unsupported major.minor version 51.0 [Plugin: com.exynap.plugin] at com.intellij.ide.plugins.cl.PluginClassLoader.loadClassInsideSelf(PluginClassLoader.java:130) at com.intellij.ide.plugins.cl.PluginClassLoader.tryLoadingClass(PluginClassLoader.java:77) at com.intellij.ide.plugins.cl.PluginClassLoader.loadClass(PluginClassLoader.java:66) at java.lang.ClassLoader.loadClass(ClassLoader.java:247) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:249) at com.intellij.openapi.components.impl.ComponentManagerImpl.registerComponents(ComponentManagerImpl.java:408) at com.intellij.openapi.components.impl.ComponentManagerImpl.init(ComponentManagerImpl.java:96) at com.intellij.openapi.application.impl.ApplicationImpl.load(ApplicationImpl.java:455) at com.intellij.openapi.application.impl.ApplicationImpl.load(ApplicationImpl.java:447) at com.intellij.idea.IdeaApplication.run(IdeaApplication.java:197) at com.intellij.idea.MainImpl$1$1$1.run(MainImpl.java:52) at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209) at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:715) at java.awt.EventQueue.access$400(EventQueue.java:82) at java.awt.EventQueue$2.run(EventQueue.java:676) at java.awt.EventQueue$2.run(EventQueue.java:674) at java.security.AccessController.doPrivileged(Native Method) at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:86) at java.awt.EventQueue.dispatchEvent(EventQueue.java:685) at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:361) at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:296) at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:211) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:201) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:196) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:188) at java.awt.EventDispatchThread.run(EventDispatchThread.java:122) Caused by: java.lang.UnsupportedClassVersionError: com/exynap/plugin/idea/base/AppComponent : Unsupported major.minor version 51.0 at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClassCond(ClassLoader.java:637) at java.lang.ClassLoader.defineClass(ClassLoader.java:621) at java.lang.ClassLoader.defineClass(ClassLoader.java:471) at com.intellij.util.lang.UrlClassLoader._defineClass(UrlClassLoader.java:260) at com.intellij.util.lang.UrlClassLoader.defineClass(UrlClassLoader.java:256) at com.intellij.util.lang.UrlClassLoader._findClass(UrlClassLoader.java:225) at com.intellij.ide.plugins.cl.PluginClassLoader.loadClassInsideSelf(PluginClassLoader.java:124) ... 26 more
From the plugin repo
mac jdk8 and 7 are installed, i think android studio is using 7
1
u/andreasschrade Sep 08 '16
Thanks, can you please follow this troubleshooting article for OSX? It will only take ~2 minutes. I guess Android Studio is still using Java 6, even though you have installed 7 and 8. Please let me know if that helped.
1
u/spyhunter99 Sep 08 '16
it was 1.6+,1.7+. Changing it fixed the issue. Awesome!
Last question, does this require an active internet connection for it to work? I'd like to use this in an offline, disconnected scenario
1
u/HashFunction Sep 07 '16
This is absolutely amazing! Do you have any plans to add the ability to add our own code snippets? It would be even more incredible if we could add personal implementations that aren't world accessible. Cheers!
1
u/andreasschrade Sep 07 '16
Yes, I will add a functionality soon, that makes it possible to add/change custom snippets. :)
Thanks for the feedback.
1
u/SunshineParty Sep 07 '16
Plug-in looks slick, can't wait to try it out.
Side note: any template that you used to put together the website?
2
u/andreasschrade Sep 07 '16
I used a template from html5up.net - Great site with awesome templates. I give the author credits in the footer.
1
u/andyb129 Sep 07 '16
looks really good, thanks! I've added it to my Android Studio Plugins list here :-) > https://github.com/andyb129/AndroidStudioPluginsNPlay
1
1
Sep 07 '16
also for me, Could not initialize class retrofit.Platform, 2.2 RC (canary channel)
1
u/andreasschrade Sep 07 '16
Which version do you use? 1.0.1 or 1.0.2?
Version 1.0.2 does "hopefully" work on 2.2 RC. Please report if you have still errors with 2.2 RC.
You will find a link to 1.0.2 on the website. Please see the red information text. Thanks
1
Sep 07 '16
The one from the repo via the studio.
1
u/andreasschrade Sep 08 '16
Thanks for the reply. The version from the repo does support 2.2 RC yet. However, I added a new version that supports 2.2 RC. Please see this installation instruction.
1
u/y2k2r2d2 Sep 07 '16
What if the snippets follow a bad practice or pattern?
1
u/m0zzie Sep 07 '16
I was going to ask this too. OP do you have plans of allowing users to submit changes?
1
u/andreasschrade Sep 07 '16
Yes I have plans to allow users changes. I think that is an important step to guarante growth and quality.
1
1
1
1
1
u/matoelorriaga Sep 06 '16
excellent! I already shared it with the rest of the Android team.. thanks!
1
1
1
u/Sxi139 Sep 06 '16
Damn I've bookmarked this to get for when doing another android application.. as im currently working in web this reminds me of how Brackets works. Looks good
1
Sep 07 '16
Were have you been 5 month ago? :D just perfect. Can you share with rest of us how you made this?
1
1
-1
0
u/stevealbright Sep 07 '16
I love the idea of using keywords rather than exact template names.
I could see this plugin expanded to a community backbone to suggest updates, new keywords/templates, etc. ...which would upkeep all the deprecated classes and provide min sdk support etc etc.
Will be testing today! Thanks!!
46
u/andreasschrade Sep 06 '16 edited Sep 06 '16
I created this plugin called Exynap for a simple reason: I'd like to spend more time on the "awesome" parts of app development and less time on Google figuring out how a certain API call works.
Within seconds, Exynap helps you to implement the code to questions like... How can I close the keyboard?, How can I create a notification?, How can I convert px into dp?
Exynap provides thousands of smart code completions!
Check it out and let me know what you think. Exynap!
Update: The plugin does only work with Java 1.7 and Java 1.8!
Update 2: The plugin does not work with Android Studio 2.2 beta yet! A bugfix is on the way.
Update 3: The plugin does also support Android Studio 2.2 beta now! Please see the special installation info on the website.