When I click share icon on Google PlayStore it automatically opens the option of various applications like WhatsApp, Skype, Facebook to send URL.
Is there any code or widget to have the same accomplished?
Have a look at Intent.ACTION_VIEW and Intent.ACTION_SEND.
With a little googling you will find many code examples.
It is a common behavior. The share button associated with lots of apps on Android. So, it is part of their code.
Related
I want to allow people to share images and text to my app. When someone shares an image, they have the choice to share it to Page A or Page B. It's similar to what Facebook does below:
I have looked at Android's official documentation on sharing. It doesn't seem to explain anything on multiple share targets, unless I'm missing something.
I am working on a website and the requirement is that user's can share a page, link or image
I want to make a share button on my webpage which allows user to share a link, image, etc via the apps installed in the user's phone. How can I achieve that.
It's should be like the share panel as shown in the image below
Loks like you want something like this:
Android get url from browser
Also look through this link
https://developer.android.com/training/app-indexing/deep-linking.html
Not very clear about the question. But from what I understand, you want to share a particular page from your app, so it can be visited using a shareable link.
I think you're looking for is Deep Linking.
Update: HTML Sharing Buttons: https://www.addtoany.com/buttons/for/website
I believe that the Web Share API is what you are looking for.
It allows you to initiate the share intent via javascript. Android then displays the exact same share popup as in native apps.
Example from MDN:
navigator.share({
title: document.title,
text: 'Hello World',
url: 'https://developer.mozilla.org',
});
Like timely, I have seen apps with share links such as google plus, facebook, and twitter. I can use these links in html and css, but I do not know how to implement them inside the app. Like Timely, it will open a popup with three choice buttons, and the user will click one and it would open the web page. How do I do this?
Sending Simple Data to Other Apps
I've seen plenty of example where people are sharing content from their application but I want to be able to share content with my application e.g. Users can press share via then Twitter.
Does anybody know any tutorials or guides? Also would you be able to share with a service? Would be a great feature to include :) Thanks
P.S. I dont want to share with Twitter/ Facebook, I want to share from apps like the browser to my app.
Have you looked at these Developer docs?
It has an example code snippet.
You can either use the SDK's / API's available for Facebook and Twitter or else you could use Intent.ACTION_SEND to share text and images to the walls at Facebook and Twitter...
I've been looking for a way to share information to social networks. I've found 2 possible solutions:
Look for installed apps and sent an intent (like android uses in it's gallery)
Use the socials network api
When looking for quick ways to implements i say use the installed apps for that but if it goes customization and generalization i think the second option is the best.
I've a hard time deciding if one outweighs the other or not.
So my question is: What is the best approach? One of the ones i suggested or a whole different way?
The Android OS uses intents to do this...
While searching for an answer to this question I came across:
Social sharing on mobile
Quoting #NewProggie
Intent share = new Intent(Intent.ACTION_SEND);
share.setType("image/jpeg") // might be text, sound, whatever
share.putExtra(Intent.EXTRA_STREAM, pathToPicture);
startActivity(Intent.createChooser(share, "share"));
Depending on the MIME type you put in for setType, the chooser will show email, gmail, SMS, twitter, facebook, flickr, or whatever!
This is the easiest way to share content for the developer, and a proven method.
I have worked with the Facebook API and I know that it's a really good one. It looks if a native Facebook app is installed, if not it pops a little popup on your screen where it does it things, if yes, it uses that app to do your things.
I think you have to take the same approach for all your Social Networks: check if app exist. if yes, use. if no, use own implementation
You might also check Socialize out http://www.GetSocialize.com . Full feature list at http://go.GetSocialize.com/features It'll let you share social actions in the app out to social networks (currently Facebook; Twitter coming this month, then likely Google+ after that).
What about the case when user does not have specific social network API installed? Then you are left with only using the API. Some might argue that if user doesn't have facebook app installed, he should not be able to share stuff on facebook, but I for example use facebook throught their mobile site, I won't waste precious space on my G1 for the hefty facebook app.
I'd go with using the API.