I am working on an application where I think rich link preview (whatsapp supports it,refer image) will be helpful for users but I am not able to get an idea to start on it.Any kind of suggestion/hint on how to do this will be helpful.

- 1,034
- 4
- 11
- 17
4 Answers
Update here is the latest solution
implementation 'io.github.ponnamkarthik:richlinkpreview:1.0.9'
in your XML
<io.github.ponnamkarthik.richlinkpreview.RichLinkView
android:id="@+id/richLinkView"
android:layout_width="match_parent"
android:layout_height="wrap_content">
</io.github.ponnamkarthik.richlinkpreview.RichLinkView>
in java :
richLinkView = (RichLinkView) findViewById(R.id.richLinkView);
richLinkView.setLink("https://stackoverflow.com", new ViewListener() {
@Override
public void onSuccess(boolean status) {
}
@Override
public void onError(Exception e) {
}
});
For more styles visit
Old Answer
You can use this Android Link Preview library on github. for that just add the repository to your build.gradle file like this
repositories {
jcenter()
maven { url 'https://github.com/leonardocardoso/mvn-repo/raw/master/maven-deploy'}
}
And you can use the artifacts like this:
dependencies {
compile 'org.jsoup:jsoup:1.8.3' // required
compile 'com.leocardz:link-preview:1.2.1@aar'
}
you can download a sample application from here

- 553
- 6
- 27

- 623
- 9
- 26
-
1Link is fixed please check – Digvijay Singh Mar 20 '19 at 19:50
-
1it is not properly working when we used it in recycler view, the preview images are wrongly showing in the recycler view items. – Madhan Aug 07 '19 at 06:16
-
1@Madhan can you show us how you implemented in the recycler view... as an answer to this question maybe – DragonFire Jan 22 '20 at 09:07
-
1@Madhan please ask another question – Digvijay Singh Oct 29 '20 at 18:35
-
@DigvijaySingh This library is no more compatible with the android studio, any solution? – Muhammad Afzal Apr 21 '22 at 07:50
-
This library does not work anymore! Can't even add it to dependency! – Junia Montana May 01 '22 at 18:15
I am late in the party, but I have found new lib which provide easy to integrate and default preview style, i.e WhatsApp, Skype, Telegram etc...
implementation ‘io.github.ponnamkarthik:richlinkpreview:1.0.9’
Link Preview lib integration step by step
Please check easy implementation from above link

- 2,088
- 2
- 16
- 23
-
1Its work for me for youtube URL as well, Can you please check the medium post example, if still not get, if you can provide youtube URL I can check the issue – Hitesh Dhamshaniya Jun 17 '20 at 12:33
-
2that worked for me as well, I wasn't using latest jsoup version, so that was not working. After I updated jsoup version it started working. – NehaK Jun 18 '20 at 08:04
-
1@Hitesh It doesn't provide data of Twitter and Facebook links. Any solution for that? – Shahood ul Hassan Jun 25 '20 at 01:31
-
1@ShahoodulHassan Did you get twitter icon in the preview, I can see the Twitter icon when I tried to get the preview form any tweet... The issue is already registered in lib https://github.com/PonnamKarthik/RichLinkPreview/issues/10 – Hitesh Dhamshaniya Jun 25 '20 at 10:08
-
@ShahoodulHassan hi, have you found any solution for how to get preview from twitter link? – pratik vekariya Sep 23 '20 at 11:41
I found this library, I didn't try it but hope will work for you https://github.com/FreesoulApps/PreviewAndroid

- 238
- 3
- 5
I just tried and implement the Rich Link Preview feature into my app through URLEmbeddedView and it was working perfectly fine. Before that, i tried to implement almost all solutions but failed because mostly are outdated and do not support on the latest android API levels. Let me know if anyone is facing issue

- 118
- 1
- 9