Thursday, April 26, 2012

Writing android gui using python(list view and custom view) - CodeProject®

More about writing a GUI for Android using Python!

The examples in this article will create a listview and a custom view. Android listview often uses adapter such as "ArrayAdapter(…)". The syntax is java generic, which may have no corresponding types in dynamic script languages, such as python, lua, etc. Therefore, we have to give specific class, such as StringArrayAdaper, for it can be used in these dynamic languages. For StringArrayAdapter, we can override function getView to return little more complex view for listview. For custom view, we can create instance of View, and override its function onDraw. In function onDraw, we may draw text or bitmaps using function of canvas.

Writing android gui using python(list view and custom view) - CodeProject®

No comments: