1

How can I send a link from the application that I'm doing now to a specific URL?

 blah.setOnClickListener(new OnClickListener() {
            @Override
            public void onClick(View arg0) {
                Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("https://player.vimeo.com/video/83178705?"));
                startActivity(browserIntent);
            }
        });
Alfie Hanssen
  • 16,964
  • 12
  • 68
  • 74
Roa
  • 109
  • 7
  • I couldn't write it simpler than that :) – Roa Mar 04 '16 at 03:15
  • http://stackoverflow.com/questions/3004515/android-sending-an-intent-to-browser-to-open-specific-url – Jeffrey Blattman Mar 04 '16 at 03:21
  • I'm not sure if that was not for vimeo – Roa Mar 04 '16 at 03:24
  • Vimeo, Youtube, whatever. What's how you open a link in the Android browser. A link is a link. It's handled by the browser. If you are asking how to open a link in the Vimeo Android app, please refer to the documentation for that app. – Jeffrey Blattman Mar 04 '16 at 03:26
  • So that's it I believe, I;ll apply it in a few :) (Edited) – Roa Mar 04 '16 at 03:38
  • Possible duplicate of [How can I open a URL in Android's web browser from my application?](http://stackoverflow.com/questions/2201917/how-can-i-open-a-url-in-androids-web-browser-from-my-application) – konkked Mar 04 '16 at 03:43
  • Ok, I can't understand 50%! Can you write me the code? Please? – Roa Mar 04 '16 at 03:58

1 Answers1

2

If you wish to open the Vimeo URL in the Vimeo Android application, you can either do as you posted, or you can intent out to the Vimeo application with the correct intent data (a.k.a. deep linking). To help facilitate both of these intent types, you can use the vimeo-deeplink-android library.

For the above video https://www.vimeo.com/83178705 you have two options:

VimeoDeeplink.openUrl(getApplicationContext(), "https://www.vimeo.com/83178705");

VimeoDeeplink.showVideoWithUri(getApplicationContext(), "/videos/83178705");

For the latter request, you could re-write it as:

VimeoDeeplink.showVideoWithUri(getApplicationContext(), VimeoDeeplink.VIMEO_VIDEO_URI_PREFIX + "83178705");

These requests will all open the Vimeo Android application (if installed) and launch the video player.

Kevin Z
  • 333
  • 1
  • 10