Thursday, December 20, 2012

source.dir property

What's new: thanks to Steve Roy's input NBAndroid now recognizes source.dir property that can be specified in one of Ant properties files. Previously the name of directory containing sources was hard-coded to src and now it can be overriden and can even point to a location outside from the project directory. Steve assembled a simple test case for this and it is always helpful to have such a starting point. Now it is part of our testing suite.

Tuesday, December 11, 2012

Project versions

Recent updates brought larger changes and you can see a jump in module version numbers. That's a result of my changes in Jenkins setup that automatically assigns new module version to each build. When the build is promoted (assuming it passes automated tests) the version remains intact. This solution reduces overhead related to release management and gives a little bit more time to development.

Sunday, November 25, 2012

Library projects again

You can see new version of NBAndroid plugin on our auto-update center again. This time there is a fix for classpath resolving to find correctly sources belonging to Android library projects.

I noticed the bug few days ago and probably it was caused by a change in build process that creates a copy of AndroidManifest.xml file in bin directory now. This confused our plugin that expected there is another nested project. Anyway the problem is resolved now.

Together with this change there I integrated a (slightly modified) patch from Steve Roy to give you direct access to either AVD manager or SDK manager.

Tuesday, November 20, 2012

Migrated to SDK tools release 21

There is a new update for NBAndroid plugin that contains updated versions of Android SDK libraries. This is good because there were some small incompatible changes in SDK and those newer libraries will help us to handle them. All the basic stuff seems functional now and layout preview is working in this version as well.

Sunday, November 18, 2012

Where is my

The most common question related to Android development in NetBeans these days is 'where is my'

Simple answer: Don't worry, it is not there and it will be created once you build the project.

Why is this so and what is this class for? in your project is a class generated during the build to provide an access to various resources used in your application from Java code. You can find details in in Android developers documentation. For example you will most likely store strings used by your application in res/values/string.xml file. They will be referenced in Java code by identifier defined inside this R class.

Now when the skeleton Android project is created it already contains some of these resources and the Java code for generated activity uses these resource knowing how the generated identifiers look like. Their R class is in the package specified in AndroidManifest.xml file and it is the same package as the main activity uses in this generated code. It means there is no need to modify the source by importing this class. The reason why those as shown as errors is that there was no build to generate (and then compile it to .class and package into .dex and finally create application file .apk) yet. As described above all will be resolved during the build. We may decide to run priming build right after project generation in the future but there are many other more important tasks at the moment.

Note: there is also android.R class. Its purpose is the same as R class defined in your project. It contains references to resources defined in the system. You will use it sometimes to reuse parts of UI to keep the user experience consistent.

Thursday, November 15, 2012

SDK Tools 21

Android team released a new version of their SDK tools - r21. While the main plugin functionality should be mostly compatible I will need some time to update NBAndroid completely. There are various refactorings in the tools area and those need to be reflected.

Tuesday, November 6, 2012

Early version of preview functionality

Just look for Window | Output | Android Layout Preview menu item in the last update. It is raw functionality but hopefully someone will find it useful.

Sunday, October 14, 2012

Layout preview refining

There are few improvements since the last week in my current branch. It is possible to render some layouts using custom view classes and customize the view to display output according to selected device configuration and Android version. Also there is a possibility to switch language and region settings, landscape/portrait and dock modes. The whole thing seems more stable now.
What remains on my list to be done before I create first public version:

  • Polish the UI (including error reporting when something goes wrong because there are plenty of ways how things can end up badly).
  • Theme support for platform and project themes.
  • Better integration with the editor to be able to update after save or possibly as you type.
Things that will be part of future updates:

  • Fragment support.
  • Maven project support (if there is demand).
  • Zooming in preview.

Sunday, October 7, 2012

Progress on layout preview

Here is a teaser. I resumed my older attempt to create a preview support for Android UI layouts. As you probably know other IDEs are better in this area so it is time to close the gap a bit.

Of course what you can see on the picture is not ready for general consumption yet but I'd like to make some restricted version available soon. Incomplete list of things that need to be done looks like this:
  • Fix UI glitches in sizing and positioning of rendered layout, better integrate into NetBeans window system and generally provide better feedback. 
  • More complete set of customization controls to let you select locales, modes, themes, and so on.
  • The prototype works for layouts using widgets from SDK and is not aware of project items. It needs to parse and resolve project resources and be able to instantiate project classes.
  • Tie it together with editor and refresh the layout as the source file is edited.
  • Probably there is more like ability to display fragments.
  • Far ahead is GUI designer where you can edit layout.
While there can be some sponsoring for this feature it is still voluntarily work. The code is open source and available in the repository even for this branch. It means people can contribute. Monetary contribution are also accepted (see the donate button on the right side?). At the end I am also considering an option to distribute the GUI support for some small amount of money only.

Saturday, September 29, 2012

Lint support included

Another awesome news! NBAndroid now has support for Android lint tools that helps you create better applications. I mean real support that integrates lint with the IDE and shows patterns detected by lint in the editor.

This change wouldn't be there without the work done by NetBeans experts who knows how to extend editor functionality. Thanks for that! There is one small downside: the integration assumes that the plugin runs in NetBeans 7.2 (or newer build). It also means it is available from our update center It is quite likely that the old update center will remain alive only as legacy for users of older IDE versions and new updates will be deployed to this new URL.

Friday, June 29, 2012

Did you ask for Maven?

NetBeans team just announced availability of 7.2 release candidate build. This is a good news for NBAndroid project because now we can publish a new version that will be interesting to Maven users. They will be able to use improved XML editors in their Maven project used to develop Android application.

The only problem is that this new version depends on some changes introduced in NetBeans 7.2. That's why I keep existing update center and installation procedure for all user of NetBeans 6.9, 7.0, and 7.1 untouched at the moment. Meanwhile I've set up a new download center for those who want to try this Maven intergation:

  • add URL as an autoupdate center in Tools | Plugins | Settings
  • go to Available plugins, find Android here and install the plugin
  • make sure Android SDK location is set in Tools | Options | Miscellaneous | Android (it is not read from Maven settings file yet)
  • check how the editors in your projects depending on work
That's it. Share the news & enjoy this new feature. As always feedback is welcomed.

Friday, March 30, 2012

Donations update

My huge thanks to all those folks who made a donation to this project. There are less than 10 of them and the average amount is smaller than 15 EUR. All these contributions are appreciated.

I see that some people are not happy and do not see that there ain't no such thing as a free lunch but I do not mind. As you can see there are some updates to keep the plugin uptodate. And there are people who report their real problems and I am trying to address at least some of these. Recently we had some fixes in the area of classpath handling because the latest SDK tools release brought some interesting changes again.

There are few ideas what to do next to improve the plugin:

  • Add layout preview functionality. Eclipse has GUI editor for layout and IntelliJ has at least preview. We can get on par with IntelliJ.
  • Better XML editing. Basic Java support work but all these special XML files are what makes Android development different from usual Java coding.
  • Lint integration. 
  • Maven support.
  • Many smaller things around device control, logcat support.
  • Better testing support. The one that we currently have is pathetic.
I had a vague promise to get help on the first and the third items (XML preview and Lint) but nothing material is available. It can be the best to ignore them and just write it from scratch.

Maven support is not likely to be addressed by me. I am free to help but I am not Maven fan boy.

Yet I am busy most of the time. Contributions are welcome.

Thursday, March 22, 2012

Problem with SDK tools r17

There is a small problem with latest version of Android SDK tools revision 17. It will not bother you if your project doesn't use any JAR dependencies. As reported in our JIRA the output of our build misses classes from JAR libraries that are contained in libs folder of your project. Note the content of JAR referenced by library projects is included correctly.

I initiated some discussion on ADT-dev mailing list to see if there is a chance to fix this problem and will look for some solution. Meanwhile there is a workaround to set the working directory for your IDE to your project directory (simply start it from this directory). Or more complex one can be to create an Android Library project and move these JAR there.

Wednesday, March 21, 2012

Classpath tuning

I noticed an ugly problem with our classpath implementation this week while working on my Android application (Fireside Talk - a native client for Campfire). I moved some code into a lib-project and added a JAR library there. As a result my main project couldn't see classes from this JAR although the dependency was correctly processed. The project was built but the IDE support (editor, navigation) was affected. This is fixed now and you will see plugin update notification soon.

Please be patient. There is some problems with our autoupdate center hosted on Requests for plugin catalog are redirected and IDE is not processing them correctly. I will look for some solution and post an update soon.