预览android中的URL,Facebook在发布链接之前所做的操作(链接预览) [英] Preview a URL in android, the way facebook does before you post a link (Link Preview)

查看:134
本文介绍了预览android中的URL,Facebook在发布链接之前所做的操作(链接预览)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个EditText来输入Web链接.我想预览输入的URL,类似于Facebook中的功能,我们在其中发布一个链接,并会看到页面的图像,标题位于顶部,URL位于底部.

I have an EditText to input a web link. I want to preview the inputted URL, similar to the function in Facebook, where we post a link and will see an image of the page, with the title on top and URL at the bottom.

如何在Android中进行开发?

How can I develop this in Android?

推荐答案

在用户在editext中输入链接以进行解析后,使用 JSOUP 您的链接OG元标记(这就是FB所看到的)刮出了元标记:

Use JSOUP after the user enters a link in the editext to parse out your links OG meta tags (this is what FB looks at) scrape out the meta tags:

以下是您最近的

这篇关于预览android中的URL,Facebook在发布链接之前所做的操作(链接预览)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆