tags:

views:

217

answers:

2

Is it possible to share my video or my photo from my application on the web in android?If possible how to do this? I made a application and now i want to share some my feature on the web so how i can do it? Thanks

+2  A: 

Depending on what exactly you mean, it’s possible that this functionality is already built in. Using the ACTION_SEND intent allows the system to coordinate activities to share arbitrary kinds of data. Applications exist that can send images and videos to Twitter, YouTube, Picasa, MMS, Bluetooth, etc.

Something like this (untested) will inform the system that you have an image to share:

Intent msg = new Intent(Intent.ACTION_SEND);
msg.setType("image/jpeg");
msg.putExtra(Intent.EXTRA_STREAM, Uri.parse("file:///sdcard/foo.jpg"));
startActivity(Intent.createChooser(msg, "Share image"));

Now, if you want your application to send images specifically to your web service, you can still use this send intent, but also include an activity that can handle this sort of request. If you still use the intent chooser, the user will have the advantage of being able to send their images and videos to other places besides your web service, and your application will feel like an integrated Android app. On the other hand, bypassing the intent chooser and just uploading it directly makes your app feel more streamlined but less flexible.

The Android API includes the org.apache.http framework for talking to web services.

jleedev
But how to share in facebook or twitter by our own application?
RBADS
Either you can use the intents system and depend on external facebook/twitter applications, or you can implement the API.
jleedev
I just want to implement share feature of android that is in gallery of phone.I have seen that when we go to gallery of phone, in menu there is share option.Same thing i want to implement in my app.Is it possible or not
RBADS
A: 

Thank you -- this is exactly what I am looking for (and exactly what the OP was looking for as well so far as I can tell).

Mark