Android examples for Database:Cursor Get
get Float List by database Query
//package com.java2s; import android.database.Cursor; import android.database.sqlite.SQLiteDatabase; import java.util.ArrayList; public class Main { public static ArrayList<Float> getFloatListbyDBQuery(SQLiteDatabase db, String sql, String fieldName) { Cursor cursor = db.rawQuery(sql, null); int index = cursor.getColumnIndex(fieldName); ArrayList<Float> retList = new ArrayList<Float>(); cursor.moveToFirst();//from ww w . j a v a2 s. c om while (!cursor.isAfterLast()) { retList.add(cursor.getFloat(index)); cursor.moveToNext(); } return retList; } }