September 1, 2015

Android Floating Action Button: Video

By With No comments:
Topics covered

Promoted Actions

Floating Action Button (FAB)

Custom component

Material design

This is an interesting video made by Webucator about Android Promoted Actions: Floating Action Button.
They are actions that are directly visible in the UI instead of using action bar button; for this reason these actions are called promoted, they can be easily accessed and define the main action in the current UI. For example, if we are using an email app and we are listing the inbox folder, one promoted action can be a new mail. The visual pattern is called Float Action Button (or FAB) because the promoted action can be represented using a floating circular button on the UI. The picture below shows it:


This video is made using my post explaining how to use FAB.


Find more videos @ Webucator

Read More..

August 25, 2015

Android Data Binding Tutorial

By With No comments:
Topics covered

Android data binding

@Bindable

data binder

This post describes one of the most interesting feature in Android recently introduced and still in beta version: Android Data Binding. Using data binding, you create a link between the presentation layer (the app UI) and the underlying data model that holds the information you want to show. The UI widgets content like TextView, EditText and so on are somehow bound to the data stored in java class. Every time the data changes the UI widget bound to it is updated, so that you don't have to worry anymore to update the UI by yourself. If the app does not use Android data binding, it is necessary to find the view and update the content. At the end of this tutorial, you will create an app like this
Android data binding


Setup Android data binding

As told before, this feature is still in beta version, so as the first thing let's set the right dependencies in the top level build.gradle:

dependencies { 
  classpath "com.android.tools.build:gradle:1.3.0"
  classpath "com.android.databinding:dataBinder:1.+"
}

by the way, make sure you downloaded gradle 2.4. Now the dependencies are ready and it is time to modify build.gradle in the app:

apply plugin: 'com.android.databinding'

Read More..

July 13, 2015

Monitor Arduino Sensor using Smartphone and ESB: IoT Tutorial

By With 1 comment:
Topics covered

Arduino board

WSO2 ESB Proxy

Read sensor using arduino board

This post is the application of the IoT reference architecture shown in the previous post about Internet of things Arduino Android and ESB. What if we want to read a remote sensor connected to arduino board using our smartphone? As explained previously, we can connect directly our Android smartphone to arduino and read the sensor data or we can use a different approach where there is an Enterprise Service Bus (ESB) that stands in the middle between the arduino board and the smartphone. Even if the system is a little bit more complex as stated in the previous post using ESB we have a lot of advantages. It is time to show things work:

  •  an ESB proxy using WSO2 ESB that send HTTP request to arduino board and transforms response from arduino board to our smartphone
  • Arduino Webserver that handle HTTP connection and read the temperature sensor
  • Android app that shows the temperature value in our smartphone

How to implement an WSO2 ESB Proxy

The first thing we do is implementing a proxy that lives in our ESB that handle incoming connection from the Android smartphone on one side and on the other side handles HTTP connection toward arduino board.
The ESB proxy is very simple, the picture below shows how it works:

WSO2 ESB Custom Proxy

As said, the proxy accept incoming connection and forward it to the arduino web server that reads the environment temperature and returns a simple XML response. This response is transformed by the proxy and becomes an JSON response.This is the proxy code:

Read More..

July 6, 2015

Internet of Things: Arduino, Android, ESB

By With No comments:
Topics covered

Arduino

ESB

Proxy

Internet of things (IoT) is one of the most emerging topic and one of the most discussed lately. What is Internet of things? When talking about IoT, we mean a set of smart objects that are connected together and can exchange information.
In this way, it is possible, for example, to create a sensor network and we get information from them using our smartphones. In this world, Arduino plays an important role, because it is a low cost system that can be used in several contexts.
In the previous post, we talked about a simple project that uses Arduino and Android to control a remote led. This post shows a different approach and the Android smartphone does not connect directly to the Arduino and its sensors but uses a component that decouples the Android client and the source of information (Arduino).

IoT Architecture

Recently i came across an interesting article explaining the IoT architecture. This architecture is quite complex and general purpose, i want to simplify it using just some components.
This image show the simplified architecture:

iot reference architecture
Instead of connecting directly the Android smartphone to the Arduino, i used a component called ESB (Enterprise Service Bus). In this case, my preference is for WSO2 ESB because it is an full open source project and it fits perfectly in the IoT ecosystem. Moreover, WSO2 proposed the reference architecture.
Read More..

June 2, 2015

Internet of Things with Android and Arduino: Control remote Led

By With 3 comments:
Topics covered

Internet of things

Arduino

Integrate Android with Arduino

Arduino web server

Nowadays a new emerging technology is Internet of Things (IoT): in other words all the physical objects (things)  are connected together  using internet infrastructure. Arduino borard is one of the most important object in this ecosystem. In this post, we will explore how to integrate Android with Arduino making a first step in IoT.Even Goole at io15 presented its new IoT infrastructure called Brillo.
This android tutorial describes how to create an arduino project and android app to control a remote Led.

Internet of things (IoT) overview

The picture below shows the main objects involved in the IoT project:


Internet of things overview

What we need is:
  • Arduino Uno
  • Ethernet shield
  • Smartphone with Android
All the objects are in the same network for simplicity. The idea is that the smartphone sends an HTTP request to the Arduino. A very small and simple Web server runs on Arduino, accepting HTTP request. For simplicity, the app sends JSON data that holds the led status.

Read More..
Copyright © 2015 Surviving with android | All Rights Reserved. Design By Templateclue