Skip to content

Android coding session 3

February 4, 2011

1. I tried to improve the formatting of the app, I got this exercise working I spent some time trying to adapt this code, but was unsuccessful.
mTitle = new TextView(context);
addView(mTitle, new LinearLayout.LayoutParams(
LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT));

mDialogue = new TextView(context);
addView(mDialogue, new LinearLayout.LayoutParams(
LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT));

2. I couldn’t get this code to do what I wanted, but I did manage to change colours, in table.xml

In I changed this line
new ArrayAdapter(this, R.layout.row,titles);
new ArrayAdapter(this, R.layout.table,,titles);

This changed the background colour to white and added ‘xxx’

By changing these elements, I now started to understand how to call layout elements from the java file.

3. Next I wanted to stop each item being clickable (a hyperlink), I did this by commenting out the onListItemClick procedure in

4. The app already had 4 menu buttons, I decided to add custom RSS feeds 2 of them and remove the other 2.
I changed the name of the buttons in strings.xml

London 2012 News
BBC London 2012


Added a new feedURL in

case DOM:
return new DomFeedParser("");
return new AndroidSaxFeedParser("");

Here are the new menu’s in the news app

No comments yet

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: