Advice - Android application to get automated advice
Tags: android, api, unsplash
Published: 2019-02-04 15:47:02

---
title: Advice - Android application to get automated advice
published: true
description: 
tags: #android, #api, #unsplash
cover_image: https://thepracticaldev.s3.amazonaws.com/i/ycj28ilcbgjk4huak67e.png
---

Appreciated if you guys can download my app [Advice](https://play.google.com/store/apps/details?id=my.sustento.apeaceofadvice&referrer=utm_source%3Ddev.to%26utm_medium%3Darticles%26utm_campaign%3Ddev.to) on Play Store 


#API
I'm always a sucker for public API . One day on January 2019, I've discovered a public api for advice. Similar to quotes (I hate quotes) but more to advice. Here is the api -> [Advice Slip](https://api.adviceslip.com/).

Open up my Android Studio and create a new project, A Peace of Advice. Supply the url for getting an advice [GET](https://api.adviceslip.com/advice) will return 


```json
{
slip: {
advice: "What's stopping you?",
slip_id: "159"
}
}
```
#Android
So, when open up my app, the MainActivity will get an advice. Simple. But how to get a new advice? I don't want my user to open and close my app just to get the new advice. 

So I have implemented a Swipe Down gesture (pull to refresh) and my app will return a new advice. The simple part is now done but the app is too minimal. I search for UI in Pinterest on how to present a readable font and what the color schemes that I will have to choose to make it pleasant on the eyes of my user.

#Font
For advice text I will be using [Abril Fatface](https://fonts.google.com/specimen/Abril+Fatface?selection.family=Abril+Fatface) and for the copyright text I choose [Lato Thin](https://fonts.google.com/specimen/Lato)

#Unsplash
Still the app lack of something visual. I need a collection of portrait wallpaper that is refreshing. [Unsplash](https://unsplash.com) it is. For production usage, 5000 request per hour is enough (I think). All I need to register as developer to get the API. For demo app, you will only get 50 request per hour. To get unsplash working on my app, I discover an unofficial Unsplash API library for Android (https://github.com/KeenenCharles/AndroidUnplash). 

I randomized the query (android wallpaper, iphone wallpaper, wallpaper) to get random photo which is portrait mode each time when the user open up the app. This will eliminate (workaround) user get the same wallpaper. The simple part is almost done, but the process to verify the app is take longer than I've expected. Unsplash state that it will take up to 10 days to verify. Mine took 8 days plus almost 5 days to get back and forth email with the support. Luckily on 1st Feb 2019, unsplash approved my app and it's now in production environment. 

I've uploaded my apk to production release in the play store on the same day. Here are some of the screenshot using [Shotsnapp](https://shotsnapp.com/)


![Screenshot 1](https://i.imgur.com/J9UHRiV.png)
![Screenshot 2](https://i.imgur.com/6WP3IPC.png)
![Screenshot 3](https://i.imgur.com/3RCpIQR.png)
![Screenshot 4](https://i.imgur.com/PlHYbyu.png)
![Screenshot 5](https://i.imgur.com/aIzLuYx.jpg)

My app [Advice](https://play.google.com/store/apps/details?id=my.sustento.apeaceofadvice&referrer=utm_source%3Ddev.to%26utm_medium%3Darticles%26utm_campaign%3Ddev.to) on Play Store