Skip to main content
Known Participant
March 16, 2014
Question

Air Android - Send image to an native app?

  • March 16, 2014
  • 1 reply
  • 854 views

Hi,

Air for Android supports intents, right?

I would like to open Instagram with a specific image. (like it would be invoked through the Share/Send menu)

How can I launch an action like this from Air?

Intent shareIntent = new Intent();

shareIntent.setAction(Intent.ACTION_SEND);

shareIntent.putExtra(Intent.EXTRA_STREAM, Uri.parse(MediaStore.Images.Media

.insertImage(getContentResolver(), source, title, description)));

shareIntent.setType("image/jpeg");

startActivity(Intent.createChooser(shareIntent,

getResources().getString(R.string.send_to)));

Thanks

This topic has been closed for replies.

1 reply

Projectitis
Inspiring
March 18, 2014

Check out this post on Ben's Journal.

Launching an intent seems to be just a specially formatted URL.  Hopefully you can figure it out with this? 

This example won't show you how to attach the image data to the URL (if you are sending raw data) or the path to the image (if from the gallery).  A bit more research may be required there - my guess would be that image data is base64 encoded and added as a URL variable somehow.