Development of an Android App - MyTwitter Part 1

Forums » Android - Examples > Development of an Android App - MyTwitter Part 1
February 1, 2010 11:14:39 PM PST (3 years ago). Seen 31,991 times. 10 replies.
Photo Serete Itebete
Member since Dec 23, 2009
Location: Oakland
Forum Posts: 17
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="http://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
http://marakana.com/static/tutorials/MyTwitter-Part1.zip
http://marakana.com/static/tutorials/twitter_icon.zip
Edited 6 times. Last edit by Marcio Valenzuela on May 17, 2011 at 11:32:31 AM (about one year ago).
February 2, 2010 6:57:40 AM PST (3 years ago)
Photo DIA Mamadou
TCHAP
Member since Jan 27, 2010
Forum Posts: 3
I think that you've forgot something
This is just a sample hello worldd code !!!
Mamadou
February 2, 2010 8:40:12 AM PST (3 years ago)
Photo Marko Gargenta
@MarkoGargenta
Marakana, Inc.
Member since Jan 19, 2007
Location: San Francisco
Forum Posts: 227
Like the name suggests, this is just Part 1 of 5-part example to building a simple Twitter app for Android. Stay tuned for more...
February 2, 2010 8:48:15 AM PST (3 years ago)
Photo DIA Mamadou
TCHAP
Member since Jan 27, 2010
Forum Posts: 3
ooh yea,
sorry

Merci
February 8, 2010 3:52:39 PM PST (3 years ago)
Photo Marko Gargenta
@MarkoGargenta
Marakana, Inc.
Member since Jan 19, 2007
Location: San Francisco
Forum Posts: 227
I just posted the graph of the entire app. I hope this helps explain the development we're undertaking and how pieces fit together.
February 10, 2010 9:19:41 AM PST (3 years ago)
Photo Marko Gargenta
@MarkoGargenta
Marakana, Inc.
Member since Jan 19, 2007
Location: San Francisco
Forum Posts: 227
Another diagram of this project, courtesy of Robin John, participant in Android Bootcamp:
http://marakana.com/static/tutorials/MyTwitterArchDesign.pdf
September 24, 2010 2:49:02 AM PDT (2 years ago)
Photo Leo Filus
Particular
Member since Sep 24, 2010
Forum Posts: 2
Maybe you can help-me about twitter, I think that API was changed and the methods of twitter are no longer working the same form. I just want to login with username and password and send
some message. Could you help me with this in the new API?

Thank's
September 24, 2010 4:54:38 AM PDT (2 years ago)
Photo Marko Gargenta
@MarkoGargenta
Marakana, Inc.
Member since Jan 19, 2007
Location: San Francisco
Forum Posts: 227
So, Twitter.com no longer accepts basic authentication (username/password). For purposes of this tutorial, it is not strictly important to use Twitter.com, so we have moved to another Twitter-like service called Identi.ca. Identi.ca implements the exact same API, so your code will work the same. All you have to do is add one line change, as outlined here:

Code:

twitter = new Twitter(username, password);
twitter.setAPIRootUrl("http://identi.ca/api");


And everything else should work the same.

September 24, 2010 6:58:30 AM PDT (2 years ago)
Photo Leo Filus
Particular
Member since Sep 24, 2010
Forum Posts: 2
Thank's again!

But the application I really need to develop integration of Twitter. I had facebook and works differently, and this new Twitter API works like facebook. So I'm trying to adapt!

greetings!
May 17, 2011 11:32:31 AM PDT (2 years ago)
Photo Marcio Valenzuela
Santiapps
Member since May 16, 2011
Forum Posts: 10
I'd like to know how to modify this app for the new twitter login oauth.
February 10, 2013 10:37:23 PM PST (14 weeks ago)
Photo Manju Krishna
Programmer
mPortal
Member since Dec 13, 2012
Forum Posts: 2
But Marko How do you Post Updates to ideti.ca site .Using a jTwitter Api give and error as "You must validate your Email Address before you Post updated" in the Log cat.