Tag: REST

Spring + REST + Angular: Consuming the API — Part 2 of 2

This series of posts builds a RESTful service that is consumed by an Angular front end. In this post we will create an Angular application that consumes the RESTful web service we built in Part 1 of the series. The source code for this sample application is on GitHub: https://github.com/thoward333/addrbook

Angular Overview

Angular is a JavaScript MV* framework. It is a very expressive framework and offers robust features such as dependency injection (DI), data binding, and templating. Angular can be used as a Single Page Architecture (SPA) application or used as a component in a traditional web application. For our Address Book application we will be using it to create a SPA application, which means the whole web site will be a single HTML page that uses AJAX to fetch data and dynamically update the page contents. 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:
https://github.com/thoward333/addrbook

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

AsyncTaskLoader: Populate a Static List View

One of the first things I tried to do while developing an Android app is asynchronously populate a statically defined list view. This turned out to be a much more challenging task than I anticipated, and apparently nobody else on the entire world wide web is attempting to do this (or I just didn’t google right 0_o).

Specifically, I wanted to define a ListView (or Spinner or whatever) in a layout XML file, and populate it via data from a restful web service. Initially I tried to do this in the onCreate(), but got the android.os.NetworkOnMainThreadException. So, obviously I needed to pull the data from a restful web service asynchronously. This post is going to explain how I did that.
Continue reading