Upcoming talks and demos:

Codemotion - Amsterdam - 16 May
DevDays - Vilnius - 17 May
Strata - London - 22 May

View Natalino Busa's profile on LinkedIn
Principal Data Scientist, Director for Data Science, AI, Big Data Technologies. O’Reilly author on distributed computing and machine learning. ​

Natalino leads the definition, design and implementation of data-driven financial and telecom applications. He has previously served as Enterprise Data Architect at ING in the Netherlands, focusing on fraud prevention/detection, SoC, cybersecurity, customer experience, and core banking processes.

​Prior to that, he had worked as senior researcher at Philips Research Laboratories in the Netherlands, on the topics of system-on-a-chip architectures, distributed computing and compilers. All-round Technology Manager, Product Developer, and Innovator with 15+ years track record in research, development and management of distributed architectures, scalable services and data-driven applications.

Sunday, April 22, 2012

Non blocking background HTTP web request

A great snippet for android async http calls:

import java.io.BufferedInputStream;
import java.io.InputStream;
import java.net.URL;
import java.net.URLConnection;
import org.apache.http.util.ByteArrayBuffer;

public class Iconic extends Activity {
private String html = "";
private Handler mHandler;

public void onCreate(Bundle savedInstanceState) {
mHandler = new Handler();

private Thread checkUpdate = new Thread() {
public void run() {
try {
URL updateURL = new URL("http://your-site/update");
URLConnection conn = updateURL.openConnection();
InputStream is = conn.getInputStream();
BufferedInputStream bis = new BufferedInputStream(is);
ByteArrayBuffer baf = new ByteArrayBuffer(50);

int current = 0;
while((current = bis.read()) != -1){

/* Convert the Bytes read to a String. */
html = new String(baf.toByteArray());
} catch (Exception e) {

private Runnable showUpdate = new Runnable(){
public void run(){
"HTML Code: " + html,
// see http://www.androidsnippets.com/non-blocking-web-request