Developing an Android App: MyTwitter Part 1



This is a sample android app that works with a twitter account and allows the user to post twitter account updates. The app will also automatically connect to twitter.com every once in a while to check for new friend statuses, and notify us of us.

The goal of this application is to illustrate all the major pieces of Android application development by implementing them in an actual app.

Project Overview
This is basically all the bits and pieces that we'll build as part of this project.


The application will encompass various android interfaces to make this happen.

Basic functions include the java file MyTwitter.java and auto generated basic AndroidManifest.xml files is the only file that has been changed.

Images files were dropped into the drawable folder- please refer to the source code for content.


MyTwitter.java
Code:

package com.example;

import android.app.Activity;
import android.os.Bundle;

public class MyTwitter extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
}
}

AndroidManifest.xml at this stage only references the drawable files that have been dropped in the res/drawable folder. The notable change is the MyTwitter app icon on the desktop on the phone, it references to the new icon - twitter_icon


AndroidManifest.xml
Code:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="https://schemas.android.com/apk/res/android"
android:versionCode="1"
android:versionName="1.0" package="com.example">
<application android:icon="@drawable/twitter_icon" android:label="@string/app_name">
<activity android:name=".MyTwitter"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>

</application>
<uses-sdk android:minSdkVersion="3" />

</manifest>

Source
https://www.protechtraining.com/static/tutorials/MyTwitter-Part1.zip
https://www.protechtraining.com/static/tutorials/twitter_icon.zip

Published February 2, 2010