If you search for how to upload a file to a JAX-RS 2 endpoint, most suggestions will point you to implementation-specific approaches. While that works, it defeats one of the purposes of a spec: portability. There are some posts out there that will point you in the right direction, though. What I’ll do here, then, is present a clear, portable solution to the problem.
I was recently sent a copy of Java EE and HTML5 Enterprise Application Development by John Brock, Arun Gupta, and Geertjan Wielenga. This is my review of the book.
50 Android Hacks by Carl Sessa is, as you may have deduced from the title, a collection of 50 tips and tricks to help Android developers of all skill levels handle a variety of problems. For the most part, I found the book very helpful. Before I get to that, I have a minor quibble: I’m not sure "hacks" was the best choice of words. I understand the marketing aspect of it, but when I hear "hack", I think of a piece of code I’m embarrassed to share with someone else, of something I’d prefer to hide. These "hacks" seem anything but. Clean, clear, efficient, something to be proud of. It’s a minor quibble, of course, but there it is. :)
The book itself is pretty easily laid out. If you’ve read a "cookbook", then you should be comfortable and familiar with the basic layout. Each chapter is a different tip, which range from the "easy" (e.g., centering text in a view) to the more advanced (e.g., using the SyncAdapter). The topics covered include layouts, animations, build tools and more.
I read this, appropriately enough, using the Kindle App on my Android tablet, and the experience was very good. I’ve read several programming books on my tablet, and they usually have issues with unreadable source code, large blanks due to content flow issues, etc. Some of this is affected, of course, by the font size and is fixable, but I saw none of those issues here. All of the source, both XML and Java, were neatly formatted and readable, with no odd, jarring line wrap issues. The graphics were crisp and readable, and the pages were neat and clean.
This is a great book, especially for beginning to intermediate Android developers, but I’d wager that there’s something here for just about everyone.
If you’re like me, you have your source code hosted in a hosted environment (such as Bitbucket), but you have a local continuous integration server (such as Jenkins). It would be really nice if you could have Jenkins build your project every time you commit, but without the heavy requirement of polling your repo. In this post, I’ll show you how to integrate the two to do just that.
I recently ran across a couple of pretty cool libraries for creating command-line tools: Airline from the Airlift project, and crest from Tomitribe. Having spent the last few years working on administration for GlassFish, this is an area near and dear to my heart, so I thought I’d cobble together a quick example using each to see how usable they are.
I’ve been getting a number of bug reports from my app Cub Tracker that had me stumped. I was getting NullPointerExceptions where I shouldn’t be. After some digging, I think I finally found the culprit: device rotation. While rotating the device does, indeed, trigger the error, it goes deeper than that. My problem is that the app doesn’t correctly save the state of the view, which becomes problematic when, for example, the device is rotated. In trying to fix that, I discovered I don’t understand the Android lifecycle as well as I should, so I set out to fix that.
As is my custom, I want to thank all of my readers, especially those who have joined the discussion, and wish you all a merry Christmas. In all the hustle of the season, it is my hope and prayer that the joy and peace brought to us in the person of Jesus Christ will be an ever-present blessing in your lives.
In trying to come up to speed on Ceylon, I’ve run into some issues with module import dependencies. I’m pretty sure they’re all pilot error, but it was suggested that I import the jars into the Ceylon repository and specify the dependencies between the modules. This would, effectively, be functionally the same as the <dependencies>
element in the Maven POM. In classic geek, over-engineer-the-solution fashion, I cobbled together this shell script. It could be more elegant, but it seems to work, and it was much simpler than a Java implementation using the Maven APIs. :)
Last week at Devoxx, Red Hat announced the release of Ceylon 1.0, "a modern, modular, statically typed programming language for the Java and JavaScript virtual machines." A fan of learning languages, I started taking the tour. In no particular order, and without any lengthy rumination, here are my initial thoughts on the language.
I recently acquired a copy of Instant Vert.x (Kindle version here) by Simone Scarduzio. It’s a short book (54 pages), so here’s my short-ish review. :)