All Projects → KeenenCharles → Androidunplash

KeenenCharles / Androidunplash

Licence: mit
An unofficial Unsplash API library for Android

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Androidunplash

Resplash
Unofficial Unsplash Android App
Stars: ✭ 395 (+393.75%)
Mutual labels:  unsplash, photos
Datasets
🎁 3,000,000+ Unsplash images made available for research and machine learning
Stars: ✭ 1,805 (+2156.25%)
Mutual labels:  unsplash, photos
Unsplash Js
🤖 A server-side JavaScript wrapper for the Unsplash API
Stars: ✭ 1,647 (+1958.75%)
Mutual labels:  unsplash, photos
Unsplash rb
💎 Ruby wrapper for the Unsplash API.
Stars: ✭ 202 (+152.5%)
Mutual labels:  unsplash, photos
Unsplash Php
👻 Official PHP wrapper for the Unsplash API
Stars: ✭ 332 (+315%)
Mutual labels:  unsplash, photos
go-unsplash
Go Client for the Unsplash API
Stars: ✭ 70 (-12.5%)
Mutual labels:  photos, unsplash
Unsplashkit
Swift client for Unsplash
Stars: ✭ 183 (+128.75%)
Mutual labels:  unsplash, photos
Natural Language Image Search
Search photos on Unsplash using natural language
Stars: ✭ 359 (+348.75%)
Mutual labels:  unsplash, photos
Splash Cli
A simple, command line tool to download Unsplash wallpapers. It’s not intended to be anything particularly fancy — it just works.
Stars: ✭ 432 (+440%)
Mutual labels:  unsplash, photos
Photo Blog
The Photo Blog Application based on Laravel 5 and Vue.js 2 + Prerender
Stars: ✭ 55 (-31.25%)
Mutual labels:  photos
Tumblr Liked Photos Export
Export the photos from your liked posts in tumblr
Stars: ✭ 74 (-7.5%)
Mutual labels:  photos
Gphotos Sync
Google Photos and Albums backup with Google Photos Library API
Stars: ✭ 1,066 (+1232.5%)
Mutual labels:  photos
Mue
Fast, open and free-to-use new tab page for modern browsers
Stars: ✭ 56 (-30%)
Mutual labels:  photos
Livephoto
A single-file library for working with Apple Live Photos
Stars: ✭ 75 (-6.25%)
Mutual labels:  photos
Vuejs Carousel
Complete photo carousel build with VueJS and web standards in mind
Stars: ✭ 53 (-33.75%)
Mutual labels:  photos
Phototweaks
Drag, Rotate, Scale and Crop
Stars: ✭ 1,214 (+1417.5%)
Mutual labels:  photos
Easyandroid
一系列简单、轻量、方便的Android开发工具集合(持续更新中),包括Android动态权限、SharedPreferences、反射、日志、Toast、Bundle、MVP、线程池、Html、图文混排、蒙层引导、拍照、图库选择等
Stars: ✭ 1,039 (+1198.75%)
Mutual labels:  photos
Papr
🌁 An Unsplash app for iOS
Stars: ✭ 1,025 (+1181.25%)
Mutual labels:  photos
Ownyourgram
📷 Save your Instagram photos to your own website!
Stars: ✭ 78 (-2.5%)
Mutual labels:  photos
Github Pages Gallery
A zero dollar solution to host your photo/video gallery online using Github pages and GitHub Actions. No coding necessary.
Stars: ✭ 77 (-3.75%)
Mutual labels:  photos

Android Unsplash (Unofficial)

An unofficial Unsplash API library for Android

Gradle

Add the line below to your build.gradle to use:

dependencies {
    implementation 'com.kc.androidunsplash:androidunsplash:2.0.4'
}

Usage

Initialize Unsplash Client

val unsplash = Unsplash(YOUR_CLIENT_ID, YOUR_TOKEN);

You can create an app for your project at https://unsplash.com/developers You'll receive a Client ID and a Client Secret

User Authentication

Unsplash uses OAuth2 for user authentication.

You can call the authorize() method to start the process with the scopes you require access to. Ensure those scopes have been turned on in the Unsplash project dashboard.

val scopes = listOf(Scope.PUBLIC, Scope.READ_USER, Scope.WRITE_USER)
unsplash.authorize(this, YOUR_REDIRECT_URI, scopes)

If your app is mobile only you can create a redirectURI by defining a URI scheme in your Manifest

Once the user has been redirected to your app you can need to retrieve the code parameter provided in the Intent and call the getToken() method.

unsplash.getToken(YOUR_SECRET, YOUR_REDIRECT_URI, code, {
		Log.d("Token", it.accessToken)
	}, {
		Log.d("Token", it)
	})

Add the token you receive to your unsplash client to authenticate user-related requests.

unsplash.setToken(token.accessToken);

Get A List of Photos

unsplash.photos.get(1, 10, Order.LATEST, 
	onComplete = {
		Log.d("Photos", "Photos Found $it")
	},
	onError = {
		Log.d("Unsplash", it)
	}
)

Get A Photo By Id

unsplash.photos.getById("ID",
	onComplete = {
		Log.d("Photos", "Photo Found $it")
	},
	onError = {
		Log.d("Photos", it)
	}
)

Search

unsplash.photos.search(query,
	onComplete = {
		Log.d("Photos", "Total Results Found " + it.total!!)
		val photos = it.results
	},
	onError = {
		Log.d("Unsplash", it)
	}
)

Other Features

You can access other features by using their respective classes.

Collections with unsplash.collections

Users with unsplash.users

Stats with unsplash.stats

Take a look at the API documentation for what each call does in detail https://unsplash.com/documentation

Java

For Java support you can use the previous version of this library here

Built With This Library

License

MIT License

Copyright (c) 2017 Keenen Charles

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.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].