I want to make android application to send picture, message to instagram users using instagram API

995 Views Asked by At

I've tried several sources from Google and GitHub but didn't find any authentic source that could help me sending multiple pictures and posts automatically from my android gallery using the scheduler. Is anyone working with the Instagram API? If so, could you please give me some authentic source?

1

There are 1 best solutions below

0
On

Instead of using the Instagram API, you can directly start an Intent to post an Image or Video to Instagram by opening a "Share with" dialog. This will require user interaction.

String type = "image/*";
String filename = "/myPhoto.jpg";
String mediaPath = Environment.getExternalStorageDirectory() + filename;

private void createInstagramIntent(String type, String mediaPath){

    // Create the new Intent using the 'Send' action.
    Intent share = new Intent(Intent.ACTION_SEND);

    // Set the MIME type
    share.setType(type);

    // Create the URI from the media
    File media = new File(mediaPath);
    Uri uri = Uri.fromFile(media);

    // Add the URI to the Intent.
    share.putExtra(Intent.EXTRA_STREAM, uri);

    // Broadcast the Intent.
    startActivity(Intent.createChooser(share, "Share to"));
}

Code example taken from https://www.instagram.com/developer/mobile-sharing/android-intents/