Congratulations! ๐ You have been selected by your dream company to participate in a debugging challenge that was designed to find the best talents in Android Development. The winners of this challenge will be granted a full-time offer in the company's Mobile Software Engineering department - this is a once in a lifetime opportunity!
By the end of this lab you will be able to...
- Debug an app using Android Studio
- Understand Views and view hierarchies
- Understand interaction through click listeners
- Understand View type casting
Before diving into the challenge, we need to clone the starter version of the app:
https://github.com/driuft/redbutton-debugging-challenge.git
In this step, the app crashes automatically when launching.
- Check
Logcat
for crash-related errors - are there any blue hyperlinks pointing to specific lines of code? - Make necessary changes in the code to allow the app to run
The app should now launch successfully, but there is something preventing interaction with the Blue button. Usually there is a Ripple Animation that occurs when the button is clicked, but nothing seems to be happening.
- Open
activity_main.xml
- Find any View that might be obstructing our Button from being clicked and modify/delete it
- Re-run the app
The blue button decided to celebrate Halloween early this year with a costume of the red button. It is telling us to check our layout file. Let's try to change the visibility
of the blue button.
- Open
activity_main.xml
- Change the visibility of the Button with id
blue_button
togone
- Re-run the app
There is now a tiny yellow button shown. It's a bit small to be interacted with, so let's try to increase its size.
๐ก PRO TIP: Press and hold the tiny button if you are feeling lucky today
- Open
activity_main.xml
- Find the Button with id
tiny_yellow_button
- Change its size to allow easier interactivity
- Re-run the app
- Press and hold the Button to trigger its
longClickListener()
Is this the real red button? Has our journey finally come to an end? Only one way to find out.
- Tap the red button
๐ Congratulations, you've successfully completed the challenge! ๐ You have shown that you are more than capable as an Engineer, and the company will be extending an offer. Now go change the world! ๐