`

How to get a tables columns arraylist on Android?

 
阅读更多
Cursor ti = db.rawQuery("PRAGMA table_info(mytable)", null);
    if ( ti.moveToFirst() ) {
        do {
            System.out.println("col: " + ti.getString(1));
        } while (ti.moveToNext());
    }
 

 

try {
        Cursor c = db.query(tableName, null, null, null, null, null, null);
        if (c != null) {
            int num = c.getColumnCount();
            for (int i = 0; i < num; ++i) {
                String colname = c.getColumnName(i);

            }
        }

    } catch (Exception e) {
        Log.v(tableName, e.getMessage(), e);
        e.printStackTrace();
    }
 
分享到:
评论

相关推荐

    A tutorial on adding columns to Explorer’s details view via

    标题 "A tutorial on adding columns to Explorer’s details view via" 是一篇关于如何通过列处理程序外壳扩展在Windows资源管理器(Explorer)的详细视图中添加自定义列的教程。这通常涉及到增强Windows操作系统中...

    Excel.2013.Working.with.Data.Ranges.and.Tables

    Next you learn how to sort a data range on one column or on multiple columns and how to use a custom sort order, the Filter (AutoFilter) feature and the Advanced Filter feature to view data that meets...

    how-to-lock-columns-in-an-html-table

    NULL 博文链接:https://moyuan.iteye.com/blog/526128

    Your Excel Survival Kit pdf

    how to set up a simple list and how to create a list for your recurring data. It’s the piece that’s often omitted in many Excel books. You get it here. Chapter 3, “Further Cleaning, Slicing, and ...

    SSD7 选择题。Multiple-Choice

    (a) filling in skeleton tables of the database with examples of what is to be retrieved (b) placing SQL keywords, such as select, under the column names they want to retrieve (c) typing a ...

    使用对象ArrayList填充DataGrid,C#源代码ArrayList MyList = new ArrayList();

    首先,ArrayList是.NET Framework中的一个类,它继承自System.Collections.ArrayList,主要用于存储动态大小的可变数组。ArrayList可以存储任何类型的对象,非常灵活,但不提供类型安全。在C#中,我们通常更推荐使用...

    Foundations for Analytics with Python O-Reilly-2016-Clinton W. Brownley

    After covering how to read and parse a single worksheet, the chapter moves on to discuss how to read and process all worksheets in a workbook and a subset of worksheets in a workbook. The exam‐ ples...

    ArrayList转化为DataTable

    在.NET框架中,ArrayList和DataTable是两种常用的集合类,它们分别代表了两种不同的数据存储方式。ArrayList是一个基于对象数组的动态大小的列表,而DataTable则是一个内存中的表格数据结构,通常用于存储和操作关系...

    android lint performance probe帮助.zip

    This is a simple tool to help pinpoint performance bottlenecks in individual Android Lint checks. It uses Java byte code instrumentation to collect and report performance statistics per detector for a...

    android做的拼图游戏小例子

    Bitmap bitmap2 = bitmap.createBitmap(bitmap, width/columns*col, height/columns*row, width/columns, height/columns); cutPic = new LittleCutPic(index,bitmap2); list.add(cutPic); } } ...

    Android代码-ContentProviderHelper

    Android content-providers are similar to database-tables. They have a name (aka "content:" uri), columns and they can be queried similar to Sql. Android uses [https://developer.android.com/gu

    MySQL and JSON A Practical Programming Guide 2018

    Written by a MySQL Community Manager for Oracle, MySQL and JSON: A Practical Programming Guide shows how to quickly get started using JSON with MySQL and clearly explains the latest tools and ...

    Pandas Cookbook 2017 pdf 2分

    How to get the most out of this book Conventions Assumptions for every recipe Dataset Descriptions Sections Getting ready How to do it... How it works... There's more... See also Reader feedback ...

    howto_sort_all_listview_columns_use_wherenoo_

    `howto_sort_all_listview_columns_use_wherenoo_` 这个标题暗示了我们要讨论的是如何在ListView控件中实现多列排序,特别是在使用特定条件(如“where noo”)的情况下。在这个场景下,“where noo”可能是指在没有...

    Build iOS Database Apps with Swift and SQLite

    With Build iOS Database Apps with Swift and SQLite you will also gain expert knowledge on how to create databases at runtime, including creating or modifying indexes, triggers, tables, columns, and ...

    C#160使用对象ArrayList填充DataGrid 源代码

    在本示例中,我们探讨的主题是如何使用对象ArrayList来填充DataGrid控件。DataGrid控件是Windows Forms应用程序中用于显示数据的一种常见方式,它允许用户查看、编辑和管理表格形式的数据。 ArrayList是.NET ...

    Android代码-2017谷歌开发者大会官方APP

    How to Update the App code for your Convention Create a google spreadsheet with 3 sub-sheets, titled: sessions, speakers, sandbox. Publish the worksheet as an atom stream: click Share-&gt;Publish as a ...

Global site tag (gtag.js) - Google Analytics