Popularity
1.0
Stable
Activity
0.0
Stable
11
3
4

Programming language: - - -
License: Apache License 2.0
Tags: Link     Preview     Asynchronous     Web Page     HTML    

linkpreview alternatives and similar packages

Based on the "HTML, CSS and Javascript" category.
Alternatively, view linkpreview alternatives based on common mentions on social networks and blogs.

Do you think we are missing an alternative of linkpreview or a related project?

Add another 'HTML, CSS and Javascript' Package

README

Description

An android asynchronous preview of a webpage from its link.

Versions

Getting Started (V1.0.0)

Add the dependency in build.gradle (App module)

compile 'com.eukaprotech.linkpreview:linkpreview:[email protected]'

Add permission in manifest file

<uses-permission android:name="android.permission.INTERNET" />

Usage (V1.0.0)

    LinkPreview linkPreview = new LinkPreview(context);
    String link = "the web page complete link";
    linkPreview.preview(link, new LinkPreviewHandler() {

        @Override
        public void onStart() {

        }

        @Override
        public void onGetLinkRedirectedTo(String link_redirected_to) {

        }

        @Override
        public void onGetTitle(String title) {

        }

        @Override
        public void onGetDescription(String description) {

        }

        @Override
        public void onGetFavicon(String faviconLink) {

        }

        @Override
        public void onGetImageLink(String imageLink) {

        }

        @Override
        public void onFail(String response, String error) {

        }


        @Override
        public void onComplete() {

        }
    });

By default, the necessary preview content of the web page is stored to cache for faster later retrieval.

To skip reading from cache:

   linkPreview.skipReadFromCache(true);

To skip storing to cache:

   linkPreview.skipStoreToCache(true);

The below sample will avoid reading the contents of the previewed webpage from cache:

    LinkPreview linkPreview = new LinkPreview(context);
    String link = "the web page complete link";
    linkPreview.skipReadFromCache(true).preview(link, new LinkPreviewHandler() {

        @Override
        public void onStart() {

        }

        @Override
        public void onGetLinkRedirectedTo(String link_redirected_to) {

        }

        @Override
        public void onGetTitle(String title) {

        }

        @Override
        public void onGetDescription(String description) {

        }

        @Override
        public void onGetFavicon(String faviconLink) {

        }

        @Override
        public void onGetImageLink(String imageLink) {

        }

        @Override
        public void onFail(String response, String error) {

        }


        @Override
        public void onComplete() {

        }
    });

The entire cache, for all previewed web pages, is cleared with time.

To force the clearing of cache, use the static method:

   LinkPreview.clearCache(context);

Download