Java tutorial
//package com.java2s; //License from project: Apache License import android.database.Cursor; public class Main { public static double doubleFromCursor(Cursor c, String field) { if (c.isNull(c.getColumnIndex(field))) { return -1; } return c.getDouble(c.getColumnIndex(field)); } }