Tweeting using twitter for android intent

Well am working on this application where I want to be able to posts tweets using the native android application.  Here is the how to.

launch the twitter PostActivity directly by getting the ActivityInfo instance of it. This is done by scanning through the activities returned by the Intent.ACTION_SEND and looking for “”.

This is a not a clean way of doing it since we are searching for a particular hard coded activity. The best way is to just let the user select from the dialog box returned by Intent.ACTION_SEND.

Context context = getApplication();
String message = "Testing integration into native twitter android app :)";
message = "It works!";
try {
Intent intent = new Intent(Intent.ACTION_SEND);
intent.putExtra(Intent.EXTRA_TEXT, message);
final PackageManager pm = context.getPackageManager();
final List activityList = pm.queryIntentActivities(intent, 0);
int len = activityList.size();
for (int i = 0; i < len; i++) {
final ResolveInfo app = (ResolveInfo) activityList.get(i);
if (""
.equals( {
final ActivityInfo activity = app.activityInfo;
final ComponentName name = new ComponentName(
intent = new Intent(Intent.ACTION_SEND);
intent.putExtra(Intent.EXTRA_TEXT, message);
} catch (final ActivityNotFoundException e) {
Toast.makeText(this, "Damn! no suitable Twitter apps found.",
Toast.LENGTH_SHORT) .show();

Happy Coding.


CyanogenMod 6.0.0 RC1 D/S

For those of us who have been patiently waiting for Cyanogen 6 to be released, well the first release candidate has been released for the Dream, Magic and the Nexus one devcies. Cyanogen promises to release builds for otehr devcies soon. I for one have been trying out nightly builds. Been facing lotsa bugs and all (am not complaining and all) and after falshing and testing the RC1 release I feel I know how much work it takes to build stable builds. Here is a complete changelog.

ADW Launcher which is the deafult launcher since CM 5.0.8, has lots of cool new features (its by far the most customizable launcher replacement I have seen so far). Another cool thing I think developers and users alike will find fun on the new android version (2.2), is the Cloud to device messaging C2DM api. lotsa of capabilities and applications you can implement with this new API.

The CynanogenMod forum has been quite slow since the announcement of the availability of CM 6 heres its quite slow but you  can download the same binaries here (dont forget to check the MD5 sum after downloading)

Happy Flashing 🙂 🙂

CyanogenMod 6.0 Feature list

For all cyanogen Mod lovers, a pretty sure that y’all waiting anxiously for CyanogenMod 6.0.0 Froyo to drop and flash them on your phones. I for one am so waiting for TeamDouche to release test0. If you feel that the wait is too long, you can always flash the nightly builds for the various devices that Cyanogen supports here . Under one condition DO NOT POST any bugs you encouter when running the nightly builds. So kmobs of #TeamDouche has posted a video showing CM6 feature list.

Must say that these guys are really doing a really good job, and in the spirit of open source, I urge all of you that use his builds to spare him a couple of dollars say like 5 and buy him some beer(s). You do realize that he would have been spending his time doing other stuff but on the contrary he keeps doing his thing and gives these wonderful ROM’s for us to use.

Android 2.2 Froyo

So I was going through the new features and API changes on Android 2.2 (some would say its rather late, but then again it better late ….) anyway So I read about this new feature which enables Exchange administrators on the device to remotely wipe the contents on the phone and reset it to factory settings in the event the phone is stolen, HOW COOL IS THAT. Especially in a city like Nairobi which has a lot of muggings, this feature comes in quite handy  I must say. There are a lot of other cool new developer  stuff which you can read on here.

Android Scripting Environment

Google has announced a new way of writing Android applications. apparently you will no longer need to have a desktop or laptop for you to write android apps. The Android Scripting Environment (ASE) will make Android development easier and more accessible for a number of developers who don’t want to build a full application.

This technology allows developers to build apps directly from their android powered phones. Developers will be able to tap into the inbuilt android API’s. You can find more information about this on