<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Baris Karapinar on Medium]]></title>
        <description><![CDATA[Stories by Baris Karapinar on Medium]]></description>
        <link>https://medium.com/@bariskarapinar?source=rss-9e58e125fd7e------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*Ysm-95Pj03qjPdG3.</url>
            <title>Stories by Baris Karapinar on Medium</title>
            <link>https://medium.com/@bariskarapinar?source=rss-9e58e125fd7e------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 01 Dec 2026 01:11:01 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@bariskarapinar/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Firebase Authentication Web App — JavaScript]]></title>
            <link>https://medium.com/@bariskarapinar/firebase-authentication-web-app-javascript-3165ebc92b68?source=rss-9e58e125fd7e------2</link>
            <guid isPermaLink="false">https://medium.com/p/3165ebc92b68</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[html]]></category>
            <category><![CDATA[google]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[firebase]]></category>
            <dc:creator><![CDATA[Baris Karapinar]]></dc:creator>
            <pubDate>Thu, 14 Nov 2019 12:42:55 GMT</pubDate>
            <atom:updated>2019-11-14T12:42:55.396Z</atom:updated>
            <content:encoded><![CDATA[<h3>Firebase Authentication Web App — JavaScript</h3><p>Hello everyone, in this tutorial we are going to make a Web application using Firebase Authentication and Database features (Fetched User ID with Database) . We are going to use JavaScript and HTML and also some CSS.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-_711sJW_AnbsaKeUjbkEw.png" /></figure><p>Firebase;</p><ul><li>Sign up</li><li>Sign in</li><li>Create user profile — Firebase Database</li><li>Edit profile</li><li>Log out</li></ul><p><strong>How to add Firebase to your project;</strong></p><p><a href="https://firebase.google.com/">Firebase | Google&#39;s Mobile and Web App Development Platform</a></p><p><em>Go to the console;</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/332/1*KErr0mW33gpNAOJvnJhAyQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/670/1*pg7c0VMjYT6LfdCmyJ_yTQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/780/1*k8Ho3VVS_CuGanX7Ykm1Ig.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/771/1*96PrV7k0ul2w7z8--6FR9w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/359/1*Zi32qUq_QV3n8M2pSU-nJQ.png" /><figcaption>Select <strong>&lt;/&gt;</strong></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/560/1*hO7zLG6y_Y7OSIRdenI7XQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/788/1*QO-euMHMFc_HY199_RMPZA.png" /><figcaption>Copy and paste the code at the end of the HTML pages</figcaption></figure><p>First of all, we start with creating our Folders and Files. <em>index.html</em> is our homepage. Folder hierarchy;</p><ul><li><em>css — style.css</em></li><li><em>images </em>— avatar.png &amp; firebase_logo.png</li><li><em>js </em>— app.js &amp; sweetalert2.js</li><li><em>pages </em>— profile.html &amp; sign-up.html</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/249/1*mZiV0nIbqB3SsEpBYlp84Q.png" /></figure><p>Let’s start with the <em>index </em>a.k.a the home page. For a better interface I used Bootstrap, Sweet Alert and also a custom CSS. So we have to implement these libraries under the <em>&lt;head&gt;</em> tag. At the end of the file I added the Firebase configuration.</p><p>What is Sweet Alert;</p><p><a href="https://sweetalert2.github.io/">SweetAlert2</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/927/1*-RYj9R9ltyewj2pJPnh4ow.png" /><figcaption>index.html (Sign In page)</figcaption></figure><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/1e8911001d3dc94b392b57d0fd2497fc/href">https://medium.com/media/1e8911001d3dc94b392b57d0fd2497fc/href</a></iframe><p>In the Sign Up page; We have Name, Surname, E-mail address and password. We are going to add some methods to check user inputs as E-mail and valid E-mail address.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/923/1*K5wBJK2YBZkHzbUKWvq1VA.png" /><figcaption>Sign Up page</figcaption></figure><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c319455babcb8429692e09ccdf11977e/href">https://medium.com/media/c319455babcb8429692e09ccdf11977e/href</a></iframe><p>Profile Page;</p><p>We are going to make a profile page with HTML. We are going to add Name, Surname, bio, and social media attributes. User can create his own profile and also he can edit the attributes. Just for now, attributes appear without information from database .</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/922/1*8v-a9FJp9dust5k7FEgSdw.png" /><figcaption>Without DB</figcaption></figure><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/031013bc76cb200e09496950da704cbb/href">https://medium.com/media/031013bc76cb200e09496950da704cbb/href</a></iframe><p>We finished the HTML pages. Now it is time to work with the <em>app.js</em>. In the app file we can check the validations of the attributes.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/7bb4129896f030eb0fd95b0124257ee0/href">https://medium.com/media/7bb4129896f030eb0fd95b0124257ee0/href</a></iframe><p>The app is ready to go. Let’s do some tests.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/823/1*RHplOsCRVhveuUxuBEZ8bw.png" /><figcaption>Validation errors</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/857/1*zaNOwlD2npc0RW7nyAQYCQ.png" /><figcaption>Signed Up</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/959/1*o4n7xcp3GfERNS-1sfUcwg.png" /><figcaption>Firebase Console</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/969/1*_421VswJfeP2KAKDQyrK3A.png" /><figcaption>Firebase Database — Current DB</figcaption></figure><p>User ID is fetched with Authentication and Real-time Database</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/831/1*IO1msjISazxLjPffsBT-0g.png" /><figcaption>User current profile</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/829/1*i9o59aIt5lzbHnKKxE5drA.png" /><figcaption>Edit Profile</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/829/1*XFJD04wMC5uiN27wj4bWaA.png" /><figcaption>Changed the profile</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/971/1*h5a_3suPTdS7_KFx4ocdnA.png" /><figcaption>Changed Database</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/803/1*pj837Mvi1e8rUG1hYUmvTg.png" /><figcaption>Current Profile</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/877/1*Aqc5Om3CRY5FyOVnLKQbVw.png" /><figcaption>Wrong password error</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/849/1*cEYmX8LHHHzP64J_6AisQA.png" /><figcaption>Success Sweat Alert</figcaption></figure><p>Thank you for reading…</p><ul><li><a href="https://github.com/gamebit34/FirebaseAuthWebAPP">gamebit34/FirebaseAuthWebAPP</a></li><li><a href="https://www.linkedin.com/in/baris-karapinar/">Baris Karapinar - Android Developer - Freelance | LinkedIn</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3165ebc92b68" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Location Updates & Implementing Google Maps Fragment — Android App]]></title>
            <link>https://medium.com/@bariskarapinar/location-updates-implementing-google-maps-fragment-android-app-d83a0b2d9914?source=rss-9e58e125fd7e------2</link>
            <guid isPermaLink="false">https://medium.com/p/d83a0b2d9914</guid>
            <category><![CDATA[google-map-api]]></category>
            <category><![CDATA[location]]></category>
            <category><![CDATA[android-app-development]]></category>
            <category><![CDATA[java]]></category>
            <category><![CDATA[android]]></category>
            <dc:creator><![CDATA[Baris Karapinar]]></dc:creator>
            <pubDate>Tue, 15 Oct 2019 15:15:41 GMT</pubDate>
            <atom:updated>2019-10-15T15:15:41.144Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>Location Updates &amp; Google Maps Fragment — Android App</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oqXEBUFg-iWslqM4Wk0ZQg.jpeg" /></figure><p>This tutorial contains two separate implementations for Android devices.</p><ol><li>Using location permissions, Location Updates; Latitude &amp; Longitude.</li><li>Google Maps Fragment; Show your location on the google maps with a pinpoint, explore the surroundings on the map and center your location on the map.</li></ol><p>You don’t have to implement two of them. I just want to combine the similar topics under one article.</p><p>First of all we always start with creating a new project named “LocationMaps”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*YDz3CIJQbX_m-H5w9YYH8A.png" /></figure><p>I added a “menu” item for navigating between Location updates activity and Map fragment. As always, I use a custom button for the project. I added an XML file named “custom_button.xml” under the res &gt; drawable folder.</p><p>Create a new folder named “menu” under “res” file.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/06de81dc7b7a3dc6ae318cc4c7edfa30/href">https://medium.com/media/06de81dc7b7a3dc6ae318cc4c7edfa30/href</a></iframe><p>I added Map and Help selections. Help is just for filling the menu item.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/67f490aa14f356dc7f1fb6e30f7b2f50/href">https://medium.com/media/67f490aa14f356dc7f1fb6e30f7b2f50/href</a></iframe><p>For the Location updates buttons I used some icons from material.io.</p><p><a href="https://material.io/resources/icons/?style=baseline">Material Icons</a></p><pre><strong>baseline_location_on_white_24dp<br>baseline_location_off_white_24dp<br>baseline_history_white_24dp</strong></pre><p>For location updates section we have 3 buttons.</p><ul><li>Start Location Updates</li><li>Stop Location Updates</li><li>Last Location.</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/e87ef845898007a1802ec8cc063a928a/href">https://medium.com/media/e87ef845898007a1802ec8cc063a928a/href</a></iframe><p>We have to turn on the location permissions under manifest file.</p><pre>Manifest;</pre><pre>&lt;<strong>uses-permission android:name=&quot;android.permission.ACCESS_FINE_LOCATION&quot;</strong>/&gt;</pre><p>Implement the services and ButterKnife Library. Dexter is used for the location permissions to check if there is another app is using location updates at the same time.</p><pre>Gradle (Module:App)</pre><pre>implementation <strong>&#39;com.android.support:design:27.1.0&#39;</strong></pre><pre><em>// location play services<br></em>implementation <strong>&#39;com.google.android.gms:play-services-location:15.0.1&#39;<br></strong><em>// dexter runtime permissions<br></em>implementation <strong>&#39;com.karumi:dexter:4.2.0&#39;<br></strong><em>// ButterKnife view binding<br></em>implementation <strong>&#39;com.jakewharton:butterknife:8.8.1&#39;<br></strong>annotationProcessor <strong>&#39;com.jakewharton:butterknife-compiler:8.8.1&#39;</strong></pre><p>In the MainActivity.java file I implemented the start and stop location updates.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/28b00ba8b8ef95b7f82e1f833541248b/href">https://medium.com/media/28b00ba8b8ef95b7f82e1f833541248b/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/199/1*QIEr1cGBsH0d8sXl7SFYbA.png" /><figcaption>App started.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/213/1*waEN2bCQLOjrIZOzRvJVXA.png" /><figcaption>Tapped the start location updates.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/294/1*l1fuT1QWLJkOS17JuyXRjw.png" /><figcaption>Location updates started.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/294/1*ytPtgYMCYhVuqK8IAznqPQ.png" /><figcaption>Stopped; you can still see the coordinates.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/293/1*ZQH-yabERZS1QwvWNNFiow.png" /><figcaption>Toast message for last coordinates.</figcaption></figure><p>First section of the project is done. Now we can start making the Google Maps implementation.</p><p><strong>Google Maps Fragment</strong></p><p>In our first step of the project we coded did some coding for the location permissions. I am writing them again just in case.</p><pre>Gradle (Module:App)</pre><pre>implementation &#39;com.google.android.gms:play-services-location:15.0.1&#39;<br>implementation &#39;com.google.android.gms:play-services-maps:15.0.1&#39;</pre><pre>Manifest;</pre><pre>&lt;<strong>uses-permission android:name=&quot;android.permission.ACCESS_FINE_LOCATION&quot;</strong>/&gt;<br>&lt;<strong>uses-permission android:name=&quot;android.permission.ACCESS_COARSE_LOCATION&quot; </strong>/&gt;<br> &lt;<strong>uses-permission android:name=&quot;android.permission.INTERNET&quot; </strong>/&gt;</pre><p>At the next step you are going to have a API.KEY from Google. Change your key with the example key.</p><pre>Manifest;<br>//Under &lt;<strong>application</strong></pre><pre>&lt;<strong>meta-data<br>    android:name=&quot;com.google.android.geo.API_KEY&quot;<br>    android:value=&quot;AIzaxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx&quot; </strong>/&gt;<br>&lt;<strong>meta-data<br>    android:name=&quot;com.google.android.gms.version&quot;<br>    android:value=&quot;@integer/google_play_services_version&quot; </strong>/&gt;</pre><p>Go to Google Cloud Platform. Set your project as I did.</p><p><a href="https://console.cloud.google.com/">https://console.cloud.google.com</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*WxHCYptrN_gSvdRQjiQ8ZQ.png" /><figcaption>1</figcaption></figure><p>Select project &gt; new project</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*h276QnjhtO7bz8v-pNsSnA.png" /><figcaption>2</figcaption></figure><p>Enable APIs and services.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*TRRFBRIakc1HRKblfZ8fgg.png" /><figcaption>3</figcaption></figure><p>Select Maps SDK for Android.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*2BilBkKTNNs-lRQtPt4m1g.png" /><figcaption>4</figcaption></figure><p>Select Maps SDK for Android Link.</p><p>Credentials &gt; Credentials in APIs &amp; Services</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*vGzbJucCaiOFvyUcSUv7qQ.png" /><figcaption>5</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*LzMR8z9yuYnOTnH5anvmeQ.png" /><figcaption>6</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*ACOPmR1aGmcWpz8xkG-cPw.png" /><figcaption>7</figcaption></figure><p>Copy and change the API key with the example one that I gave before.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*tQYTzMhtqGluhWgfQlYgdw.png" /><figcaption>8</figcaption></figure><p>I created a new java file named MapActivity.java.</p><p>We are going to implement the map fragment.</p><p><a href="https://developers.google.com/android/reference/com/google/android/gms/maps/SupportMapFragment">SupportMapFragment | Google APIs for Android | Google Developers</a></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/5e5a70de7b94b278efd82eda498747b9/href">https://medium.com/media/5e5a70de7b94b278efd82eda498747b9/href</a></iframe><p>For center the location after travel on the map; I created an XML file named current_location_vector_icon.xml.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/89d1f6f924bf7bacb8110719084a6db1/href">https://medium.com/media/89d1f6f924bf7bacb8110719084a6db1/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/190/1*13m3FTBBxBvyHRvV7Yippg.png" /></figure><p>We are going to indicate the location of the device and pinpoint the location with an marker animation as Google Maps use. Created a java file named MarkerAnimation.java.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/e37787473afebcdd20e5e0c2dad56eb7/href">https://medium.com/media/e37787473afebcdd20e5e0c2dad56eb7/href</a></iframe><p>Last step for the project is the Interpolator interface.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/5988a1bb4583238457b5338fb60107ca/href">https://medium.com/media/5988a1bb4583238457b5338fb60107ca/href</a></iframe><p>MapActivity.java;</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/847c90334b6ca03b02c1b39d8e71781c/href">https://medium.com/media/847c90334b6ca03b02c1b39d8e71781c/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/293/1*4BFMOJCZnHYuj-7cUiyWjQ.png" /><figcaption>Selecting the “Maps” from menu.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/295/1*9gmmutRd7RcVkviG5OvcVg.png" /><figcaption>Current location is centered.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/295/1*ZsJxey6x8gKN8Yb1LvZxmA.png" /><figcaption>Explore the map</figcaption></figure><p>You can explore everywhere from the map. Don’t worry Android emulator shows the location on the Googleplex, if you use your mobile device it is going to show your exact location.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4_7RAD5WWzDLRLd5q8ENzA.jpeg" /></figure><ul><li><a href="https://github.com/gamebit34/LocationMaps">gamebit34/LocationMaps</a></li><li><a href="https://www.linkedin.com/in/baris-karapinar-8597a4140/">Baris Karapinar - Android Developer - Freelance | LinkedIn</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d83a0b2d9914" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Firebase Authentication Android App Sign in, Sign up, Create profile]]></title>
            <link>https://medium.com/@bariskarapinar/firebase-authentication-android-app-sign-in-sign-up-create-profile-c20d185bbbaf?source=rss-9e58e125fd7e------2</link>
            <guid isPermaLink="false">https://medium.com/p/c20d185bbbaf</guid>
            <category><![CDATA[androiddev]]></category>
            <category><![CDATA[java]]></category>
            <category><![CDATA[firebase]]></category>
            <category><![CDATA[android-app-development]]></category>
            <category><![CDATA[android]]></category>
            <dc:creator><![CDATA[Baris Karapinar]]></dc:creator>
            <pubDate>Mon, 07 Oct 2019 19:37:43 GMT</pubDate>
            <atom:updated>2019-10-07T19:37:43.727Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*t3RkWkccfvg6wFL3joiNOQ.png" /></figure><p>In this tutorial we are going to make an Android application uses Firebase Authentication features. In this tutorial unlike other projects we will create the Authentication app as a package. It can be used as the basis for any authentication-required apps that you will work on in the future.</p><p>This project contains;</p><ul><li>User ID fetch</li><li>Sign in</li><li>Sign up</li><li>Create user profile</li><li>Add profile picture to Firebase storage</li><li>Show profile</li><li>Edit profile attributes; Name, Surname and Phone Number</li><li>Auto Log in with User ID</li><li>Reset Password</li><li>Log out</li><li>Sign in</li></ul><p>First, we start with creating a new project on android studio.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/430/1*wOYYx6BZRARE_0RvuzDt6g.png" /><figcaption><em>Empty project named FirebaseAuthProject</em></figcaption></figure><p>Temporarily we don’t touch the MainActivity and create the SignUpActivity, SignInActivity, ResetPasswordActivity, HomeActivity and the xml files for sign up screen. Added a custom button xml file to drawable folder. Now we have 4 basic activities.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/215/1*La6wAxq4apAlOWL1_m6SkA.png" /><figcaption><em>Project appearance</em></figcaption></figure><p>In the Build Gradle (Module: app) file we must add our import files under the dependencies to use the Firebase Authentication features.</p><pre>dependencies {</pre><pre>implementation <strong>&#39;com.google.firebase:firebase-core:16.0.3&#39;</strong><em><br></em>implementation <strong>&#39;com.google.firebase:firebase-auth:16.0.1&#39;</strong></pre><p>We will use Firebase storage for saving the profile picture:</p><pre>implementation <strong>&#39;com.google.firebase:firebase-storage:16.0.1&#39;</strong></pre><p>Firebase Database for user information and picasso for profile image:</p><pre>implementation <strong>&#39;com.google.firebase:firebase-database:16.0.1&#39;<br></strong>implementation <strong>&#39;com.squareup.picasso:picasso:2.71828&#39;</strong></pre><pre><strong>}</strong></pre><p>Under the Build Gradle (Project: FirebaseAuthProject)</p><pre>dependencies {<br>    classpath <strong>&#39;com.android.tools.build:gradle:3.3.2&#39;<br>    </strong>classpath <strong>&#39;com.google.gms:google-services:4.3.2&#39;</strong><em><br></em>}</pre><p>At the <a href="https://firebase.google.com/">https://firebase.google.com/</a> link click to the “Go to console” button.</p><p>For adding a new project to Firebase follow the instructions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/252/1*lXZPEMgICrOBvAq6cYRR5Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/307/1*zHnkcOBpam8HwFVXh8nBYg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/330/1*HgdEn-EVu-WkhIEqga9huA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/267/1*gf2bR0q8QCm-D606MXCFYQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/403/1*gZ4Iofkgxar0Ff75YrknIQ.png" /></figure><p>Select the Android icon to add your Android app.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/359/1*oBhnNmSkHtSeMxogOQMuFg.png" /></figure><p>Download the json file as in the instructions and copy it to the specified folder.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/335/1*5ZXRCCTS37xbvsK6v9A7Ew.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/468/1*qNIkTLSOAkjgYWyHWY_3Vg.png" /></figure><p>Run the app and check there is no connection error between app and Firebase.</p><p><strong>Lets start to build the App!</strong></p><p>Our Main Activity will be a welcome activity, under the java file of this activity we will check the authentication status. If user has an account on this device MainActivity automatically log in and send the user to the Home Page of the application. I just added a “Hello” PNG image file to the main activity. If there is a slow internet connectin or an old device this “Hello” image will appear about 1 or 2 seconds. If there is no speed problem with the device User will automatically send to the Sign Up or Home Page.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/485/1*pYUUbfDrPo-QxxvAbLh3JQ.png" /><figcaption><em>Added an “Hello” image to the activity_mail.xml</em></figcaption></figure><p>We must add Firebase auth import files to all the Activity java files.</p><pre><strong>import </strong>com.google.firebase.auth.FirebaseAuth;<br><br><strong>import </strong>com.google.firebase.auth.FirebaseUser;</pre><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b9347cd9ea7c38d4c5c2939cbb36eff4/href">https://medium.com/media/b9347cd9ea7c38d4c5c2939cbb36eff4/href</a></iframe><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/e6296b0a7ebccc4d40350064a3603301/href">https://medium.com/media/e6296b0a7ebccc4d40350064a3603301/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/178/1*bEB6MO26wIgHOOXtN0OUUw.png" /><figcaption>activity_main.xml</figcaption></figure><p>If there is not an logged user MainActivity will send user to the Sign Up activity. On the Sign-Up screen I added two Edit Text’s and a button. For this button I created an XML file under the drawable folder. Under the SignUpActivity.java file user can sign as a new user to the Firebase system. Also, we can make sure user entered a valid format to sign up and send toast notifications to the user.</p><p>I created a custom button for this app and set new colors.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/eeb598a66a5131795227c2b74dd03db9/href">https://medium.com/media/eeb598a66a5131795227c2b74dd03db9/href</a></iframe><p>Values&gt;colors.xml</p><pre><em>&lt;?</em><strong>xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;</strong><em>?&gt;<br></em>&lt;<strong>resources</strong>&gt;<br>    &lt;<strong>color name=&quot;colorPrimary&quot;</strong>&gt;#88D9F3&lt;/<strong>color</strong>&gt;<br>    &lt;<strong>color name=&quot;colorPrimaryDark&quot;</strong>&gt;#323846&lt;/<strong>color</strong>&gt;<br>    &lt;<strong>color name=&quot;colorAccent&quot;</strong>&gt;#C3F7EB&lt;/<strong>color</strong>&gt;<br>&lt;/<strong>resources</strong>&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/199/1*GEaOXBdzTRDn9Ro2yA5zGw.png" /><figcaption>activity_signup.xml</figcaption></figure><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/e63216c8008d6c480dcd1ceb4b54d83b/href">https://medium.com/media/e63216c8008d6c480dcd1ceb4b54d83b/href</a></iframe><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a48aea7e88091459c44b04d1ddb5dc97/href">https://medium.com/media/a48aea7e88091459c44b04d1ddb5dc97/href</a></iframe><p>On the Sıgn In page; There is 2 buttons for “Sign Up” and “Forgot your password?” navigations.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/173/1*BbeOK3scngOUQdVZDemuJQ.png" /><figcaption>activity_signin.xml</figcaption></figure><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/3cabfc3f9cb2ff2ff585ef52e5d51277/href">https://medium.com/media/3cabfc3f9cb2ff2ff585ef52e5d51277/href</a></iframe><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/bc042a09dd0820f6e603a1124c3f328b/href">https://medium.com/media/bc042a09dd0820f6e603a1124c3f328b/href</a></iframe><p>If user forgot his password, he can easily reset the password.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/196/1*TfhWkoSljU8C5w4CoX3fEw.png" /><figcaption>activity_reset_password.xml</figcaption></figure><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/137b27ba465aacf395e49843f04edd14/href">https://medium.com/media/137b27ba465aacf395e49843f04edd14/href</a></iframe><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/05359417eea8ee74235eabf4368648ca/href">https://medium.com/media/05359417eea8ee74235eabf4368648ca/href</a></iframe><p>We created the base parts of the project. Now it is time to create the activity we will use for creating the new user profile. User profile information is going to be saved under the Firebase Realtime Database. With help of the UserID of the authenticated user datas will be fetched by the ID. We implemented the database, storage and the picasso files at the beginning of the article so we just need to code. We are going to use a default avatar set by an Imageview. I want to make a circular appearence so I created a rounded_fg.xml under the drawable folder to add on the image. With help of this rounded_fg.xml file backround and circle will be matched.</p><p>Created the Firebase Database for user profile information.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/466/1*0Z8ZXb9DPUkHSgmyKp92Tg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/240/1*E7tJ5Mz2vBEvGoY8m3N2vA.png" /><figcaption>defavatar.png</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/184/1*FrMFUfJ6XJWjZEODlgF79A.png" /><figcaption>rounded_fg.xml</figcaption></figure><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/e24804a80f01fef12be20f1d21c45563/href">https://medium.com/media/e24804a80f01fef12be20f1d21c45563/href</a></iframe><p>We are going to use three attributes; Name, Surname and Phone Number</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/200/1*9wetRro9GkDUMiURuYsqXQ.png" /><figcaption>activity_edit_profile.xml</figcaption></figure><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/6d988ab22027731fa0b2c98b40f93f0e/href">https://medium.com/media/6d988ab22027731fa0b2c98b40f93f0e/href</a></iframe><p>We have to use a helper class to save the Name, Surname and Phone Number attributes. I created a new class named Userinformation.java.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/fee3ac55dd0e75cb9c5a82db38766cf8/href">https://medium.com/media/fee3ac55dd0e75cb9c5a82db38766cf8/href</a></iframe><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/21e1518887b4e46069ec14f5d8ec452c/href">https://medium.com/media/21e1518887b4e46069ec14f5d8ec452c/href</a></iframe><p>Under the Develop menu on the Firebase console there is Database section. At the Database section I created a new Realtime Database.</p><pre>Realtime database:<br></pre><pre>{</pre><pre>&quot;rules&quot;: {</pre><pre>&quot;.read&quot;: true,</pre><pre>&quot;.write&quot;: true</pre><pre>    }</pre><pre>}</pre><pre>Storage Rules:</pre><pre>rules_version = &#39;2&#39;;<br>service firebase.storage {<br>  match /b/{bucket}/o {<br>    match /{allPaths=**} {<br>      allow read, write: if request.auth != null;<br>    }<br>  }<br>}</pre><p>We have all the activities that we need. Now time for creating the Home activity. After the sign in option, application navigates to this activity. Home activity will be the main part of the project. For the design of this project we are going to use just a bottom navigation. Right side of the bottom navigation there will be a profile navigation button. I created a menu folder under the “res” folder and created a new xml file named; bottom_navigation.xml and added home, person and favorite logos under the “drawable” folder.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/577e50ddeee1fbe93392c380db02c829/href">https://medium.com/media/577e50ddeee1fbe93392c380db02c829/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/198/1*votg1KffXCzVRLbwHi7VmQ.png" /><figcaption>activity_home.xml</figcaption></figure><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/23feb6fc4f9b3d12c1b6ff61e4544fe9/href">https://medium.com/media/23feb6fc4f9b3d12c1b6ff61e4544fe9/href</a></iframe><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/891abd0265c38da11fe4da0a13a4c212/href">https://medium.com/media/891abd0265c38da11fe4da0a13a4c212/href</a></iframe><p>At the right side of the bottom navigation we have profile activity that we can navigate and see user profile information. Added a new activity and its xml file. I used the same structure of the activity_edit_profile.xml. Also, we can change the attributes with a dialog screen. I created threee dialog layout files for this. I added pen and dialpad icon to change the Name, Surname and Phone Number.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/201/1*H43oGbBJodZ9Z0Vg9Fdryw.png" /><figcaption>activity_home.xml</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/198/1*75F4wTL4zkylXizrU_zn3Q.png" /><figcaption>When you want to change your name</figcaption></figure><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b1873007094a3fae1e8d2269c9c0ce1f/href">https://medium.com/media/b1873007094a3fae1e8d2269c9c0ce1f/href</a></iframe><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/82f948fa704b449fca4ebc59f1807e2e/href">https://medium.com/media/82f948fa704b449fca4ebc59f1807e2e/href</a></iframe><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/1ebc6f634bc4533e3e5b3dfa7eecee05/href">https://medium.com/media/1ebc6f634bc4533e3e5b3dfa7eecee05/href</a></iframe><p><strong>Test…</strong></p><p>User ID is unique for the user.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/955/1*olGYxWS8Gxdrj1W-mPT8tg.png" /><figcaption>Authentication</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/955/1*2LSbvTZvJWDfG2Yi9EoGEA.png" /><figcaption>Realtime Database</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/967/1*3DB2sFOVyTM7wU1PjquofQ.png" /><figcaption>Storage: User ID fetched with the Auth and Database</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/961/1*Dq-YaiKolUo890VmRzNJnw.png" /><figcaption>Storage: Profile Picture</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*_awo_TCdcA86jGH5yu38jA.png" /></figure><ul><li><a href="https://github.com/gamebit34/FirebaseAuthProject">gamebit34/FirebaseAuthProject</a></li><li><a href="https://www.linkedin.com/in/baris-karapinar-8597a4140/">Baris Karapinar - Android Developer - Freelance | LinkedIn</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c20d185bbbaf" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>