com.baha.url.preview

Help android developer easier to get url preview info

License

License

GroupId

GroupId

tw.com.oneup.www
ArtifactId

ArtifactId

com.baha.url.preview
Last Version

Last Version

1.0.0
Release Date

Release Date

Type

Type

aar
Description

Description

com.baha.url.preview
Help android developer easier to get url preview info
Project URL

Project URL

https://github.com/OneupNetwork/BahaUrlPreview
Source Code Management

Source Code Management

https://github.com/OneupNetwork/BahaUrlPreview

Download com.baha.url.preview

How to add to project

<!-- https://jarcasting.com/artifacts/tw.com.oneup.www/com.baha.url.preview/ -->
<dependency>
    <groupId>tw.com.oneup.www</groupId>
    <artifactId>com.baha.url.preview</artifactId>
    <version>1.0.0</version>
    <type>aar</type>
</dependency>
// https://jarcasting.com/artifacts/tw.com.oneup.www/com.baha.url.preview/
implementation 'tw.com.oneup.www:com.baha.url.preview:1.0.0'
// https://jarcasting.com/artifacts/tw.com.oneup.www/com.baha.url.preview/
implementation ("tw.com.oneup.www:com.baha.url.preview:1.0.0")
'tw.com.oneup.www:com.baha.url.preview:aar:1.0.0'
<dependency org="tw.com.oneup.www" name="com.baha.url.preview" rev="1.0.0">
  <artifact name="com.baha.url.preview" type="aar" />
</dependency>
@Grapes(
@Grab(group='tw.com.oneup.www', module='com.baha.url.preview', version='1.0.0')
)
libraryDependencies += "tw.com.oneup.www" % "com.baha.url.preview" % "1.0.0"
[tw.com.oneup.www/com.baha.url.preview "1.0.0"]

Dependencies

runtime (7)

Group / Artifact Type Version
org.jetbrains.kotlin : kotlin-android-extensions-runtime jar 1.4.32
org.jetbrains.kotlin : kotlin-stdlib jar 1.4.32
androidx.core » core-ktx jar 1.3.2
androidx.appcompat » appcompat jar 1.2.0
com.google.android.material » material jar 1.3.0
org.jetbrains.kotlinx : kotlinx-coroutines-android jar 1.3.9
org.jsoup : jsoup jar 1.13.1

Project Modules

There are no modules declared in this project.

BahaUrlPreview

Maven Central

The library help android developer easier to get url preview info.

100% Kotlin , use Kotlin-coroutines to fetch html code.

Inspire by LeonardoCardoso-SwiftLinkPreview,Android-Link-Preview!

Demo

device-2021-04-29-115050.mp4

How do I use BahaUrlPreview

Setup

//Top-level build.gradle
buildscript {
  ...
    repositories {
      mavenCentral()
      ...
    }
}

//project build.gradle
dependencies {
    ...
    implementation 'tw.com.oneup.www:Baha-UrlPreview:1.0.1'
}

Functions

val urlPreview = BahaUrlPreview(urlString, object : IUrlPreviewCallback {
                override fun onComplete(urlInfo: UrlInfoItem) {
                    //urlInfo.title -> is url preivew title
                    //urlInfo.description -> is url preview 
                    //urlInfo.image -> is url preview image
                 }

                override fun onFailed(throwable: Throwable) {
                   // in there control error
                 }
               })

urlPreview.fetchUrlPreview()


//avoid memory leak ,when activity or fragment destory need call BahaUrlPreview.cleanUp()

override fun onDestroy() {
  ...
   urlPreview.cleanUp()
}

Requirements

Android 5.+ (API 21)

Latest version

  • v1.0.1 (May 6 , 2021)

Recent Breaking Change Info

  • v1.0.1 1.add support to url that ends with image type (eg., .jpg

Developed By

OneupNetwork(SolinariWu)

License

MIT License

Copyright (c) 2021 OneupNetwork

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

tw.com.oneup.www

Versions

Version
1.0.0