<?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: Kelvin Pere</title>
    <description>The latest articles on DEV Community by Kelvin Pere (@kelvn).</description>
    <link>https://dev.to/kelvn</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%2F169397%2F41bdae7a-b3e3-4d45-8698-44be0f5e7792.jpg</url>
      <title>DEV Community: Kelvin Pere</title>
      <link>https://dev.to/kelvn</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/kelvn"/>
    <language>en</language>
    <item>
      <title>Understanding Marvels API from an Android Developer Perspective.</title>
      <dc:creator>Kelvin Pere</dc:creator>
      <pubDate>Sat, 12 Jun 2021 20:48:13 +0000</pubDate>
      <link>https://dev.to/kelvn/understanding-marvels-api-from-an-android-developer-perspective-58ef</link>
      <guid>https://dev.to/kelvn/understanding-marvels-api-from-an-android-developer-perspective-58ef</guid>
      <description>&lt;p&gt;An interesting aspect of working as an Android Developer is working with some type of remote data by connecting to the internet. And often times we would have to rely on some type of API to use in our apps. &lt;/p&gt;

&lt;p&gt;I have look at some API Documentation and wow, its been nothing but fun. In fact I think that would be another topic for a separate article. In this article, we are going to look at the Marvels api and see how we can understand some of it in using them in your android apps.&lt;/p&gt;

&lt;h3&gt;
  
  
  Problem
&lt;/h3&gt;

&lt;p&gt;Honestly I would say the api docs of Marvel can do much better in helping those who build client side applications to effectively use it. I feel you shouldn't bother going outside the docs in learning how to use it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Getting your API KEY
&lt;/h2&gt;

&lt;p&gt;This is pretty straightforward - you simply go to this url &lt;a href="https://developer.marvel.com" rel="noopener noreferrer"&gt;https://developer.marvel.com&lt;/a&gt; and then create a free account which allows you to make 3000 calls per day on the api.&lt;/p&gt;

&lt;h2&gt;
  
  
  Parameters Needed
&lt;/h2&gt;

&lt;p&gt;We would be focusing on using the API to fetch a list of public comics with some meta-data. &lt;/p&gt;

&lt;p&gt;This url carefully explains what parameters would be needed in using the API &lt;a href="https://developer.marvel.com/documentation/authorization" rel="noopener noreferrer"&gt;https://developer.marvel.com/documentation/authorization&lt;/a&gt;. Below are the parameters needed: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Public Key =="apikey" (Note "apikey" != "apiKey" when passing them as parameters to your @GET function while using Retrofit)&lt;/li&gt;
&lt;li&gt;ts (Also know as a timestamp, it just wants to know the exact time the request was made, I don't know why but that's what it needs).&lt;/li&gt;
&lt;li&gt;hash : A md5 digest of your timestamp,public key and private key which are provided in your dashboard. If you are curious about how it really works you could do more research about that if you want, but its not really important for this aspect. Basically its just an Algorithm that converts some type of data in this instance your ts + public key and private key into a length string value. In code this would be a function that concatenates all of the strings and creates the hash value which should be in a form of string.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Now you would say, well thats pretty obvious and straight to the point. Well it is, but wasn't stated like that for those that might want to use it in a mobile client. &lt;/p&gt;

&lt;p&gt;Looking at the docs &lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpp8r2y7pf1lb4k5a7vvo.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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpp8r2y7pf1lb4k5a7vvo.PNG" alt="Picture of client auth"&gt;&lt;/a&gt; you might want to follow this instructions for your android app which is client. Please follow the instructions for server side Applications because the client in focus is for browser based applications.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Testing it in PostMan&lt;/em&gt;&lt;br&gt;
If you are like me and always test your API Endpoints using Post Man then you should take a look at this amazing GitHub repository &lt;a href="https://github.com/doamaral/postmanmarvelapi" rel="noopener noreferrer"&gt;https://github.com/doamaral/postmanmarvelapi&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Having fun with the API
&lt;/h2&gt;

&lt;p&gt;To really see how the api works and know what type of JSON data would be returned you should go to the &lt;strong&gt;Interactive Documentation tab section&lt;/strong&gt; &lt;/p&gt;

&lt;p&gt;Looking at the GET public apis &lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flxzl9pz1p29fh8qf1xuj.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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flxzl9pz1p29fh8qf1xuj.PNG" alt="Public API"&gt;&lt;/a&gt; You can decide to play around with it and know how the JSON Response is and then use that to model your Kotlin or Java Objects. &lt;/p&gt;

&lt;h3&gt;
  
  
  Android Project
&lt;/h3&gt;

&lt;p&gt;Now we know how the API Works we can then use them in our application as we would when consuming other API. I would briefly drop some hints below that can guide you.&lt;/p&gt;

&lt;h2&gt;
  
  
  Kotlin Model
&lt;/h2&gt;

&lt;p&gt;Looking at the JSON Response after playing around with it, you would see that it involves we having 4 data class in to represent our models. &lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0e472wynw4qarxlg4sob.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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0e472wynw4qarxlg4sob.PNG" alt="Model Image"&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;Comic.kt &lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fc8kx3escbjxafn0kb12s.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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fc8kx3escbjxafn0kb12s.PNG" alt="Comic Model"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;ComicResponse.kt &lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F02l3tawjcsbxf4905mj7.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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F02l3tawjcsbxf4905mj7.PNG" alt="ComicResponse Model"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Data.kt &lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fi6va3w3kppb69czinnwb.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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fi6va3w3kppb69czinnwb.PNG" alt="Data Model"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Thumbnail.kt&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fud5sn1qz9vwely4vrz9v.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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fud5sn1qz9vwely4vrz9v.PNG" alt="Thumbnail Model"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Assuming you decide using Retrofit, then you would need to create an interface and declare your method/function without any body. Remember that you are making a @GET request so it has to use the above mentioned query parameters using the @Query Annotations like this: &lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvtkoof31awjf7fubq1jj.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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvtkoof31awjf7fubq1jj.PNG" alt="Retrofit Interface"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So looking at my Constant.kt file&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F677vpnh1paeqc377cxzq.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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F677vpnh1paeqc377cxzq.PNG" alt="Constant"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Then you can go ahead and use whatever method that seems convenient for you to use in fetching the data to your activity. &lt;/p&gt;

&lt;p&gt;&lt;em&gt;Note&lt;/em&gt;&lt;br&gt;
While using Glide to load your images from the API please remember it requires the thumbnail path of type string and also the extension type appended to it. &lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhe0uwgj0gw7q37fqduox.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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhe0uwgj0gw7q37fqduox.PNG" alt="Adapter"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I hope this short article will help you use the Marvel API with ease because it offers some really cool responses that you can use in your Android Apps. Till next time bye :)&lt;/p&gt;

</description>
      <category>android</category>
      <category>kotlin</category>
      <category>mobile</category>
      <category>androiddevelopment</category>
    </item>
    <item>
      <title>How to Run Android Studio Emulator via CMD </title>
      <dc:creator>Kelvin Pere</dc:creator>
      <pubDate>Mon, 13 Jan 2020 14:58:03 +0000</pubDate>
      <link>https://dev.to/kelvn/how-to-run-android-studio-emulator-via-cmd-436e</link>
      <guid>https://dev.to/kelvn/how-to-run-android-studio-emulator-via-cmd-436e</guid>
      <description>&lt;p&gt;This as been a pain to me. I have been trying to open my Android Studio Emulator from the Command Prompt, but I have been getting funny error messages which I don't understand.&lt;/p&gt;

&lt;p&gt;I did whatever a typical developer will do, which is going to Google.com and searching =&amp;gt; "open android studio emulator from cmd". &lt;/p&gt;

&lt;p&gt;And I saw a link to a question answered on SO (Stackoverflow)&lt;a href="https://stackoverflow.com/questions/44521081/android-how-launch-emulator-from-command-line/44521194"&gt;https://stackoverflow.com/questions/44521081/android-how-launch-emulator-from-command-line/44521194&lt;/a&gt;. To make your life easy, you can follow the steps below in order to run Android Studio Emulator via CMD. &lt;/p&gt;

&lt;p&gt;Steps:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You have to first add this line 
|C:\Users&amp;lt;User&amp;gt;\AppData\Local\Android\Sdk\emulator| to your environmental variables.If you don't know how to or you haven't done it before. Just do a quick Google search on how to add a file path to environmental variables on Windows or Mac. &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;When you are done, then you can then move to the next step.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Open CMD and run it as an Administrator. I don't think its a requirement to do so. When you have done that, type this command on your CMD =&amp;gt; |emulator -list-avds| Emulator stands for the in-built Emulator you have already installed on Android Studio. list-avds Just list all the emulator you have. If its one, that the one that would be shown.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Now the last thing is to run the emulator with this command =&amp;gt; |emulator -avd Nexus_One_API_27| Nexus_One_API_27 is just the name of the emulator i have currently on the machine. &lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;After typing that command, just press ENTER and it should start running. &lt;/p&gt;

&lt;p&gt;And that's all!&lt;/p&gt;

&lt;p&gt;P.S * This article assumes you have already installed, downloaded and configured AVD (Android Virtual Device) and all you want to do is run it from the command line.&lt;/p&gt;

</description>
      <category>android</category>
    </item>
    <item>
      <title>#AskAndroid Series</title>
      <dc:creator>Kelvin Pere</dc:creator>
      <pubDate>Fri, 08 Nov 2019 20:40:30 +0000</pubDate>
      <link>https://dev.to/kelvn/askandroid-series-4hf3</link>
      <guid>https://dev.to/kelvn/askandroid-series-4hf3</guid>
      <description>&lt;p&gt;Android Dev Summit 2019 was definitely a nice conference that was full of many technical concepts. If you an Android Developer and you haven't watched them yet, please do. It mustn't be all just pick what interest you.&lt;/p&gt;

&lt;h3&gt;
  
  
  AskAndroid was a live Q&amp;amp;A session via twitter and Livestream on Youtube. I will be writing a blog series of videos that are available in the Videos.
&lt;/h3&gt;

&lt;p&gt;First up is #AskAndroid at Android Dev Summit 2019 - Kotlin &amp;amp; Coroutines on Android.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.youtube.com/watch?v=zbYYoL7vo9Y&amp;amp;t=190s"&gt;https://www.youtube.com/watch?v=zbYYoL7vo9Y&amp;amp;t=190s&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Blog coming next 🔜&lt;/p&gt;

</description>
      <category>android</category>
      <category>coroutines</category>
      <category>kotlin</category>
      <category>google</category>
    </item>
    <item>
      <title>Associate Android Certification (Android Core)</title>
      <dc:creator>Kelvin Pere</dc:creator>
      <pubDate>Mon, 04 Nov 2019 20:42:23 +0000</pubDate>
      <link>https://dev.to/kelvn/associate-android-certification-android-core-2ga7</link>
      <guid>https://dev.to/kelvn/associate-android-certification-android-core-2ga7</guid>
      <description>&lt;p&gt;This is the official link from Google Certificate for Android core &lt;a href="https://developers.google.com/certification/associate-android-developer/study-guide/android-core"&gt;https://developers.google.com/certification/associate-android-developer/study-guide/android-core&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;The very good thing about building apps for the Android Framework is that it runs on any Android Device. Yes, you heard me right. Just a little background about Android. It wasn't developed initially by Google, it was bought by them in the year 2005. Now Android runs on mobile devices, wears, TVs and also cars.&lt;/p&gt;

&lt;p&gt;So this section will focus on the following: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Overview of the 4 Android Architecture Components - Activities, Services, Broadcast Receivers and lastly Content Providers.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Learning the difference between Toast and Snackbars. Not just what, but why and how.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Understanding Notifications in Android.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Localizing your app and lastly,&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Schedule background task using JobScheduler.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Note: &lt;/p&gt;

&lt;p&gt;I am writing this article, to help me grasp the concepts of what am learning.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Preparing for Associate Android Developer Certification Exam</title>
      <dc:creator>Kelvin Pere</dc:creator>
      <pubDate>Mon, 04 Nov 2019 20:41:47 +0000</pubDate>
      <link>https://dev.to/kelvn/preparing-for-associate-android-developer-certification-exam-299k</link>
      <guid>https://dev.to/kelvn/preparing-for-associate-android-developer-certification-exam-299k</guid>
      <description>&lt;p&gt;We all want to be set-aside from the crowd. One way Android Devs can do that is by taking the Associate Android Developer Certification Examination. This would be in the form of a series.  &lt;/p&gt;

&lt;p&gt;Note: At this time, I haven't taken the exam, but would take it next month. &lt;/p&gt;

&lt;p&gt;According to the Study guide, the exam would be focused on Android core, User Interface, Data Management, Debugging and Testing. Those are the topics that I would be covering.  &lt;/p&gt;

&lt;p&gt;Stay in touch&lt;/p&gt;

</description>
      <category>kotlin</category>
      <category>java</category>
      <category>android</category>
    </item>
    <item>
      <title>Introduction of Myself Part 1</title>
      <dc:creator>Kelvin Pere</dc:creator>
      <pubDate>Mon, 14 Oct 2019 23:35:49 +0000</pubDate>
      <link>https://dev.to/kelvn/introduction-of-myself-part-1-4f7g</link>
      <guid>https://dev.to/kelvn/introduction-of-myself-part-1-4f7g</guid>
      <description>&lt;p&gt;My name is Kelvin Pere. And i live in Nigeria. I am currently an Android Developer who is interested in so many things. &lt;/p&gt;

&lt;p&gt;The Journey as not been easy and its still a long way to go. I started learning how to build mobile android apps with the help of Udacity. The platform as been great. During the first section of the course. I learnt what an IDE means and also how you build layouts to the screen. &lt;/p&gt;

&lt;p&gt;Then went further in learning Java Programming language, which is a strongly typed language. I wanted more challenge so i saw a post of an Android Developer Intern at a Startup close to where i live. I didn't know anything like i was a beginner but i still decided to apply. &lt;/p&gt;

&lt;p&gt;On getting there, i realized i was the only Android Developer there. So the CEO liked me and offered me the opportunity to be taught by a Senior Developer. And it was a game changer for me.....&lt;/p&gt;

</description>
      <category>android</category>
      <category>java</category>
    </item>
    <item>
      <title>Remember its just a Job</title>
      <dc:creator>Kelvin Pere</dc:creator>
      <pubDate>Mon, 14 Oct 2019 23:19:55 +0000</pubDate>
      <link>https://dev.to/kelvn/remember-its-just-a-job-1146</link>
      <guid>https://dev.to/kelvn/remember-its-just-a-job-1146</guid>
      <description>&lt;p&gt;I want to be a doctor, i want to be a lawyer and so on. That is what many of us said we wanted to be. And when eventually we get to that destination. Well? All we will say is, its just a job.&lt;/p&gt;

&lt;p&gt;We need to have the same mentality with regards to Software Development. Many persons work everyday,Sunday - Saturday on their job writing code and testing and doing other things. But if we view our job like the other regular work. We will have a balanced view of working.&lt;/p&gt;

&lt;p&gt;This also applies to learning how to code. You do not need to spend your whole day just watching a 8 Hours tutorial. Take a break, remember its just a job nothing much.&lt;/p&gt;

&lt;p&gt;While working as a Software Developer, remember its just a job. Nothing much.&lt;/p&gt;

</description>
      <category>productivity</category>
      <category>softwaredevelopment</category>
      <category>development</category>
    </item>
  </channel>
</rss>
