Share on - popup snippet, and facebook problems


SDK Version: 
M3

Android always had very good social network, and communcation tool integration. All of the preinstalled communication tpye apps, and a lot of 3rd party apps have support for communcation between each other, via the ACTION_SEND intent.

  1. Intent shareIntent=new Intent(android.content.Intent.ACTION_SEND);
  2. shareIntent.setType("text/plain");
  3. shareIntent.putExtra(Intent.EXTRA_SUBJECT, "subjectText");
  4. shareIntent.putExtra(Intent.EXTRA_TEXT, "shareText");
  5. startActivity(Intent.createChooser(shareIntent, "ShareWindowTitle"));

On a 1.5 emulator, all there is, is an sms composer:

1.5 emulator

On a 2.2 Nexus one with a lot of installed apps:

2.2 nexus one

There are also a lot of useful android.content.Intent methods, check them out at the
official docs.

About facebook:
Even if you have the factory installed facebook app, or you updated to the one that's on the market (which is the same app, even if it doesn't tell you that it's an update), ACTION_SEND works like this:
-if you were not logged in in the fb app, it starts the app, you log in, and then forgets about the fact, that you wanted to share something.
-if you were logged in, it starts the web browser: m.facebook.com. Well at least you are logged in, but the page is so small, and lightweight, the first time I used it, I did not even notice that something happened, when I pressed send. So I sent the same message 10 times.

fb

I know that there is an official facebook android api(which is a webview in a popup dialog), but it's in alpha state.
There is also fbconnect for android, which has the following message on its homepage:
"NOTE: You should use official Facebook SDK for Android as of May 27th 2010"

So right now, developers will have to spend some time, to integrate either alpha status code into their own, or walk the official way, which seems to be unfinished.