Polymer: Creating a simple list component

Extracted from Google Polymer website:

Polymer is a pioneering library that makes it faster and easier than ever before to build beautiful applications on the web. Polymer is built on top of a set of powerful new web platform primitives called Web Components. Web Components bring unprecedented composability, interoperability, and consumability to the web platform. The result is a monumental increase in developer productivity.

The main concept in Polymer is to give an opportunity to create web applications on top of web components. So you develop several web components and use them to develop your web app. You can use the same web component in several pages or projects.

Polymer is still in development, but it is actually very stable and there is lots of small projects already using it. This small tutorial uses version 0.5.1 of polymer.

In this article I will show how to construct a very simple component, that will receive an object (or JSON string) with person information and render a list with those information. (more…)

Localizing an Android App

It is an easy task to implement localization in an Android App, you just need to create the resource files for each language and later Android will be responsible to present the correct one for each device configuration.

This article cover the steps to create the resources and explain how to force a specific language to be used if needed. For this example I managed to provide localization for english, spanish and portuguese. Android Studio was used to implement all steps.

(more…)

Library: Butter Knife

After deploying the first version of my app, I discovered the Butter Knife (Copyright 2013 Jake Wharton) which is a really usefull library.

The main purpose of this library is to make it easier to construct the inflate process of view so you can focus on your app code. With Butter Knife you make annotations to your views and let the lib inflate view and assign control instances to your variables.

So, instead of this code

You can use this:

Several other features are implemented in the library like optional injection (if the control was not found it sets the variable to null)

Also you can assign automatically listeners:

You can find more usefull information on features and how to install Butter Knife at the developer website.

Another usefull tool is Android ButterKnife Zelezny that you can add to your Android Studio as a plugin that make it really fast to add the Butter Knife injection,

Component: Calendar

Roboto Calendar View is a simple and good component to provide customizable calendar for general usage. In my app I need to show a calendar and mark the days that have appointments. A very simple functionality at this moment.

I have found the Roboto Calendar View in github at  RobotoCalendarView (Copyright 2014 Marco Hernaiz Cao).

There are some cool fonts in the project (which I removed to reduce APK size) that you can use to change the interface to meet your needs.

You can find more information on usage in the project page on Github.

In the near future I will need to improve this calendar or use another component to provide more detailed information to the user, but for now it is just fine.

AdvogadoAG - RobotoCalendarView

AdvogadoAG – RobotoCalendarView