https://github.com/kibotu/urlshortener
Kotlin library which shortens url.
https://github.com/kibotu/urlshortener
android google-api hacktoberfest tinyurl urlshortener
Last synced: 3 months ago
JSON representation
Kotlin library which shortens url.
- Host: GitHub
- URL: https://github.com/kibotu/urlshortener
- Owner: kibotu
- License: apache-2.0
- Created: 2016-12-08T17:05:59.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-01-17T16:09:40.000Z (over 9 years ago)
- Last Synced: 2025-10-09T22:36:39.269Z (8 months ago)
- Topics: android, google-api, hacktoberfest, tinyurl, urlshortener
- Language: Kotlin
- Homepage:
- Size: 124 KB
- Stars: 10
- Watchers: 2
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://www.paypal.me/janrabe) [](https://about.me/janrabe)
# UrlShortener [](https://android-arsenal.com/details/1/4819) [](https://jitpack.io/#kibotu/UrlShortener) [](https://jitpack.io/com/github/kibotu/UrlShortener/master-SNAPSHOT/javadoc/index.html) [](https://travis-ci.org/kibotu/UrlShortener) [](https://android-arsenal.com/api?level=15) [](https://docs.gradle.org/current/release-notes) [](https://github.com/evant/gradle-retrolambda) [](https://raw.githubusercontent.com/kibotu/UrlShortener/master/LICENSE)
## Introduction
Shortens url using [google shortener service](https://developers.google.com/url-shortener/).
## How to use
1) Update [Google Api Key](https://developers.google.com/url-shortener/v1/getting_started#APIKey) in your [string.xml](https://github.com/kibotu/UrlShortener/blob/master/lib/src/main/res/values/strings.xml)
my-google-api-key
2) [Request shortened url](https://github.com/kibotu/UrlShortener/blob/master/app/src/main/java/net/kibotu/urlshortener/app/MainActivity.java#L21-L26)
Using TinyUrl Service
UrlShortener.shortenUrlByTinyUrl("http://www.google.com")
.subscribeOn(Schedulers.newThread())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(r -> {
Log.v(TAG, "[onCreate] shortenUrlByTinyUrl " + r);
}, Throwable::printStackTrace);
Using Google Shortener Service (Requires API Key)
UrlShortener.shortenUrlByGoogle(this, "http://www.google.com")
.subscribeOn(Schedulers.newThread())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(r -> {
Log.v(TAG, "[onCreate] shortenUrlByGoogle " + r);
}, Throwable::printStackTrace);
(Optional) enable logging
UrlShortener.setEnableLogging(true);
## How to install
compile 'com.github.kibotu:UrlShortener:-SNAPSHOT'
## How to build
graldew clean build
### CI
gradlew clean assembleRelease test javadoc
#### Build Requirements
- Android Build Tools 25.0.2
- Android SDK 25
## Contributors
[Jan Rabe](jan.rabe@kibotu.net)
###License
Copyright 2016 Jan Rabe
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.