<?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: Alonso Ato Neyra</title>
    <description>The latest articles on DEV Community by Alonso Ato Neyra (@artesanoandroid).</description>
    <link>https://dev.to/artesanoandroid</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%2F15212%2F13d70592-7b08-48cc-b354-94719069112b.jpeg</url>
      <title>DEV Community: Alonso Ato Neyra</title>
      <link>https://dev.to/artesanoandroid</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/artesanoandroid"/>
    <language>en</language>
    <item>
      <title>Google Sign-in for android app with flavours</title>
      <dc:creator>Alonso Ato Neyra</dc:creator>
      <pubDate>Thu, 05 Mar 2020 14:42:17 +0000</pubDate>
      <link>https://dev.to/artesanoandroid/google-sig-in-for-android-app-with-flavours-4791</link>
      <guid>https://dev.to/artesanoandroid/google-sig-in-for-android-app-with-flavours-4791</guid>
      <description>&lt;p&gt;I work for a local bussiness in Peru. I'm developing a android app so my product owner tell me that the bussiness needed a new funcionality for the delivery app. He told that the app needed a Google sign-in The requerimient looked easy because I've already done that in another apps, so I think this is easy.&lt;/p&gt;

&lt;p&gt;So I followed the steps from this page:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://developers.google.com/identity/sign-in/android/start-integrating"&gt;Google Sign-in for Android: &lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I tought that it would take me at least at few hours but I couldnt. I did all the steps in the google's guide but ALWAYS throw me this message:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;com.google.android.gms.common.api.ApiException: 10:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;I was strugglin about two days, reading a lot of post of SO, fixing my code, trying new ways to achive the google sign in but nothig worked. Actually, I created a simple demo app just to try the google sign-in and this demo worked fine! I was really frustated.&lt;/p&gt;

&lt;p&gt;At the second day, in the afternoon, around the 14:00 hours, FINALLY I found the solution and I hope this can help you my dear android developer.&lt;/p&gt;

&lt;p&gt;The delivery app works with flavours. This may sound normal, but when you configure your app to use Google sign-in, the ask you for the package that you're using in your app. And HERE IS THE KEY:&lt;/p&gt;

&lt;p&gt;When you use flavours, you create package for each one. I was working in a dev flavour so my package was&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;dev.mydeliveryapp.peru&lt;/strong&gt; &lt;/p&gt;

&lt;p&gt;But in the console I register the production flavour:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;mydeliveryapp.peru&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;When I changed that, and tried again, the google sign-in works fine.&lt;/p&gt;

&lt;p&gt;Also, just in case you didn't know, you shoul register your SHA1.&lt;br&gt;
In the android studio, to the right there is an gradle option option as you can see in the image. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--SctjERbs--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://i.ibb.co/gTtwc2B/gradle.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--SctjERbs--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://i.ibb.co/gTtwc2B/gradle.png" alt="views-sktech" width="640" height="492"&gt;&lt;/a&gt;&lt;br&gt;Fig. 1
  &lt;/p&gt;

&lt;p&gt;Then, click in sigin report and the console will shoy you your SHA1:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--bUNz3S-l--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://i.ibb.co/GkB2T5x/sigin.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--bUNz3S-l--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://i.ibb.co/GkB2T5x/sigin.png" alt="views-sktech" width="639" height="152"&gt;&lt;/a&gt;&lt;br&gt;Fig. 1
  &lt;/p&gt;

&lt;p&gt;So that's all. I hope this help someone out there strugglin with this.&lt;/p&gt;

&lt;p&gt;Happy code!&lt;/p&gt;

</description>
      <category>android</category>
      <category>signin</category>
      <category>flavours</category>
    </item>
    <item>
      <title>Android's Fundamental Components</title>
      <dc:creator>Alonso Ato Neyra</dc:creator>
      <pubDate>Fri, 07 Feb 2020 03:25:31 +0000</pubDate>
      <link>https://dev.to/artesanoandroid/android-s-fundamental-components-29pk</link>
      <guid>https://dev.to/artesanoandroid/android-s-fundamental-components-29pk</guid>
      <description>&lt;p&gt;I've been through some job interviews and one of my common mistakes was not to study important concepts before it. My mind works more in a practical way than in an abstract way so I avoided, unconsciously,  this concepts. &lt;/p&gt;

&lt;p&gt;So, this article, is about important concepts that you have to know as android developer or that you have to learn if your are starting a career as android developer.&lt;/p&gt;

&lt;p&gt;I'll try something new to explain those concepts.&lt;/p&gt;

&lt;p&gt;Let's start:&lt;/p&gt;

&lt;p&gt;View&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--0Ug5_s6k--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://i.ibb.co/jLSYrbn/views.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--0Ug5_s6k--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://i.ibb.co/jLSYrbn/views.jpg" alt="views-sktech" width="640" height="431"&gt;&lt;/a&gt;&lt;br&gt;Fig. 1
  &lt;/p&gt;

&lt;p&gt;Activity&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--CUn28hMo--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://i.ibb.co/BzHVmLP/activity.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--CUn28hMo--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://i.ibb.co/BzHVmLP/activity.jpg" alt="views-sktech" width="640" height="431"&gt;&lt;/a&gt;&lt;br&gt;Fig. 2
  &lt;/p&gt;

&lt;p&gt;Fragment &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--o0wWmGTN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://i.ibb.co/yQc96pL/fragment.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--o0wWmGTN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://i.ibb.co/yQc96pL/fragment.jpg" alt="views-sktech" width="640" height="411"&gt;&lt;/a&gt;&lt;br&gt;Fig. 3
  &lt;/p&gt;

&lt;p&gt;Intent&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--92v4DWkk--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://i.ibb.co/K9ygB3L/intent.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--92v4DWkk--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://i.ibb.co/K9ygB3L/intent.jpg" alt="views-sktech" width="640" height="418"&gt;&lt;/a&gt;&lt;br&gt;Fig. 4
  &lt;/p&gt;

&lt;p&gt;Content Provider&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--7EW9fCcY--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://i.ibb.co/XpXT1YD/content.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--7EW9fCcY--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://i.ibb.co/XpXT1YD/content.jpg" alt="views-sktech" width="639" height="401"&gt;&lt;/a&gt;&lt;br&gt;Fig. 5
  &lt;/p&gt;

&lt;p&gt;Service&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--CDySHZKw--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://i.ibb.co/F0qtXTs/service.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--CDySHZKw--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://i.ibb.co/F0qtXTs/service.jpg" alt="views-sktech" width="640" height="421"&gt;&lt;/a&gt;&lt;br&gt;Fig. 6
  &lt;/p&gt;

&lt;p&gt;AndroidManifest.xml&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--x_z7DH1O--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://i.ibb.co/gVFDfj7/manifest.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--x_z7DH1O--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://i.ibb.co/gVFDfj7/manifest.jpg" alt="views-sktech" width="640" height="420"&gt;&lt;/a&gt;&lt;br&gt;Fig. 7
  &lt;/p&gt;

</description>
      <category>android</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Android: Simple way to implement a SplashScreen in your app</title>
      <dc:creator>Alonso Ato Neyra</dc:creator>
      <pubDate>Thu, 02 May 2019 16:03:27 +0000</pubDate>
      <link>https://dev.to/artesanoandroid/android-simple-way-to-implement-a-splashscreen-in-your-app-3k0f</link>
      <guid>https://dev.to/artesanoandroid/android-simple-way-to-implement-a-splashscreen-in-your-app-3k0f</guid>
      <description>&lt;h1&gt;
  
  
  First of all, what is a SplashScreen?
&lt;/h1&gt;

&lt;p&gt;A splash screen is a screen which appears when you open an app on your mobile device. So, we can say it's the first impression for the user. It's usually used to show the logo of the app or an image related with the app.&lt;/p&gt;

&lt;p&gt;In my personal opinion, this is the most simple way to implement a static splash screen.&lt;/p&gt;

&lt;p&gt;So, let's code it. &lt;/p&gt;

&lt;p&gt;First of all, create a new android project with a empty activity called SplashActivity. &lt;/p&gt;

&lt;p&gt;Once that it's done we are ready to implement our SplashScreen:&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Create a custom style in styles.xml under the res/values folder.
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--C_m8W8K5--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://i.ibb.co/HHWSVC9/Screen-Shot-2019-05-02-at-10-18-55.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--C_m8W8K5--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://i.ibb.co/HHWSVC9/Screen-Shot-2019-05-02-at-10-18-55.png" width="491" height="76"&gt;&lt;/a&gt;&lt;br&gt;Fig.1 - Theme for SplashScreen.
  &lt;/p&gt;

&lt;h2&gt;
  
  
  2. On the AndroidManifest.xml, add the theme we created before to the SplashActivity.
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--gL0xzK20--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://i.ibb.co/SsJbNdh/Screen-Shot-2019-05-02-at-10-29-48.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--gL0xzK20--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://i.ibb.co/SsJbNdh/Screen-Shot-2019-05-02-at-10-29-48.png" width="491" height="111"&gt;&lt;/a&gt;&lt;br&gt;Fig.2 - Add the theme to SplashActivity.
  &lt;/p&gt;

&lt;h2&gt;
  
  
  3. Add to the drawable folder any image you want, we gonna use it in the SplashScreen.
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--2P_SJhbw--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://i.ibb.co/mDLsT8H/Screen-Shot-2019-05-02-at-10-34-20.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--2P_SJhbw--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://i.ibb.co/mDLsT8H/Screen-Shot-2019-05-02-at-10-34-20.png" width="404" height="81"&gt;&lt;/a&gt;&lt;br&gt;Fig.3 - Drawable folder.
  &lt;/p&gt;

&lt;h2&gt;
  
  
  4. Modify the activity_splash.xml.
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--s6FqnHcW--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://i.ibb.co/XWXnvMc/Screen-Shot-2019-05-02-at-10-38-08.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--s6FqnHcW--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://i.ibb.co/XWXnvMc/Screen-Shot-2019-05-02-at-10-38-08.png" width="430" height="286"&gt;&lt;/a&gt;&lt;br&gt;Fig.4 - activity_splash.xml.
  &lt;/p&gt;

&lt;h2&gt;
  
  
  5. Add a new activity. I will called it MainActivity.
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--pEFQ1Auh--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://i.ibb.co/VWcbtj4/Screen-Shot-2019-05-02-at-10-42-09.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--pEFQ1Auh--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://i.ibb.co/VWcbtj4/Screen-Shot-2019-05-02-at-10-42-09.png" width="359" height="118"&gt;&lt;/a&gt;&lt;br&gt;Fig.4 - activity_splash.xml.
  &lt;/p&gt;

&lt;h2&gt;
  
  
  6. Now, implement this code in the SplashActivity. I'll use a Handler to create a small delay and then go to the MainActivity.
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--oyq61kD8--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://i.ibb.co/KqKhxmc/Screen-Shot-2019-05-02-at-10-53-46.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--oyq61kD8--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://i.ibb.co/KqKhxmc/Screen-Shot-2019-05-02-at-10-53-46.png" width="541" height="308"&gt;&lt;/a&gt;&lt;br&gt;Fig.5 - SplashActivity.kt.
  &lt;/p&gt;

&lt;p&gt;And that's all! You have a SplashScreen in your app. Of course, you can use an animation and make it really awesome but I'll show it in another post.&lt;/p&gt;

&lt;p&gt;Thanks for reading!&lt;/p&gt;

&lt;p&gt;Here is the repo just in case:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/AlonsoAndroidDev/SplashActivitySample.git"&gt;Repo&lt;/a&gt;&lt;/p&gt;

</description>
      <category>android</category>
      <category>kotlin</category>
      <category>firstpost</category>
    </item>
  </channel>
</rss>
