Monday Nov 11, 2013

Upcoming Enhancements in AngularJS Integration in NetBeans IDE

New bleeding edge enhancements in AngularJS support in NetBeans IDE enable many more controllers to be found than in NetBeans IDE 7.4. The next version of NetBeans IDE parses all JavaScript files and checks for defined AngularJS controllers, such as the below:

All recognized AngularJS controllers are offered in code completion, as shown below.

In other words, code completion works better in finding AngularJS controllers.

Another improvement is in the "Go To Declaration" feature. When you click Ctrl+Mouse over the name of a controller inside an NG-controller directive, you will be navigated to the related controller declaration.

More accurate results can be shown in code completion mainly because there are changes in the generation of JavaScript virtual sources in an AngularJS page.

Other awesome AngularJS features, already in NetBeans IDE 7.4:

Sunday Nov 10, 2013

Screencast: "Unlocking the Java EE Platform with HTML5"

The Java EE platform aims to increase your productivity and reduce the amount of scaffolding code needed in Java enterprise applications. It encompasses a range of specifications, such as JPA, EJB, JSF, and JAX-RS. How do these specifications fit together in an application, and how do they relate to each other? And how can HTML5 be used to leverage Java EE?

In this recording of a session I did last week at Oredev in Malmo, Sweden, you learn how Java EE works and how it can be integrated with HTML5 front ends, via HTML, JavaScript, and CSS.

Saturday Nov 09, 2013

Two Sessions All Humans Should Watch Right Now

At conferences, I definitely prefer technical sessions over any other kind of session. That's partly because I want to walk away from a conference with new libraries and APIs to play with, such as the AT&T ARO tool that I've been blogging about over the past few days thanks to being introduced to it in a great session by Doug Sillars at Oredev, in Malmo, Sweden.

I only say the above to set the scene. And the scene is that I avoid sessions that deal with "agile topics" or whatever that means. I mean those sessions where you're meant to reflect on some way you're developing nothing in particular and then come away with new ways of doing that. I avoid those. Not because I don't necessarily like those or think I have nothing to learn, both of which I don't (or do, depending on how you read double negatives), but because there are so many sessions to attend that I focus on those that actually give me more technical knowledge that I can do something with immediately.

Having said all that, here's two absolutely wonderful sessions (and probably many more but I really liked these two) presented at Oredev over the last few days, one by JB Rainsberger and the other by Woody Zuill, both very nice people who I met for the first time during the last few days, and who aren't paying me to promote them, and who're still struggling to figure out how to say my name.

Whether you're a developer or manager or whatever you are, take this on trust, and simply watch these screencasts, hey, at most you're going to lose two hours of your life that you would've spent doing something else:

Speaking for myself, I'm going to be watching both these presentations again several times in my life, that's for sure.

Friday Nov 08, 2013

Notes from AT&T ARO Session at Oredev 2013

The mobile internet is 12 times bigger than internet was 12 years ago. Explosive growth, faster networks, and more powerful devices. 85% of users prefer mobile apps, while 56% have problems. Almost 60% want less than 2 second mobile app startup.

App with poor mobile experience results in not buying stuff, going to competitor, not liking your company. Battery life. Bad mobile app is worse than no app at all because it turns people away from brand, etc. Apps didn't exist 10 years ago, 72 billion dollars a year in 2013, 151 billion in 2017.

Testing performance. Mobile is different than regular app. Need to fix issues before customers discover them. ARO is free and open source AT&T tool for identifying mobile app performance problems. Mobile data is different -- radio resource control state machine. Radio resource control -- radio from idle to continuous reception -- drains battery, sends data, packets coming through, after packets come through radio is still on which is tail time, after 10 seconds of no data coming through radio goes off. For example, YouTube, e.g., 10 to 15 seconds after every connection, can be huge drain on battery, app traffic triggers RRC state.

Goal. Balance fast network connectivity against battery usage. ARO is free and open source and test any platform and won awards. How do I test my app? pcap or tcdump network. Native collector: Android and iOS. Android rooted device is needed. Test app on phone, background data, idle for ads and analytics. Graded against 25 best practices. See all the processes, all network traffic mapped to processes, stats about trace, can look just at your app, exlude Facebook, etc. Many tests conducted, e.g., file download, HTML (wrapped applications, e.g., cordova).

Best Practices.

  • Make stuff smaller. GZIP, smaller files, download faster, best for files larger than 800 bytes, minification -- remove tabs and commenting -- browser doesn't need that, just give processor what it needs remove wheat from chaff. Images -- make images smaller, 1024x1024 image for a checkmark, swish it, make it 33% smaller, ARO records the screen, probably could be 9 times smaller.

  • Download less stuff. 17% of HTTP content on mobile is duplicate data because of caching, reloading from cache is 75% to 99% faster than downloading again, 75% possible savings which means app will start up faster because using cache -- everyone wants app starting up 2 seconds.

  • Make fewer HTTP requests. Inline and combine CSS and JS when possible reduces the number of requests, spread images used often.

  • Fewer connections. Faster and use less battery, for example, download an image every 60 secs, download an add every 60 seconds, send analytics every 60 seconds -- instead of that, use transaction manager, download everything at once, reduce amount of time connected to network by 40% also -- 80% of applications do NOT close connections when they are finished, e.g., download picture, 10 seconds later the radio turns off, if you do not explicitly close, eventually server closes, 38% more tail time, 40% less energy if you close connection right away, background data traffic is 27% of data and 55% of network time, this kills the battery.

  • Look at redirection. Adds 200 to 600 ms on each connection, waterfall diagram to all the requests -- e.g., redirect to redirect to to, waterfall visualization of packets, minimize redirects but redirects are fine.

  • HTML best practices. Order matters and hiding code (JS downloading blocks rendering, always do CSS before JS or JS asynchronously, CSS 'display:none' hides images from user but the browser downloads them which adds latency to application.

  • Some apps turn on GPS for no reason. Tell network when down, but maybe some other app is using the radio at the same time.

It's all about knowing best practices: everyone wins with ARO (carriers, e.g., AT&T, developers, customers). Faster apps, better battery usage, network traffic better, better app reviews, happier customers. MBTA app, referenced as an example.

ARO is free, open source, can test all platforms.

Thursday Nov 07, 2013 on Ubuntu for AT&T ARO

I now have AT&T ARO also running on Ubuntu, in addition to the Windows scenario I blogged about earlier:

I managed to get it up and running thanks again to Doug Sillars, who pointed me here:

My plan is to make a screencast soon on HOW to port something like ARO, i.e., as an example of how to do something similar yourself, to a plugin for NetBeans IDE, as a follow up to Five Simple Ways to Extend NetBeans IDE.

Thanks again, Doug.

Wednesday Nov 06, 2013

Vodacom Call Center Management on the NetBeans Platform

If you live in South Africa, you know about Vodacom. Vodacom is one of the dominant mobile communication companies in South Africa, and beyond, providing voice, messaging, data, and similar mobile services. Inside Vodacom there's an application named Helios, which is a call centre application that had its inception in 2009 and consists of two parts.

Firstly, a web-based front-end that allows a call centre agent to service subscribers using a Google-like search on a knowledge base structured as a collection of FAQs. The web-based front-end uses plain-old HTML + CSS + a good helping of JQuery and JQueryUI. This is delivered via JSR-168 portlets running on a cluster of IBM Portal 6 servers. In turn, the portlets communicate via RMI with several back-end EJB's containing the business logic. These EJB's are deployed on a cluster of Weblogic Application Servers, version 10.3.6.

The second part is a NetBeans Platform application used for maintaining and constructing the knowledge base, i.e., the back-end of the web-based front-end. Helios is also used for a number of other maintenance functions, such as access permissions, user maintenance, and news bulletins.

Below, in the web-based front-end, call centre agents can enter search terms and are presented with a number of FAQs from the knowledge base. Upon selecting a FAQ article, the agent is presented with the article text, the process to guide the subscriber, system checks that display information specific to the subscriber, and links to related applications and articles:

Below, you can see that applications are searchable and can be accessed using the same web-based front-end as shown above.

And, as can be seen below, knowledge base FAQs are maintained using the Helios Maintenance Application, which is the Vodacom application built on the NetBeans Platform:

Several thousand call centre agent user accounts are administered using the Helios Maintenance Application. Below the main FAQ page is shown, together with the About dialog:

Vodacom is happy with the back-end NetBeans Platform application. However, the front-end stack runs on quite old technology. Ideally Vodacom would like to migrate the portlets to Oracle Weblogic Portal or Oracle WebCenter, but this hasn't been accomplished yet. Migrating makes sense as the rest of the application server environment consists entirely of Oracle products.

Tuesday Nov 05, 2013

AT&T Application Resource Analyzer in NetBeans IDE

Here at Øredev in Malmö I met Doug Sillars who does developer outreach for the AT&T Application Resource Optimizer. In this YouTube clip you see Doug explaining how it works and what it can do for optimizing performance of mobile applications.

There's a free and open source Android app on GitHub that you can install on Android to collect data and then there's a Java Swing application for analyzing the results. And here's what that application looks like as a plugin in NetBeans IDE, click to enlarge the image, which shows the Android sources of the Data Collector, as well as the Data Analyzer ready to be used to collect data:

Since the ARO Data Analyzer is written in Java and has JPanels defining its UI layer, integrating the user interface wasn't hard. Now working on the Actions, so there'll be a new ARO menu with start/stop data collecting menu items, etc, reusing as much of the original code as possible. That part is actually already working. I started up an Android emulator, then started the data collection process from the IDE. I'm also able to stop the data collection process from the IDE. Now I need to include the Actions for importing the data into the analyzer, together with a few other related features.

A pretty cool feature in ARO is video capture, so that a movie can be made by ARO of all the steps taken on the device during the collection process, which is also nice to have integrated into the NetBeans plugin:

Ultimately, this will be handy for anyone creating Android applications in NetBeans IDE since they'll be able to use AT&T's ARO tool for debugging and optimizing the performance of the applications they're developing. It will also be useful for those using the built-in Cordova tools in NetBeans IDE to create iOS applications because ARO is also applicable to analyzing iOS application performance.

Monday Nov 04, 2013

Groovy Grapes in NetBeans IDE

The start of Groovy Grapes support in NetBeans IDE. Below you see a pure Groovy project, with the Groovy JAR and the Ivy JAR automatically on its classpath. There's also a Groovy script that makes use of a @Grab annotation. In the bottom left, in the Services window, you also see a Grape Repository browser, i.e., showing you the JARs that are currently in ".groovy/grapes". Click the images below to get a better look at them.

Next, you see what happens when the project is run. The @Grab annotation automatically starts downloading the JARs that are needed and puts them into the ".groovy/grapes" folder. However, the "no suitable classloader found for grab" error message (which Google shows is a problem for lots of developers) prevents the application from running successfully:

The final screenshot shows that I've put the JARs that I need onto the classpath of the project. I did that manually, hoping to learn from the NetBeans Maven project or the NetBeans Gradle project how to do that automatically. Also note that the @Grab annotation has been commented out. Now the error message about the classloader is avoided and the project runs.

What needs to happen for Groovy Grapes support to be complete in NetBeans IDE:

  • Figure out how to add the downloaded JARs to the project classpath automatically.
  • Fix the refresh problem in the Grape Repository browser, i.e., right now the refresh doesn't happen automatically yet.
  • Hopefully find a way to get around the grab classloader problem, i.e., it's not ideal that one needs to comment out the annotation.
  • Let the user specify a different Grape repository, i.e., right now ".groovy/grapes" is assumed, but the user should be able to point the repository browser to something different. Maybe there should be support for multiple Grape repositories?

Comments/feedback/help is welcome.

Sunday Nov 03, 2013

Dart and NetBeans IDE 7.4

Here's the start of Dart in NetBeans IDE. Basic Dart editing support is done and on saving a Dart file the related JavaScript files are automatically generated. In the context of an HTML5 application in NetBeans IDE, that gives you deep integration with the embedded browser and, even better, Chrome, as well as Chrome Developer Tools.

Below, notice that the "Sunflower Spectacular" H1 element is selected (click the image to enlarge it to get a better view), which is therefore highlighted in the live DOM view in the bottom left, as well as in the CSS Styles window in the top right, from where the CSS styles can be edited and from where the related files can be opened in the IDE. Identical features are available for Chrome, as well as on Android and iOS. And if you like that, watch this YouTube movie showing how Chrome Developer Tools integration can fit directly into the workflow below.

Anyone want to help get this plugin further? What's needed:

  • Much deeper Dart editing support, i.e., right now only very basic syntax coloring is provided, i.e., an ANTLR lexer is integrated into the NetBeans syntax coloring infrastructure. Parsing, error checking, code completion, and some small code templates are needed.
  • A new panel is needed in the Project Properties dialog on NetBeans HTML5 projects for enabling Dart (i.e., similar to enabling Cordova), at which point the "dart.js" file and other Dart artifacts should be added to the project, so that a Dart project is immediately generated and the application should be immediately deployable.
  • Whenever changes are made to a Dart file, Dart should run in the background to create the Dart artifacts in some hidden way, so that the user doesn't see all the Dart artifacts as is currently the case.
  • Some way of recognizing Dart projects (there's a YAML file as an identifier) and creating NetBeans HTML5 projects from that, i.e., from Dart projects outside the IDE.

I think that's all...

The official Dart Editor is based on Eclipse and requires a massive download of heaps of Eclipse bundles. Compare that to the NetBeans equivalent, which is a very small "HTML5 and PHP" bundle (60 MB), available here, together with the above small Dart plugin. Plus, when you look at how NetBeans IDE integrates with a bunch of Google-oriented projects, i.e., Chrome, Chrome Developer Tools, and Android (via Cordova), that's a pretty interesting toolbox for anyone using Dart. And bear in mind that ANTLRWorks, Microchip, and heaps of other organizations have built and are building their tools on top of NetBeans!

Saturday Nov 02, 2013

YouTube: CoffeeScript Rocks (in NetBeans IDE)

CoffeeScript is a handy preprocessor for JavaScript, as shown in a quick demo below on YouTube, using the CoffeeScript plugin for NetBeans IDE.

Right now, the NetBeans Plugin Portal doesn't have a CoffeeScript plugin for NetBeans IDE 7.4, but not to worry, the NetBeans IDE 7.3 plugin works just fine.

Here's a small YouTube clip I made today showing how it all works:

Also read this very handy and detailed NetBeans tutorial, on which I based the demo above:

Related info:

Friday Nov 01, 2013

YouTube: iReport for NetBeans IDE 7.4

A few days ago the iReport Team announced the new 5.5.0 iReport release. With it comes the latest iReport plugin for NetBeans IDE 7.4. The NetBeans iReport plugin is by FAR the most downloaded plugin on the NetBeans Plugin Portal. Here's a direct link to it:

I installed the plugin into NetBeans IDE 7.4 today and made this small (and silent) movie of the main cool features I found. Sorry it's a bit blurry, comes from conversion from MPEG to AVI.

Many thanks to Giulio Toffoli from Jaspersoft for continually enhancing the plugin from release to release, it's really awesome, provides a massive bunch of reporting features, fully justifying the popularity of this plugin.

Some documents, more or less up to date, that should help, after following the screencast above:

Also, note that YouTube is pretty much flooded with movies on NetBeans and iReport:


Geertjan Wielenga (@geertjanw) is a Principal Product Manager in the Oracle Developer Tools group living & working in Amsterdam. He is a Java technology enthusiast, evangelist, trainer, speaker, and writer. He blogs here daily.

The focus of this blog is mostly on NetBeans (a development tool primarily for Java programmers), with an occasional reference to NetBeans, and sometimes diverging to topics relating to NetBeans. And then there are days when NetBeans is mentioned, just for a change.


« November 2013 »