Tag Archives: TableLayout

How to load a spinner with values from SQlite Database in android?

By | November 18, 2012

Here is a simple example showing how to load a database values in a spinner in android. OK we will start. This is the layout for the spinner row. spinner_row.xml [xml] <?xml version="1.0" encoding="utf-8"?> <TextView xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation = "vertical" android:id="@+id/tv" android:layout_margin="10dp"> </TextView> [/xml] This is the layout for the interface. activity_main.xml [xml] <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent"… Read More »

Show data in columns in a TableView dynamically in Android.

By | December 26, 2011

Hello all, Often we need to show data from a source such as a database in a tableView like we see in an HTML Page. In Android also we can do this with the help of TableLayout. We can create dynamic rows and add data to it. MainActivity [java] package table_demo.coderzheaven.com.tabledemo; import android.graphics.Color; import android.graphics.Typeface; import android.os.Bundle; import… Read More »

Android TableLayout

By | March 9, 2011

In android there are different layouts and we often confuse about which one to use. Even if we select one, it is little complicated. So this tutorials is to show you about the TableLayout Here i first created linear Layout in which a Table Layout is added [xml] <?xml version="1.0" encoding="utf-8"?> <LinearLayout android:id="@+id/LinearLayout01" android:layout_height="fill_parent" android:layout_width="fill_parent" xmlns:android="http://schemas.android.com/apk/res/android"> <TableLayout android:layout_width="wrap_content"… Read More »

Working with SQLite Database in ANDROID.

By | February 14, 2011

Below is a straight forward example of how to deal with SQLite database in ANDROID. Go ahead and copy and paste the following code to your java file. The example has one database and performs functions like insert delete and listing of values in a textView. [java] package com.database; import android.app.Activity; import android.content.ContentValues; import android.content.Context; import android.database.Cursor; import… Read More »