This example shows a barebone program to illustrate how to incorporate displaying EULA to user in an Android App. User can only proceed with using the app if he or she accepts the EULA. Once accepted, EULA will not be shown next time.
Android Code Crumbs -- Handy "How to" code snippets
Android code snippets will be posted on this blog to share them with other developers. These are short and handy code snippets. Screenshots will be included where appropriate to show the expected results when compiled.
Monday, August 8, 2011
Wednesday, June 29, 2011
How to programmatically add cells (Views) and rows in TableLayout
Following are the steps for programmatically adding rows in a TableLayout:
1. Manually include a TableLayout in your main.xml file with an id, say, "TableLayout01". Obtain a reference to the TableLayout as:
table = (TableLayout) findViewById(R.id.TableLayout01);
Note: Ensure to define the variable "table" outside onCreate() inside the class as: TableLayout table;
1. Manually include a TableLayout in your main.xml file with an id, say, "TableLayout01". Obtain a reference to the TableLayout as:
table = (TableLayout) findViewById(R.id.TableLayout01);
Note: Ensure to define the variable "table" outside onCreate() inside the class as: TableLayout table;
How to display grids on TableLayouts
Android TableLayouts apparently do not have an option to show grids on the tables. In the following example, grid-like appearance is creates by setting margins around each TextView inside the table, and setting different background colors for the TableLayout and the TextViews.
Friday, June 17, 2011
How to use a AutoCompleteTextView
AutoCompleteTextView an editable text view that shows completion suggestions automatically while the user is typing. The list of suggestions is displayed in a drop down menu from which the user can choose an item to replace the content of the edit box with (from Android documentation).
How to set horizontal and vertical scroll bars
Here is how to make the horizontal and vertical scroll bars appear on the screen WHEN the the application becomes wider than the phone screen. Scroll bars will appear only when the user needs them; will hide when not needed.
Subscribe to:
Posts (Atom)