【问题标题】:How to to upload photos (or pass them )to Instagram via my own android app and Tag it with my own message [closed]如何通过我自己的 android 应用程序将照片上传(或传递)到 Instagram 并用我自己的消息标记它[关闭]
【发布时间】:2015-11-18 18:51:04
【问题描述】:

我正在尝试开发一个 android 应用程序,我想将图像上传到我的 instagram 应用程序并在标题部分写我自己的消息或添加一个位置。我对此进行了一些研究,发现我无法使用 instagtam 的 API 直接上传图像。所以我试图将我的照片传递给 Instagram 应用程序并添加我的标题和位置。如何将字幕消息和我的位置传递给 Instagram 应用?!

请你帮帮我。提前致谢

【问题讨论】:

    标签: android location instagram instagram-api caption


    【解决方案1】:
        String type = "image/*";
    String filename = "/myPhoto.jpg";
    String mediaPath = Environment.getExternalStorageDirectory() + filename;
    
    createInstagramIntent(type, mediaPath);
    
    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"));
    }
    

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2011-12-12
    • 1970-01-01
    • 2013-11-13
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多