Category: Java

HTML5 WebSockets

All code and slides can be found on GitHub:

Know When You Need Real-time

Real-time applications need instant updates from the server, often when an external event triggers the need to receive new data. The most popular solution involved long polling, where the page makes an AJAX call to the server that remains open until the server sends information and then a new AJAX call is made to restart the process. Note the difference between this and short polling, where an AJAX is made at Continue reading

Spring + REST + Angular: Creating the API — Part 1 of 2

This series of posts builds a RESTful service that is consumed by an Angular front end. In this post we will create a RESTful web service built on Spring MVC that uses JSON. The source code for this sample application is on GitHub:

Service-Oriented Architecture

With the growing popularity of Single Page Application (SPA) and mobile applications, Service-Oriented Architecture (SOA) is shining now more than ever. Web services, by nature, are language agnostic, so they can be re-used across applications written in any language whether it’s a JavaScript, Objective-C, Java, or .NET application. SOA is fundamentally based on exposing data via web services that empower the client applications to render that data in an appropriate way. Continue reading

Blog List: Adding Fragments and Sorting

So far, the blog list example has assumed a single layout for all devices and orientations. Of course, we know that some phones are much larger than others, and tablets are larger than phones, and landscape vs portait orientations provide for very different amounts of screen real estate to work with. Having a single layout accounts for none of this, and inevitably forces the design to the lowest common denominator (a small phone in portrait orientation).

Providing different layouts means having reusable UI components becomes very important. In Android, these are called fragments. The Blog List app follows the typical example for which fragments are useful: a list of items that provide additional detail about a selected item.
Continue reading