I have researched this more and the best option is to share a link to the Google play website. It is explained more here:
http://stackoverflow.com/questions/21115881/how-to-open-the-google-play-app-from-a-shared-facebook-link On Monday, January 13, 2014 3:09:32 PM UTC+1, TreKing wrote: > > I think I may have misunderstood your original question. I don't use > Facebook so I'm not familiar with the flow of sharing with it, so I'm not > sure I can be of much help. I'm surprised, though, that opening the http:// > link does not give you option to open the app in the Google Play app. > > > On Mon, Jan 13, 2014 at 4:07 AM, MobileVisuals > <[email protected]<javascript:> > > wrote: > >> Yes.I am the programmer here and it is my own app. The devices that I am >> testing on have Play store installed. I assume that the correct intent has >> to be created with >> >> Intent sharingIntent = new Intent(android.content.Intent.ACTION_SEND); >> sharingIntent.setType("text/plain"); >> >> It has to be started with >> >> startActivity(Intent.createChooser(sharingIntent, "Share via")); >> >> The problem is how to set the information in the intent(the code between >> creating the intent and starting it).I used this code before and it started >> the web page for the app without problems: >> >> sharingIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, "Product >> name"); >> sharingIntent.putExtra(android.content.Intent.EXTRA_TEXT, " >> https://play.google.com/store/apps/details?id=example.package"); >> >> I try to replace this with the following code, which should start Google >> play: >> >> sharingIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, "Product >> name"); >> sharingIntent.putExtra(android.content.Intent.EXTRA_TEXT, >> Uri.parse("market://details?id=example.package")); >> >> >> This results in that the link to the appstore is not included when I try >> to share the link from Facebook. I test with 2 different devices, which >> both have Google play. I also try with >> >> sharingIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, "Product >> name"); >> sharingIntent.setData(Uri.parse("market://details?id=example.package")); >> >> This resulted in the error message "can not find the application to >> perform this action". Do you know how I can solve this problem? I have >> replaced the package name of my app with an example package in this thread, >> but I am using the correct package name when I am testing. >> >> >> >> >> On Sunday, January 12, 2014 6:40:17 PM UTC+1, TreKing wrote: >> >>> >>> On Sun, Jan 12, 2014 at 5:48 AM, MobileVisuals <[email protected] >>> > wrote: >>> >>>> I tried to implement according to their advice, but the link to the >>>> appstore is not included when the user tries to share the link now. I >>>> tested from a Facebook test account. Do you know how I can fix this? >>> >>> >>> I'm not entirely sure what you're referring to. Aren't you writing code >>> for your own app? So you control the code? You just have to create the >>> correct intent and start it, the system will do the rest (assuming the >>> device has the Play store installed, of course). >>> >>> ------------------------------------------------------------ >>> ------------------------------------- >>> TreKing <http://sites.google.com/site/rezmobileapps/treking> - Chicago >>> transit tracking app for Android-powered devices >>> >> -- >> You received this message because you are subscribed to the Google >> Groups "Android Developers" group. >> To post to this group, send email to >> [email protected]<javascript:> >> To unsubscribe from this group, send email to >> [email protected] <javascript:> >> For more options, visit this group at >> http://groups.google.com/group/android-developers?hl=en >> --- >> You received this message because you are subscribed to the Google Groups >> "Android Developers" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected] <javascript:>. >> For more options, visit https://groups.google.com/groups/opt_out. >> > > > > -- > > > ------------------------------------------------------------------------------------------------- > TreKing <http://sites.google.com/site/rezmobileapps/treking> - Chicago > transit tracking app for Android-powered devices > -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en --- You received this message because you are subscribed to the Google Groups "Android Developers" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/groups/opt_out.

