I want to share image via Flickr, Tumblr, Instagram. I want to do this with these 3 installed apps. I found for Instagram:
Intent shareIntent = new Intent(Intent.ACTION_SEND);
shareIntent.setType("image/*");
shareIntent.putExtra(Intent.EXTRA_TEXT, "" + getShareText());
shareIntent.putExtra(Intent.EXTRA_SUBJECT, "" + getShareText());
shareIntent.putExtra(Intent.EXTRA_STREAM,
Uri.parse("file://" + file.getAbsolutePath()));
shareIntent.setPackage("com.instagram.android");
Can I have Tumblr and Flickr also? Yes, I can do with Oauth process by integrating libs. But I want to share via particular installed app.
If you remove the last line (setPackage) all installed apps that can handle sending images will show up in the app chooser dialog, including tumblr and flickr. In case you want to limit the apps to only the three apps you mention: why would you? You'd just be limiting what a user can do with your app. I don't think that's possible anyway.
More detailed information on creating Android intents for images and videos is available at http://instagram.com/developer/mobile-sharing/android-intents/
Just set the correct package name in :
com.tumblr
com.yahoo.mobile.client.android.flickr
You can find the package names in the Google Play Store URLs :
https://play.google.com/store/apps/details?id=PACKAGE_NAME
PS : it is better to check if the app is installed on the device first :
Sharing using SEND_ACTION do not require OAUTH in your app, auth is managed in the targeted app.
Thanks