title: Display the SQlite data using Table format with fixed header in android
body: <p>I am new to android.I have created an sqlite database for my android application.I want to display my data using table format with fixed header instead of ListView. The codes below are perfectly fine.Do I need to use Cursor Adapter?What are the possible controls for this? any ideas? please send me links(example) thanks.</p>
  
  <p>How to do a simple Table format with a fixed header and in the first column? like this.</p>
  
  <pre><code>logdate | logtime | batlevel | batcharging | signalstrength | wifi | useraction |
  ---------------------------------------------------------------------------------
    data  |  data   |   data   |     data    |      data      | data |     data   |
    data  |  data   |   data   |     data    |      data      | data |     data   |
    data  |  data   |   data   |     data    |      data      | data |     data   |
    data  |  data   |   data   |     data    |      data      | data |     data   |
  ...
  ...
  </code></pre>
  
  <p>--Here is my SQLiteOpenHelper class    </p>
  
  <pre><code>package com.example.activitylifecycle;
  import android.content.Context;
  import android.database.sqlite.SQLiteDatabase;
  import android.database.sqlite.SQLiteOpenHelper;
  import android.util.Log;
  public class MySQLiteHelper extends SQLiteOpenHelper {
  
  //Attributes name
  public static final String _ID = "_id";
  public static final String LOGDATE = "Logdate";
  public static final String LOGTIME = "Logtime";
  public static final String BATLEVEL = "Batlevel";
  public static final String BATCHARGING = "Batcharging";
  public static final String SIGSTRENGTH = "Sigstrength";
  public static final String WIFI = "Wifi";
  public static final String USERACTION = "Useraction";
  
  //database creation//
  public  static final String TAG = "DBAdapter";
  private static final String DATABASE_NAME = "dbase";
  public  static final String DATABASE_TABLE = "applog";
  private static final int DATABASE_VERSION = 1;
  
  //table create..
  private static final String DATABASE_CREATE = "create table applog (_id integer primary key autoincrement,"
  + "Logdate text null,"
  + "Logtime text null,"
  + "Batlevel text null,"
  + "Batcharging text null,"
  + "Sigstrength text null,"
  + "Wifi text null,"
  + "Useraction text null);";
  
  public MySQLiteHelper(Context context) { super(context, DATABASE_NAME, null,     
   DATABASE_VERSION);
   }
  @Override
  public void onCreate(SQLiteDatabase database) {
  database.execSQL(DATABASE_CREATE);
  }
  @Override
  public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
  Log.w(MySQLiteHelper.class.getName(),
  "Upgrading database from version " + oldVersion + " to "
  + newVersion + ", which will destroy all old data");
  db.execSQL("DROP TABLE IF EXISTS " + DATABASE_TABLE);
  onCreate(db);
  }
  } 
  </code></pre>
  
  <p>--Here is my Datasource class</p>
  
  <pre><code>package com.example.activitylifecycle;
  import java.util.ArrayList;
  import java.util.List;
  import android.content.ContentValues;
  import android.content.Context;
  import android.database.Cursor;
  import android.database.SQLException;
  import android.database.sqlite.SQLiteDatabase;
  
  public class AppLogDataSource {
  
  //Database Fields
  private SQLiteDatabase database;
  private MySQLiteHelper dbHelper;
  private String[] allColumns = {MySQLiteHelper._ID, MySQLiteHelper.LOGDATE,   
  MySQLiteHelper.LOGTIME, MySQLiteHelper.BATLEVEL, MySQLiteHelper.BATCHARGING,   
  MySQLiteHelper.SIGSTRENGTH, MySQLiteHelper.WIFI, MySQLiteHelper.USERACTION};
  
  public AppLogDataSource(Context context) {
  dbHelper = new MySQLiteHelper(context);
  }
  
  public void open() throws SQLException {
  database = dbHelper.getWritableDatabase();
  }
  
  public void close() {
  dbHelper.close();
  }
  
  //Insert
  public void createApplog(String Logdate, String Logtime, String Batlevel, String    
  Batcharging, String Sigstrength, String Wifi, String Useraction){
  ContentValues values = new ContentValues();
  values.put(MySQLiteHelper.LOGDATE, Logdate);
  values.put(MySQLiteHelper.LOGTIME, Logtime);
  values.put(MySQLiteHelper.BATLEVEL, Batlevel);
  values.put(MySQLiteHelper.BATCHARGING, Batcharging);
  values.put(MySQLiteHelper.SIGSTRENGTH, Sigstrength);
  values.put(MySQLiteHelper.WIFI, Wifi);
  values.put(MySQLiteHelper.USERACTION, Useraction);
  long insertId = database.insert(MySQLiteHelper.DATABASE_TABLE, null,values);
  Cursor cursor = database.query(MySQLiteHelper.DATABASE_TABLE,allColumns,   
  MySQLiteHelper._ID+ " = " + insertId, null, null, null, null);
  cursor.moveToFirst();
  cursor.close();
  }
  
  public Cursor getLogs() { 
  Cursor mCursor = database.query(MySQLiteHelper.DATABASE_TABLE,allColumns, null, null,
  null, null, null);
  mCursor.moveToFirst();
  while(!mCursor.isAfterLast()){
  mCursor.moveToNext();
  }
  return mCursor;
  }
  }
  </code></pre>