Queries content from the android content model.
Example - Show Contacts
function OnStart()
{
lay = app.CreateLayout( "linear", "VCenter,FillXY" );
lst = app.CreateList( "", 1, 1 );
lay.AddChild( lst );
app.AddLayout( lay );
var uri = "content://com.android.contacts/data";
var columns = "display_name,data1";
var select = "mimetype='vnd.android.cursor.item/phone_v2'";
var rows = app.QueryContent( uri, columns, select, null, "display_name" );
var list = [];
for(var i in rows)
list.push( rows[i].display_name + ":" + rows[i].data1 + ": " );
lst.SetList( list );
}
from native import app
def OnStart():
lay = app.CreateLayout("linear", "VCenter,FillXY")
lst = app.CreateList("", 1, 1)
lay.AddChild(lst)
app.AddLayout(lay)
uri = "content://com.android.contacts/data"
columns = "display_name,data1"
select = "mimetype='vnd.android.cursor.item/phone_v2'"
rows = app.QueryContent(uri, columns, select, None, "display_name")
contact_list = []
for row in rows:
contact_list.append(row.display_name + ":" + row.data1 + ": ")
lst.SetList(contact_list)