Create a Birthday Card app

Happy Birthday Card App with Kotlin

Last Updated on December 19, 2020 by AbdurRahman G Official | Md Ghufran Salafi

Create a Birthday Card app:

 

Learn more

Learn more

 

Short and Full Forms:

dp = density-independent pixels

sp = scalable pixels

 

Solutions from Android Developer Official Site:

Solution code

The solution code for the Happy Birthday app has been uploaded to GitHub, in case you’d like to see the code that we ended up with.

GitHub is a service that allows developers to manage code for their software projects. It uses Git, which is a version control system that keeps track of the changes made for each version of the code. If you’ve ever seen the version history of a Google Doc, you can see when and what edits were made on the document in the past. Similarly, you can track the version history of the code in a project. This is very helpful if you are working on a project as an individual or with a team.

GitHub also has a website where you can view and manage your project. This GitHub link allows you to browse the Happy Birthday project files online or download them to your computer.

To get the code for this codelab and open it in Android Studio, do the following.

Get the code

  1. Click on the Solution Code URL. This opens the GitHub page for the project in a browser.
  2. On the GitHub page for the project, click the Clone or download button, which brings up a Clone dialog.

v5ZBt4SZytjyBnVvpTogKBvrpekuBZpgU-HyrX7i5PZYupqIBs5ZRUR8iyHJODQJpugZRtz-zLi5-O1nGiEvdL4VTGyvT_W3MINzRBsUa25zeJdt9tol7-msOoT8AJ-RWMl81wsR_w

  1. In the dialog, click the Download ZIP button to save the project to your computer. Wait for the download to complete.
  2. Locate the file on your computer (likely in the Downloads folder).
  3. Double-click the ZIP file to unpack it. This creates a new folder that contains the project files.

Open the project in Android Studio

  1. Start Android Studio.
  2. In the Welcome to Android Studio window, click Open an existing Android Studio project.

Tdjf5eS2nCikM9KdHgFaZNSbIUCzKXP6WfEaKVE2Oz1XIGZhgTJYlaNtXTHPFU1xC9pPiaD-XOPdIxVxwZAK8onA7eJyCXz2Km24B_8rpEVI_Po5qlcMNN8s4Tkt6kHEXdLQTDW7mg

Note: If Android Studio is already open, instead, select the File > New > Import Project menu option.

PaMkVnfCxQqSNB1LxPpC6C6cuVCAc8jWNZCqy5tDVA6IO3NE2fqrfJ6p6ggGpk7jd27ybXaWU7rGNOFi6CvtMyHtWdhNzdAHmndzvEdwshF_SG24Le01z7925JsFa47qa-Q19t3RxQ

  1. In the Import Project dialog, navigate to where the unzipped project folder is located (likely in your Downloads folder).
  2. Double-click on that project folder.
  3. Wait for Android Studio to open the project.
  4. Click the Run button j7ptomO2PEQNe8jFt4nKCOw_Oc_Aucgf4l_La8fGLCMLy0t9RN9SkmBFGOFjkEzlX4ce2w2NWq4J30sDaxEe4MaSNuJPpMgHxnsRYoBtIV3-GUpYYcIvRJ2HrqR27XGuTS4F7lKCzg to build and run the app. Make sure it works as expected.
  5. Browse the project files in the Project tool window to see how the app was implemented.

 

Solutions from AbdurRahman G:

 

Project on Github:

https://github.com/AbdurRahmanG/Happy-Birthday-Card-App-in-Kotlin

App Links:

Happy Birthday Card App Using Kotlin

 

Summary

  • The Layout Editor helps you create the UI for your Android app.
  • Almost everything you see on the screen of your app is a View.
  • A TextView is a UI element for displaying text in your app.
  • A ConstraintLayout is a container for other UI elements.
  • Views need to be constrained horizontally and vertically within a ConstraintLayout.
  • One way to position a View is with a margin.
  • A margin says how far a View is from an edge of the container it’s in.
  • You can set attributes on a TextView like the font, text size, and color.

Summary

  • The Resource Manager in Android Studio helps you add and organize your images and other resources.
  • An ImageView is a UI element for displaying images in your app.
  • ImageViews should have a content description to help make your app more accessible.
  • Text that is shown to the user like the birthday greeting should be extracted into a string resource to make it easier to translate your app into other languages.

 

 

 

Leave a Reply

Your email address will not be published. Required fields are marked *