Android App Development | Lecture#21 | Hive Learners
hive-153850ยท@faisalaminยท
0.000 HBDAndroid App Development | Lecture#21 | Hive Learners
<center><h2>๐๐ป๐ฎ๐ฎ๐ฝ๐ฒ๐ท๐ฐ๐ผ</h2></center> <div class="text-justify"> Hello, dear Hive Learners, I hope you all are well. Today is our 21st lecture on Android App Development. We will start developing a Sign-in and Sign-up page. Today We will design the Signup page with the Material Design.  ### [GitHub Link](https://github.com/faisalamin9696/HiveLearners2) Use this GitHub project to clone into your directory. It will constantly get updated in the following lecture so you will never miss the latest code. Happy Coding!. ### What Should I Learn - Add Material Design implementation in Gradle file - Use the Material design to create a sign-up page design. ### Assignment - Create a design for the Signup page ### Procedure First, we need to add the Material Design library to the Gradle file. Use this implementation. After adding the library click on the sync button. Make sure that you have a reliable internet connection. After the Gradle successful build, we can use the Material Designs in our XML file. ``` implementation 'com.google.android.material:material:1.0.0' ```  On the sign-up page, we are going to add 4 edittext fields (name, email, password, confirm password) We will use 3 buttons (signup, signing). Due to Material design, we can style the whole page easily. I have created this design. You can make your design. Here is the code for the ```main_activity.xml``` file for this design. ``` <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" tools:context=".MainActivity"> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical" android:padding="8dp"> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" android:layout_marginBottom="5dp" android:text="CREATE ACCOUNT" android:textSize="26sp" android:textStyle="bold" /> <com.google.android.material.textfield.TextInputLayout style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.Dense" android:layout_width="match_parent" android:layout_height="wrap_content" android:hint="Enter Your Name" app:boxStrokeColor="@color/black" app:boxStrokeWidth="1dp"> <EditText android:layout_width="match_parent" android:layout_height="wrap_content" /> </com.google.android.material.textfield.TextInputLayout> <com.google.android.material.textfield.TextInputLayout style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.Dense" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginTop="5dp" android:hint="Enter Your Email" app:boxStrokeColor="@color/black" app:boxStrokeWidth="1dp"> <EditText android:layout_width="match_parent" android:layout_height="wrap_content" /> </com.google.android.material.textfield.TextInputLayout> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_weight="1" android:orientation="horizontal"> <com.google.android.material.textfield.TextInputLayout style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.Dense" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginTop="5dp" android:layout_marginEnd="2dp" android:layout_weight=".5" android:hint="Enter Password" app:boxStrokeColor="@color/black" app:boxStrokeWidth="1dp"> <EditText android:layout_width="match_parent" android:layout_height="wrap_content" /> </com.google.android.material.textfield.TextInputLayout> <com.google.android.material.textfield.TextInputLayout style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.Dense" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginStart="2dp" android:layout_marginTop="5dp" android:layout_weight=".5" android:hint="Confirm Password" app:boxStrokeColor="@color/black" app:boxStrokeWidth="1dp"> <EditText android:layout_width="match_parent" android:layout_height="wrap_content" /> </com.google.android.material.textfield.TextInputLayout> </LinearLayout> <com.google.android.material.button.MaterialButton style="@style/Widget.AppCompat.Button" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_gravity="center" android:layout_marginTop="10dp" android:backgroundTint="#2987B1" android:text="Sign up" android:textColor="@color/white" app:cornerRadius="4dp" /> </LinearLayout> </LinearLayout> ```  We also need to set the IDs for all the widgets to use in the java file. I have set the IDs (signup_name_et, signup_email_et, signup_pass_et, signup_confirm_pass_et, signup_btn) ``` <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" tools:context=".MainActivity"> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical" android:padding="8dp"> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" android:layout_marginBottom="5dp" android:text="CREATE ACCOUNT" android:textSize="26sp" android:textStyle="bold" /> <com.google.android.material.textfield.TextInputLayout style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.Dense" android:layout_width="match_parent" android:layout_height="wrap_content" android:hint="Enter Your Name" app:boxStrokeColor="@color/black" app:boxStrokeWidth="1dp"> <EditText android:id="@+id/signup_name_et" android:layout_width="match_parent" android:layout_height="wrap_content" /> </com.google.android.material.textfield.TextInputLayout> <com.google.android.material.textfield.TextInputLayout style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.Dense" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginTop="5dp" android:hint="Enter Your Email" app:boxStrokeColor="@color/black" app:boxStrokeWidth="1dp"> <EditText android:id="@+id/signup_email_et" android:layout_width="match_parent" android:layout_height="wrap_content" /> </com.google.android.material.textfield.TextInputLayout> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_weight="1" android:orientation="horizontal"> <com.google.android.material.textfield.TextInputLayout style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.Dense" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginTop="5dp" android:layout_marginEnd="2dp" android:layout_weight=".5" android:hint="Enter Password" app:boxStrokeColor="@color/black" app:boxStrokeWidth="1dp"> <EditText android:id="@+id/signup_pass_et" android:layout_width="match_parent" android:layout_height="wrap_content" /> </com.google.android.material.textfield.TextInputLayout> <com.google.android.material.textfield.TextInputLayout style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.Dense" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginStart="2dp" android:layout_marginTop="5dp" android:layout_weight=".5" android:hint="Confirm Password" app:boxStrokeColor="@color/black" app:boxStrokeWidth="1dp"> <EditText android:id="@+id/signup_confirm_pass_et" android:layout_width="match_parent" android:layout_height="wrap_content" /> </com.google.android.material.textfield.TextInputLayout> </LinearLayout> <com.google.android.material.button.MaterialButton android:id="@+id/signup_btn" style="@style/Widget.AppCompat.Button" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_gravity="center" android:layout_marginTop="10dp" android:backgroundTint="#2987B1" android:text="Sign up" android:textColor="@color/white" app:cornerRadius="4dp" /> </LinearLayout> </LinearLayout> ``` We also need a Sign-in button if a user already has an account then the user clicks on sign-in or Already has an account button. I am using a borderless button here.</div> ``` <com.google.android.material.button.MaterialButton android:id="@+id/already_act_btn" style="@style/Widget.AppCompat.Button.Borderless" android:layout_width="wrap_content" android:layout_height="35dp" android:layout_gravity="center" android:text="Already Have an Account" android:textColor="@color/black" android:textSize="14sp" app:backgroundTint="@null" android:background="@null"/> ```  <center>  <h2>Thank You</h2>  <div class="pull-left"><a href="https://discord.gg/7Bzqv4qUMT"> <img src="https://cdn.steemitimages.com/DQmXd6PwGUHRgSDkWtwKfDvdFpaLHXvXBdK7wnYZeqe1GUa/discord_animation_logo.gif"/></a> </center>
๐ curx, crokkon, apx, funnyman, eliel, improv, alphacore, codingdefined, stinawog, sustainablelivin, steem.services, ordinaryamerican, tinyvoter, optimizer, infinite-love, ebargains, estream.studios, jacuzzi, libersolum, xves, bergelmirsenpai, lemouth, steemstem-trig, steemstem, dna-replication, omstavan, minnowbooster, howo, aboutcoolscience, stemsocial, roelandp, akipponn, lamouthe, curie, techslut, valth, oluwatobiloba, mobbs, alexander.alexis, ludmila.kyriakou, tsoldovieri, postpromoter, sco, anikekirsten, fragmentarion, pab.ink, geopolis, melvin7, francostem, de-stem, deholt, motherofalegend, gerdtrudroepke, stem.witness, laruche, onewolfe, prosocialise, dhimmel, mahdiyari, abigail-dantes, bhoa, kenadis, intrepidphotos, alexdory, charitybot, temitayo-pelumi, pboulet, crowdwitness, enzor, croctopus, doctor-cog-diss, jerrybanfield, bitrocker2020, aaronleang, revo, utube, silentscreamer, muratkbesiroglu, laxam, qberry, gogreenbuddy, cheese4ead, cliffagreen, precarious, quinnertronics, milagrosmhbl, seinkalar, finch97, sepracore, rt395, gunthertopp, neumannsalva, hijosdelhombre, charitymemes, armandosodano, thelittlebank, brianoflondon, epicdice, ayee11, limeric01, jasedmf, dauerossi, paulmoon410, calebotamus, kylealex, devann, aabcent, meritocracy, kephler, justyy, meno, photohunt, irgendwo, rubencress, diabonua, steemstorage, edencourage, dmoonfire, appics.tutorial, dcrops, lycanskiss, limeric19, maverickfoo, vinnieleow, thecryptodrive, val.halla, mulletwang, dreamm, michelmake, gaottantacinque, steemcryptosicko, double-negative, michaias, steemean, peterale, drricksanchez, nozzy, pogier, eman13088, newsflash, thelordsharvest, takowi, ryenneleow, nateaguila, bflanagin, cribbio, douglasjames, ozmash, zirky, holoferncro, johnsdowie, netvalar, gmzorn, zyx066, sunsea, esteliopadilla, theskmeister, deriyon, monsterjamgold, manic.calm, prize.hoard, pompeylad, mugueto2022, cnfund, roomservice, sam99, steveconnor, punchline, soufiani, lorenzopistolesi, citizendog, rmu01, endrius, mayberlys, raph1, ledgar, skimanner, bhdc, street.curator, cloh76, tfeldman, federacion45, princessmewmew, bellaian, jessicaossom, aries90, zirkonov, jayna, stayoutoftherz, fineartnow, therising, achimmertens, bit4bit, quentinvb, rtron86, aicu, veeart, nbs.gmbh, mayorkeys, cassioandro, steemwizards, notb4mycoffee, merlin7, migka, detlev, ew-and-patterns, luisestaba23, kingz1337, djennyfloro, neneandy, movingman, laloretoyya, carolinaelly, taniagonzalez, goblinknackers, rmach, mcsvi, firstamendment, meanbees, ibt-survival, erick1, ykretz, paypalbis, sanderjansenart, comidinhas, primersion, minnowspeed, robibasa, justlee87, dechuck, mr-rent, lordvader, pladozero, atheistrepublic, dondido, sevenoh-fiveoh, juecoree, stem-espanol, yehey, lorenzor, ufv, analealsuarez, iamphysical, azulear, carloserp-2000, bartheek, miguelangel2801, delpilar, tomastonyperez, elvigia, josedelacruz, erickyoussif, andrick, uche-nna, reinaseq, fran.frey, aleestra, giulyfarci52, wilmer14molina, aqua.nano, newton666, crptogeek, psicoluigi, capp, robmojo, mammasitta, aotearoa, aaronkroeblinger, scruffy23, realblockchain, sardrt, massivevibration, bennettitalia, safrizal.mus, franzpaulie, eric-boucher, robertbira, eliaschess333, nicole-st, esthersanchez, amansharma555, flatman, orlandogonzalez, cyprianj, gifty-e, anaestrada12, ennyta, gaming.yer, endopediatria, gwajnberg, stem-curator, yggdrasil.laguna, stemgeeks, stemcuration, adamada.stem, solominer.stem, stuntman.mike, stemline, ruari, star.stem, babytarazkp, saboin.stem, scooter77.stem, he-index, blainjones, elianaicgomes, cbridges573, lazy-panda, prayzz, kronias, bruno-kema, mahirabdullah, ziabutt3836, offia66, chincoculbert, shopnilhasan, estherscott, gi-de-on, lawrence27, queenpriscilla, olivemarcel, hive-learners, auto-moderation, prechidi, niglys, sayu907, stem.alfa, serhotest, chapmain, limka, melinda010100, emrysjobber, holovision.stem, dayatsiaulia, good-karma, esteemapp, esteem.app, ecency, ecency.stats, thelordsfinest, drwom, auleo, cherryng, magicm1ke, fairyberry, mike-1996, xecency, photographercr, iliyan90, elkakoycheva, ississ89, velinov86, sneji79, tiger85, selena14, ivangeevo, alicewonderyoga, tbabachev, silviq93, mihaylov, vaketo, mobluesbetter, pavlevskifamily, mmanolev33, dakothelion, matrix-guru, dontcare89, didivelikova, iliev26, maysia57, roflie, krishu.stem,