<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Shafiq Mustapa</title>
    <description>The latest articles on DEV Community by Shafiq Mustapa (@sicksand).</description>
    <link>https://dev.to/sicksand</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F125145%2F05818233-f332-4659-9278-df8a9538e3d3.jpeg</url>
      <title>DEV Community: Shafiq Mustapa</title>
      <link>https://dev.to/sicksand</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/sicksand"/>
    <language>en</language>
    <item>
      <title>Advice - Android application to get automated advice</title>
      <dc:creator>Shafiq Mustapa</dc:creator>
      <pubDate>Mon, 04 Feb 2019 15:47:02 +0000</pubDate>
      <link>https://dev.to/sicksand/advice---android-application-to-get-automated-advice-1jgh</link>
      <guid>https://dev.to/sicksand/advice---android-application-to-get-automated-advice-1jgh</guid>
      <description>&lt;p&gt;Appreciated if you guys can download my app &lt;a href="https://play.google.com/store/apps/details?id=my.sustento.apeaceofadvice&amp;amp;referrer=utm_source%3Ddev.to%26utm_medium%3Darticles%26utm_campaign%3Ddev.to"&gt;Advice&lt;/a&gt; on Play Store &lt;/p&gt;

&lt;h1&gt;
  
  
  API
&lt;/h1&gt;

&lt;p&gt;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 -&amp;gt; &lt;a href="https://api.adviceslip.com/" rel="noopener noreferrer"&gt;Advice Slip&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Open up my Android Studio and create a new project, A Peace of Advice. Supply the url for getting an advice &lt;a href="https://api.adviceslip.com/advice" rel="noopener noreferrer"&gt;GET&lt;/a&gt; will return&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="err"&gt;slip:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="err"&gt;advice:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"What's stopping you?"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="err"&gt;slip_id:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"159"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;
  
  
  Android
&lt;/h1&gt;

&lt;p&gt;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. &lt;/p&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;h1&gt;
  
  
  Font
&lt;/h1&gt;

&lt;p&gt;For advice text I will be using &lt;a href="https://fonts.google.com/specimen/Abril+Fatface?selection.family=Abril+Fatface" rel="noopener noreferrer"&gt;Abril Fatface&lt;/a&gt; and for the copyright text I choose &lt;a href="https://fonts.google.com/specimen/Lato" rel="noopener noreferrer"&gt;Lato Thin&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Unsplash
&lt;/h1&gt;

&lt;p&gt;Still the app lack of something visual. I need a collection of portrait wallpaper that is refreshing. &lt;a href="https://unsplash.com" rel="noopener noreferrer"&gt;Unsplash&lt;/a&gt; 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 (&lt;a href="https://github.com/KeenenCharles/AndroidUnplash" rel="noopener noreferrer"&gt;https://github.com/KeenenCharles/AndroidUnplash&lt;/a&gt;). &lt;/p&gt;

&lt;p&gt;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. &lt;/p&gt;

&lt;p&gt;I've uploaded my apk to production release in the play store on the same day. Here are some of the screenshot using &lt;a href="https://shotsnapp.com/" rel="noopener noreferrer"&gt;Shotsnapp&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi.imgur.com%2FJ9UHRiV.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi.imgur.com%2FJ9UHRiV.png" alt="Screenshot 1"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi.imgur.com%2F6WP3IPC.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi.imgur.com%2F6WP3IPC.png" alt="Screenshot 2"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi.imgur.com%2F3RCpIQR.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi.imgur.com%2F3RCpIQR.png" alt="Screenshot 3"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi.imgur.com%2FPlHYbyu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi.imgur.com%2FPlHYbyu.png" alt="Screenshot 4"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi.imgur.com%2FaIzLuYx.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi.imgur.com%2FaIzLuYx.jpg" alt="Screenshot 5"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;My app &lt;a href="https://play.google.com/store/apps/details?id=my.sustento.apeaceofadvice&amp;amp;referrer=utm_source%3Ddev.to%26utm_medium%3Darticles%26utm_campaign%3Ddev.to"&gt;Advice&lt;/a&gt; on Play Store &lt;/p&gt;

</description>
      <category>android</category>
      <category>api</category>
      <category>unsplash</category>
    </item>
    <item>
      <title>Public API's</title>
      <dc:creator>Shafiq Mustapa</dc:creator>
      <pubDate>Tue, 08 Jan 2019 05:36:32 +0000</pubDate>
      <link>https://dev.to/sicksand/public-apis-16dh</link>
      <guid>https://dev.to/sicksand/public-apis-16dh</guid>
      <description>&lt;p&gt;Yesterday from my Telegram Channel, there is a website that list all public api. I'm a sucker for API. Try to make at least one app (on Android) from the lists. One that caught my attention is Advice Slip (&lt;a href="http://api.adviceslip.com/"&gt;http://api.adviceslip.com/&lt;/a&gt;) &lt;/p&gt;

&lt;p&gt;It return simple json.&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;{&lt;br&gt;
slip: {&lt;br&gt;
advice: "You can fail at what you don't want. So you might as well take a chance on doing what you love.",&lt;br&gt;
slip_id: "184"&lt;br&gt;
}&lt;br&gt;
}&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;I want to use unsplash api (&lt;a href="https://unsplash.com"&gt;https://unsplash.com&lt;/a&gt;) as background and the text on top of image will be the advice from Advice Slip.&lt;/p&gt;

&lt;p&gt;So here is the site : &lt;a href="https://public-apis.xyz/"&gt;https://public-apis.xyz/&lt;/a&gt; for you developer out there to make some MVP. Happy coding.&lt;/p&gt;

</description>
      <category>api</category>
      <category>android</category>
    </item>
    <item>
      <title>dev.to is still in 2018 (GMT+8)</title>
      <dc:creator>Shafiq Mustapa</dc:creator>
      <pubDate>Tue, 01 Jan 2019 03:59:52 +0000</pubDate>
      <link>https://dev.to/sicksand/devto-is-still-in-2018-gmt8-2eib</link>
      <guid>https://dev.to/sicksand/devto-is-still-in-2018-gmt8-2eib</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--weZaR6To--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/c20kt65edy6ukyrkdp08.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--weZaR6To--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/c20kt65edy6ukyrkdp08.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>newyear</category>
    </item>
  </channel>
</rss>
