Articles Tagged ‘tutorial’

Creating updatable Java Applications using Getdown and the Getdown Maven Plugin

Sunday, May 27th, 2012

Many programmers have suffered when trying to setup an environment to handle updates for their application without much effort. Some tried Java Web Start for this purpose and many encountered difficulties with this approach.

Now there is getdown that aims to replace Java Web Start by offering a simple architecture to handle updates that is fast, realiable and the only thing you need is a normal http server. Though getdown lets us handle our updates really easy it is possible to make this process even easier with the getdown maven plugin.

In the following example we’re building a simple swing application to be installed, updated and launched using getdown.

(more…)

Wiring made easy using OSGi Blueprint and Apache Karaf

Monday, April 16th, 2012

The OSGi Blueprint Container specification allows us to use dependency injection in our OSGi environment, declarative import and export of OSGi services, registering lifecycle listeners and wiring dependencies into our services with a few lines of XML code.
In the following tutorial we’re first building an OSGi bundle classical style and afterwards take a trip into the advantages of the Blueprint specification.

Our OSGi container of choice here will be Apache Karaf a lightweight container with a lot of nice features and – of course – blueprint enabled…

(more…)

Hibernate Search Faceting: Discrete and Range Faceting by Example

Monday, March 26th, 2012

In today’s tutorial we’re exploring the world of faceted searches like the one we’re used to see when we’re searching for an item on Amazon.com or other websites. We’re using Hibernate Search here that offers an API to perform discrete as well as range faceted searches on our persisted data.

(more…)

Snippet: Mixing Scala, Java in a Maven Project

Friday, March 23rd, 2012

Having just returned from the Atlassian Camp 2012 I just toyed around with Java and Scala and wanted to share the following snippet that demonstrates how to mix code from both languages in a Maven project using the maven-scala-plugin.

(more…)

Using the Android Fragment API in a Tablet App

Sunday, March 18th, 2012

Since I got a new tablet running Android 4.0 aka ice cream sandwich I wanted to play around a bit with the fragments API and creating an application for a tablet.

In the following tutorial, we’re going to build an application that renders several articles from a popular tech blog (just kidding) in a web view.

(more…)

Android Widget Tutorial: Creating a screen-lock Widget in a few steps

Thursday, October 6th, 2011

hasCode Android Widget Tutorial Logo In today’s Android tutorial we’re going to take a look at Android’s Widget API and how to make a widget interact with a service using intents.

We’re going to create a fully functional application that allows us to enable or disable our smartphone’s screen lock settings using a widget that can be placed on our  home screen.

Finally I am going to show how to use a smartphone to test and debug our application and connect it to the IDE.

(more…)

Screenscraping made easy using jsoup and Maven

Tuesday, August 30th, 2011

Sometimes in a developer’s life there is no clean API available to gather information from a web application .. no SOAP, no XML-RPC and no REST .. just a website hiding the information we’re looking for somewhere in its DOM hierarchy – so the only solution is screenscraping.

Screenscraping always leaves me with a bad feeling – but luckily there is a tool that makes this job at least a bit easier for a developer .. jsoup to the rescue!

(more…)

Creating Portlets using Java Server Faces 2 and Liferay

Tuesday, July 19th, 2011

Portlets are a common technology to create plug&play components for modern web applications and are specified by the Java Community Process in several specification requests.

In the following tutorial we’re going to learn how to create custom portlets and how to deploy and embed them in Liferay, the popular open-source enterprise portal.

In addition we’re taking a look at inter-portlet-communication and how to create portlets using annotations.

Finally we’re building a portlet-state-aware Java-Server-Faces portlet using the  jsf-portlet-bridge mechanism.

(more…)

Message Driven Beans in Java EE 6

Sunday, June 5th, 2011

Message Driven Bean Tagcloud Message Driven Beans are no new concept due to the fact that they exist since EJB 2.0 but in Java EE 6 and the EJB 3.0 specification it is even more fun to use them.

In this tutorial we’re going to take a look at the specification and create an example application that transfers some objects via the Java Message Service to a Message-Driven Bean deployed on a GlassFish application server.

If you’re not interested in theory please skip to chapter 6 and directly start creating an application – otherwise we’ll begin with a short introduction into the JMS terminology and the concept of a Message-Driven-Bean..

(more…)

Oh JBehave, Baby! Behaviour Driven Development using JBehave

Tuesday, May 31st, 2011

Behaviour Driven Development Keyword Map

Behaviour Driven Development is the keyword when we’re talking about test scenarios written in an ubiquitous language, strong interaction with stakeholders, product owners or testers and well described, common understandable test scenarios.

The popular JBehave framework is our tool of choice here and allows us to decouple our test stories from the test classes, offers an integration for web tests using Selenium and finally there’s a helpful Maven plugin for JBehave, too.

After a short excursion into the principles of Behaviour Driven Development we’re going to write and implement test stories for simple acceptance tests and web tests using selenium.

(more…)

Creating a sample Java EE 6 Blog Application with JPA, EJB, CDI, JSF and Primefaces on GlassFish

Tuesday, February 8th, 2011

Java EE 6 is out and it indeed offers an interesting stack of technologies. So in today’s tutorial we are going to build a small sample web application that builds on this stack using Enterprise JavaBeans, Java Persistence API, Bean Validation, CDI and finally Java Server Faces and PrimeFaces.

The application we’re going to develop is a simple blog app that allows us to create new articles, list them and – finally delete them. We’re also covering some additional topics like JSF navigation, i18n, Ajax-enabled components and the deployment on the GlassFish application server.
(more…)

Enterprise Java Bean / EJB 3.1 Testing using Maven and embedded Glassfish

Saturday, January 1st, 2011

Topics covered by this tutorial Are you playing around with the shiny new 3.1 EJB API?

Using Maven for your Java projects?

Need an easy way to write and execute tests for your EJBs that depends on an Java Application Server?

No problem using Maven Archetypes, the Maven EJB Plugin and the GlassFish embedded Application Container..

(more…)

Bean Validation with JSR-303 and Hibernate Validator

Tuesday, December 14th, 2010

You want to add some validation logic to your Java beans? You want to achieve this with some shiny extendable annotations? Then give the Java Bean Validation standard aka JSR-303 a try..

We’re going to use the reference implementation for bean validation, Hibernate Validator in this tutorial but there are also links to other alternatives like Oval or Apache Bean Validation.

So let’s begin and validate some stuff ..
(more…)

Creating a REST Client Step-by-Step using JAX-RS, JAX-B and Jersey

Thursday, November 25th, 2010

Often in a developer’s life there is a REST service to deal with and nowadays one wants a fast and clean solution to create a client for such a service.

The following tutorial shows a quick approach using JAX-RS with its reference implementation, Jersey in combination with JAX-B for annotation driven marshalling between XML or JSON structures and our Java-Beans.

(more…)

Using PrimeFaces to pimp up existing Java Server Faces / JSF 2 Applications

Sunday, November 14th, 2010

In this tutorial we’re going to modify an existing Java Server Faces / JSF 2 web application by adding rich UI components to the existing layout.

Our tool of choice here is the PrimeFaces framework. It offers a wide range of interesting, customizable and (several) Ajax-enabled components that blend very well with JSF1+2  and also a solid documentation that allows a quick integration into existing projects.
(more…)

How to create a Confluence SOAP Component in 5 Minutes

Sunday, October 24th, 2010

You’re using the popular Confluence wiki? You’re using its RPC/SOAP API and missing a function you really need? Just extend the  capabilities of the Confluence RPC API by programming a custom web service component – it is really easy and also well documented.

In this tutorial we’re going to take a look on how to quickly implement a SOAP service, securing it and putting its methods in a transactional context.

(more…)

Object-relational Mapping using Java Persistence API / JPA 2

Monday, October 11th, 2010

Today we’re going to take a look at the world of object-relational Mapping and how it is done using the Java Persistence API by creating some basic examples, mapping some relations and querying objects using JPQL or the Criteria API..

(more…)

Playing around with the Android Animation Framework

Monday, September 27th, 2010

Animations add some spice to our Android applications and the offered animation framework makes it easy to create custom animations and tweens.

So lets dance around and create some animations ;) ..

(more…)

Creating a SOAP Service using JAX-WS Annotations

Thursday, September 23rd, 2010

It is possible to create SOAP webservices with only a few lines of code using the JAX-WS annotations. In a productivity environment you might prefer using contract-first instead of code-first to create your webservice but for now we’re going to use the fast method and that means code-first and annotations olé!

(more…)

How to create an Android App using Google’s App Inventor

Wednesday, August 4th, 2010

Today we’re going to take a look at Google’s App Inventor feature that offers programming-novices a nice possibility to enter the fabulous world of Android App programming without deeper knowledge of the API or complex SDK installations.

So lets build some stuff ..

(more…)

How to create a simple OSGi Web Application using Maven

Sunday, July 25th, 2010

In this tutorial we will take a look at the development of a simple OSGi Web Application and what tools can save us some time.

The Maven Bundle Plugin makes our life much easier here as does the OSGi Bundle Repository that offers some nice bundles – in our case the servlet API and an embedded Jetty web server.

So lets develop some bundles ..

(more…)

How to create a Template Bundle Plugin in Confluence

Monday, July 12th, 2010

Since Confluence 3.2. there is a new plugin module type that allows you to deploy templates in a bundle via the plugin API.

In addition it is possible to assign these templates to specific spaces and preview available templates in the Confluence administration area.

So let’s build some sample templates..

(more…)

A look at Google’s Protocol Buffers

Tuesday, July 6th, 2010
Protocol Buffers are a serialization format developed by Google- you might ask if another IDL is really needed here – is Google barking at the wrong tree?
But protocol buffers offer some advantages over data serialization via XML or JSON – Google says they (compared to XML)..
  • are 3 to 10 times smaller
  • are 20 to 100 times faster
  • provide generated data access classes for programmatic use
  • provide backward compatibility
So lets play around a little with protocol buffers in Java and build a small application that serializes and deserializes some data using a defined format..

Java Server Faces/JSF 2 Tutorial – Step 1: Project setup, Maven and the first Facelet

Saturday, June 5th, 2010

In this short tutorial we are going to build a Java Server Faces Web-Application using JSF2.0, Facelets, Maven and Hibernate as ORM Mapper.

The goals for this first step are: Setting up the project structure using Maven, defining a frame template/decorator and a registration facelet, creating a managed bean and mapping it’s values to the facelet, adding some basic validation, displaying validation errors and finally adding a navigation structure.

In step2 of this tutorial we are going to add persistence using Hibernate, add some security, create a custom UI component and add some AJAX.

The Mojarra JSF implementation is used for this tutorial – perhaps I’m going to post more about the MyFaces implementation in another tutorial.

(more…)

Sensor Fun: Location Based Services and GPS for Android

Sunday, May 30th, 2010

The Android SDK offers a nice API to receive information about available providers for location based services and get the current location and coordinates.

In this short tutorial we’re going to build a small activity that displays a list of available location providers and shows the current position using GPS services.

(more…)

Extending the Confluence Search Index

Sunday, May 23rd, 2010

Developing plugins for the Confluence Wiki a developer sometimes needs to save additional metadata to a page object using Bandana or the ContentPropertyManager. Wouldn’t it be nice if this metadata was available in the built-in Lucene index?

That is were the Confluence Extractor Module comes into play..

(more…)

Creating a simple Gesture App with Android

Friday, May 14th, 2010

The integration of gestures into your android app adds some nice functionality and is made very easy using Google’s GestureBuilder application and the integrated GestureLibrary and Gesture Overlay API – so let’s build a sample app.

If you need some basic information regarding gestures on android first – take a look at this article.

(more…)

Playing around with QR Codes

Tuesday, May 11th, 2010

Sometimes QR codes are a nice way to distribute information like calendar events, contact information, e-mail, geo-locations or internet addresses.

In the following article we’re going to encode information to QR code images using the ZXing library and afterwards decode information from a given QR code.

Finally we’re taking a look on online QR code generators and how to integrate the ZXing library in a Maven project.

(more…)

First steps on Android: Creating a simple Todo App

Monday, April 26th, 2010

In this tutorial we are going to build a simple todo app that is able to store simple todos in a database. The user is able to add new todos or delete old ones by clicking on a todo. For this tutorial we won’t use maven to keep it simple – if maven integration is desired – take a look at this tutorial. (more…)

Create a SOAP client using the JAX-WS Maven Plugin

Thursday, April 8th, 2010

Having written the article “How to build a Confluence SOAP client in 5 minutes” some readers asked me for some more information and help using the  JAX-WS plugin that I mentioned in the article instead of the Axis plugin – so here we go ;) (more…)

Confluence Developer Instance Quick Setup

Friday, March 26th, 2010

This short tutorial shows how to set-up a developer instance of the popular Confluence Wiki from Atlassian in a few minutes.

It’s a prerequisite for a few following tutorials regarding the Confluence API and plug-in development for this system.

We want a quick install so we are going to run Confluence with the embedded servlet container and HSQL database.
(more…)

How to build a quick Lucene Search

Thursday, March 25th, 2010

Helo – today I wanted to post a small tutorial for a small index and search operation using the Lucene indexer and Maven for the project setup.

(more…)

Search
Categories