0

I need to implement custom social sharing dialog for android to share an image from my app to other apps like Instagram, facebook, twitter, photogrid, etc. How can I get the list of such apps where I can share the image file? Also, if the user selects the "Instagram" button then all three sharing options like "Direct", "Feed" and "Story" come in android default social sharing dialog. I want to do the same for all the apps. How to get a list of such apps?

I have tried following code but it doesn't give what I need (Not the separate share options for one app like e.g. "instagram".

public void getAppList(){
    final PackageManager pm = getPackageManager();
    int social_app_count = 0;
    List<ApplicationInfo> packages = pm.getInstalledApplications(PackageManager.GET_META_DATA);
    Log.d("applist", "Installed package count "+packages.size());
    for (ApplicationInfo packageInfo : packages) {
        if(!isSystemPackage(packageInfo)) {
            social_app_count++;
            Log.d("applist", "Installed package :" + packageInfo.packageName);
            Log.d("applist", "Source dir : " + packageInfo.sourceDir);
            Log.d("applist", "Launch Activity :" + pm.getLaunchIntentForPackage(packageInfo.packageName));
            Log.d("applist", "getAllPermissionGroups :" + pm.getAllPermissionGroups(PackageManager.GET_META_DATA));
        }
    }
    Log.d("applist", "User installed package count "+social_app_count);
}
Cœur
  • 37,241
  • 25
  • 195
  • 267
VMS
  • 1
  • 1
  • Have you checked this [answer](https://stackoverflow.com/a/50461981/11833795)? – Niraj Dec 20 '19 at 07:19
  • have you checked this https://developer.android.com/training/sharing/send – Vish Dec 20 '19 at 07:28
  • Does this answer your question? [Get list of all social media application installed in phone?](https://stackoverflow.com/questions/50461802/get-list-of-all-social-media-application-installed-in-phone) – Viral Patel Dec 20 '19 at 07:33
  • @Niraj Referred the specified link. It returns output as "error" everytime. – VMS Dec 20 '19 at 08:02
  • @ViralPatel Referred the specified link. It returns output as "error" everytime. – VMS Dec 20 '19 at 08:03
  • @Vish this link isn't helping me for fulfill the desired requirements. – VMS Dec 20 '19 at 08:03
  • can you please check this too, https://stackoverflow.com/questions/13941093/how-to-share-entire-android-app-with-share-intent – Vish Dec 20 '19 at 08:18

0 Answers0