{"id":3671,"url":"https://github.com/LeonardoCardoso/Android-Link-Preview","last_synced_at":"2025-08-03T22:32:11.572Z","repository":{"id":146602179,"uuid":"11730361","full_name":"LeonardoCardoso/Android-Link-Preview","owner":"LeonardoCardoso","description":"It makes a preview from an url, grabbing all the information such as title, relevant texts and images. This a version for Android of my web link preview https://github.com/LeonardoCardoso/Link-Preview","archived":true,"fork":false,"pushed_at":"2020-02-12T14:09:02.000Z","size":5556,"stargazers_count":420,"open_issues_count":19,"forks_count":131,"subscribers_count":21,"default_branch":"master","last_synced_at":"2024-08-16T15:39:54.211Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/LeonardoCardoso.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2013-07-29T03:26:00.000Z","updated_at":"2024-06-04T20:18:09.000Z","dependencies_parsed_at":"2023-04-26T15:02:44.883Z","dependency_job_id":null,"html_url":"https://github.com/LeonardoCardoso/Android-Link-Preview","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LeonardoCardoso%2FAndroid-Link-Preview","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LeonardoCardoso%2FAndroid-Link-Preview/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LeonardoCardoso%2FAndroid-Link-Preview/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LeonardoCardoso%2FAndroid-Link-Preview/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LeonardoCardoso","download_url":"https://codeload.github.com/LeonardoCardoso/Android-Link-Preview/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228571844,"owners_count":17938772,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-01-05T20:16:48.126Z","updated_at":"2024-12-07T06:30:50.254Z","avatar_url":"https://github.com/LeonardoCardoso.png","language":"Java","funding_links":[],"categories":["Other","Libraries"],"sub_categories":["Other"],"readme":"LeoCardz Link Preview for Android\n=================================\n\n[![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-Android--Link--Preview-green.svg?style=true)](https://android-arsenal.com/details/1/2755)\n\nIt makes a preview from an url, grabbing all the information such as title, relevant texts and images.\n\n## Visual Examples\n![Preview](images/VSejRyV.gif)\n\n## Sample App\nFor a sample app, please install it from [Android Link Preview on Google Play](https://play.google.com/store/apps/details?id=com.leocardz.link.preview\u0026feature=search_result \"Android Link Preview on Google Play\").\n\n\n## Requirements\n* [jsoup](http://jsoup.org/ \"jsoup\") is a smart lib to get the html code.\n\n\n## Installation\n### gradle\n\nSimply add the repository to your build.gradle file:\n```groovy\nrepositories {\n\tjcenter()\n\tmaven { url 'https://github.com/leonardocardoso/mvn-repo/raw/master/maven-deploy' }\n}\n```\n\nAnd you can use the artifacts like this:\n```groovy\ndependencies {\n    compile 'org.jsoup:jsoup:1.8.3' // required\n\tcompile 'com.leocardz:link-preview:2.0.0@aar'\n\t// ...\n}\n```\n\n### ProGuard\nIf you use ProGuard, it is advised that you keep the jsoup dependencies  by adding \n```groovy\n-keeppackagenames org.jsoup.nodes\n```\nto your ProGuard rules file.\n\n\n## Usage\n#### Instantiating \n```java\nimport com.leocardz.link.preview.library.TextCrawler;\n// ...\n// Create an instance of the TextCrawler to parse your url into a preview.\nTextCrawler textCrawler = new TextCrawler();\n\n// ..\n\n// Create the callbacks to handle pre and post exicution of the preview generation.\nLinkPreviewCallback linkPreviewCallback = new LinkPreviewCallback() {\n    @Override\n    public void onPre() {\n        // Any work that needs to be done before generating the preview. Usually inflate \n        // your custom preview layout here.\n    }\n\n    @Override\n    public void onPos(SourceContent sourceContent, boolean b) {\n        // Populate your preview layout with the results of sourceContent.\n    }\n};\n```\n\n#### Generate Preview\n```java\ntextCrawler.makePreview( linkPreviewCallback, url);\n```\n#### Cancel unfinished tasks when views are destroied.\nIf you are using Android Link Preview inside of an Activity, it is important to cancel unfinished Preview activites at the end of the Activity's lifecycle.\n\n```java\n @Override\n    protected void onDestroy() {\n        super.onDestroy();\n        textCrawler.cancel();\n    }\n```\n\nApps using Android Link Preview\n=================================\n1. [Unshorten It](https://play.google.com/store/apps/details?id=com.leocardz.url.unshortener\u0026feature=search_result \"Unshorten It\")\n\n2. ...\n\n\nInformation and Contact\n===\n\nDeveloped by [@LeonardoCardoso](https://github.com/LeonardoCardoso). \n\nContact me either by Twitter [@leocardz](https://twitter.com/leocardz) or emailing me to [contact@leocardz.com](mailto:contact@leocardz.com).\n\nRelated Projects\n===\n\n* [Swift Link Preview](https://github.com/LeonardoCardoso/Swift-Link-Preview)\n* [Link Preview (PHP + Angular + Bootstrap)](https://github.com/LeonardoCardoso/Link-Preview)\n\nLicense\n=================================\n\n    Copyright 2013 Leonardo Cardoso\n\n    Licensed under the Apache License, Version 2.0 (the \"License\");\n    you may not use this file except in compliance with the License.\n    You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n    Unless required by applicable law or agreed to in writing, software\n    distributed under the License is distributed on an \"AS IS\" BASIS,\n    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n    See the License for the specific language governing permissions and\n    limitations under the License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FLeonardoCardoso%2FAndroid-Link-Preview","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FLeonardoCardoso%2FAndroid-Link-Preview","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FLeonardoCardoso%2FAndroid-Link-Preview/lists"}