Moment For Technology

Fun part of the Google Compose Challenge

Posted on Dec. 2, 2022, 2:15 p.m. by Nicola Frost
Category: android Tag: android Android Jetpack

I participated in Google's Compose competition before, and I have a lot of fun to share with you.

At the end of March, Google released a beta version of Jetpack Compose, indicating that the Compose framework is stable and ready to be released. In an effort to get developers up and running with the framework early, Google has announced a four-week design contest for submitting compositions weekly.

As the competition entered its second week, Google's official tweet showed that nearly 1,000 developers worldwide had submitted their work in the first week. The first wave of developer enthusiasm for Compose seems to be on the rise.

Here's a look back at some of the fun that happened during week 1.

origin

I received the news of the contest on Google's official official account.

Android Challenge: Jetpack Compose helps you take off!

In week 1, the design task was to submit a pet adoption app with a list of pets and a pet details page. It didn't seem like much of a challenge to develop, and with the first 500 people to complete the challenge getting a Google-Lego Jetpack, I was instantly intrigued and started working as soon as I got home from work.

Open dry

In accordance with the rules, I used the Compose project template to create my work LovePet. Maybe my English is not good enough or I am eager to succeed. I started to type the code without understanding the description of some rules. This also bought the foreshadowing of the story to come.

Compse competition project template

Application requirements are relatively simple, involving the theme, layout and jump these three pieces of knowledge. But since it's your first time using the declarative UI framework for Compose, learning is inevitable, and the Googl-friendly development documentation really helps.

Topic guide

The layout guide

Navigation guidance

Some exploration down the application of the basic idea down.

  • LazyColumnImplement the list
  • RowImplementation list item
  • NavigationRealize screen jump
  • CardImplementation details page

Expect simple development requirements to lead to more or less identical designs. So in the basic requirements to add some of their own design ideas.

  • Found the cute dog icon carefully designed the application logo
  • The layout of the list items is misplaced, instead of being placed at the top, to give a sense of hierarchy
  • In the details cardlikeIcon andadoptButton to improve UI interaction
  • The whole uses bright yellow to fill the background, cyanosis to show the style of content

Let's go up to the final result.

Interested friends can refer to and star.

Github.com/ellisonchan...

submit

After the code was submitted, the Github check badge continued to show failing, which is when I realized there was a problem and instead looked at the template for detailed instructions word for word.

One of the instructions, WHEN I first saw it, I did not fully understand it and did not pay attention to it. It seems that there is a high probability that this place is not the norm.

Refer to theWorkflowThe Github project supports setting workflows that automatically execute each code change. The Actions view of the project also allows you to view a log of its execution for easy traceability.

The default Workflow for Compose's project template is Spotless checking and compile testing.

Github.com/android/and...

Spotless tools can check and adjust the format of the code, and rude imports such as wildcard * are not allowed. The check Workflow passes after the format check is performed, and the project's badge displays passing as desired.

forSpotlessIt is difficult to make a fair assessment of the need for such tools. On the one hand, it's efficient; On the other hand, automatically reformatting and possibly even changing the order of the code can be problematic. Especially for large projects, it can be scary to change code in unknown places because there is no guarantee that the logic and layout of the code will not be affected.

So when faced with demo-level programs or unfamiliar languages, you can use these tools to help you learn and adapt to code specifications. For familiar languages or mature projects, it is best to code syntaxically at the coding stage.

episode

After Workflow Passing, I thought everything was all right and forgot about it. Two days later (less than two days before the first race is due) WHEN I was searching for information on Croutines, I came across an article about Compose race.

I thought I had finished the competition and what to watch, but the serious curiosity and good learning attitude of the technical people prompted me to go in. (TWO minutes later I would have admired that decision, but later I would have regretted not clicking on it.)

The article went into great detail about the competition, especially one important rule THAT I had overlooked in the scientific Internet hassles of the day: tweet a screenshot of your app and submit a project address and a link to the tweet.

Jetpack Compose is in Beta! Join the Android Development Challenge!!

I finally did not submit the code, which is equal to Google people do not know you entered the competition, is not too injustice... But to be honest, I have to make fun of it. Google is not very uniform in documenting the rules of this competition. The official account, Github and the official website have recorded some rules respectively.

It was 1:00 in the morning after all the frantic tweeting and submitting. It was in the second half of the tournament, and it was obviously a bit of a stretch to break into the top 500, since you were competing with global developers.

I was wondering when I caught a glimpse of the author's ID. It looked familiar. In retrospect, the wechat ID of my former team leader seems to be the same. His ID is an English word, I do not know, it is a bit like the name of the famous song Viva la Vida by Coldplay, but not exactly the same, so I am deeply impressed.

It turned out to be his blog, which, quite coincidentally, guided me in this way again after all these years. I looked through his other articles and found that I had read several of his articles before but failed to recognize them. Lol.

I highly recommend his blog, which is fresh and sincere, and can really help you in other areas, if not in android.

Fundroid nuggets Blog

harvest

It only took a few days to enter the competition and the coding time was not long, but I was deeply impressed by the advantages of Compose framework.

  • Clean code
  • Convenient view preview and other AS function support
  • A declarative APPROACH to UI programming that focuses on interfaces
  • Build high performance native interfaces
  • Perfect pairing with Material Design and the Jetpack framework

Every Android developer needs to know and use this framework as early as possible, and it's going to be an important technology you can't avoid.

touch

The app's tweet received a "like" from a foreigner a few days after it was posted.

His personal description was a little longer, but I noticed a few keywords: Engineer, Google, compose. On closer inspection, he found that the story was not small,It turned out to be GoogleComposeThe pioneer of framingI feel honored to receive his likes.

Clicking on his homepage, I stumbled upon the story behind the Compose framework. He started proposing and developing Compose back in 2017, and it took four years until the recent beta release.

I can't help but admire the amount of time, effort, money, and determination that a large company like Google is willing to put into a new technology.

And genuinely happy for the engineer. After all, what a feeling and accomplishment it is to see that a framework that I have spent four years designing from scratch can spread across the globe and produce thousands of interesting apps.

conclusion

Some people might say that you wrote hundreds of lines of code in the competition, and you pulled all these strings. (Facepalm) Yeah, it's a lot. But I still find the experience interesting, and that's all. I would like to share a few words with you from the bottom of my heart, whether it's advice or chicken soup.

  • Be brave enough to take the first step towards something new. Many worries will be solved in trying, and many things that we think we can't do will be solved.

  • If you really want to get something done, do your best to understand every detail about it. Don't because of some small difficulties small trouble thinking about avoidance thinking about ignoring, behind the real thunder, or long or long interval.

  • Loss of temperature may be a blessing in disguise. The rest of the story would not have happened if we had not gone the wrong way.

  • If you don't get a captcha when you sign up or log in to Twitter, try changing the language to English and magically receive... The reason is so interesting that you can ask twitter about it on Quora some day.

The LovePet app has many features that can be extended and will continue to use the Compose framework to add new interfaces and features. The corresponding development of Compose will also be released. Please look forward to it.

Search
About
mo4tech.com (Moment For Technology) is a global community with thousands techies from across the global hang out!Passionate technologists, be it gadget freaks, tech enthusiasts, coders, technopreneurs, or CIOs, you would find them all here.