惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

WordPress大学
WordPress大学
Recent Announcements
Recent Announcements
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Microsoft Azure Blog
Microsoft Azure Blog
S
Security @ Cisco Blogs
P
Proofpoint News Feed
博客园 - 三生石上(FineUI控件)
T
Tailwind CSS Blog
www.infosecurity-magazine.com
www.infosecurity-magazine.com
The Last Watchdog
The Last Watchdog
AI
AI
Webroot Blog
Webroot Blog
aimingoo的专栏
aimingoo的专栏
Hacker News: Ask HN
Hacker News: Ask HN
B
Blog RSS Feed
小众软件
小众软件
T
The Blog of Author Tim Ferriss
博客园 - 叶小钗
W
WeLiveSecurity
C
CXSECURITY Database RSS Feed - CXSecurity.com
H
Hackread – Cybersecurity News, Data Breaches, AI and More
T
Troy Hunt's Blog
云风的 BLOG
云风的 BLOG
P
Privacy International News Feed
Application and Cybersecurity Blog
Application and Cybersecurity Blog
Vercel News
Vercel News
Y
Y Combinator Blog
P
Proofpoint News Feed
V2EX - 技术
V2EX - 技术
AWS News Blog
AWS News Blog
F
Fortinet All Blogs
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
The GitHub Blog
The GitHub Blog
A
Arctic Wolf
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
Hugging Face - Blog
Hugging Face - Blog
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
V
V2EX
MongoDB | Blog
MongoDB | Blog
SecWiki News
SecWiki News
The Register - Security
The Register - Security
博客园_首页
T
Threat Research - Cisco Blogs
Hacker News - Newest:
Hacker News - Newest: "LLM"
Recorded Future
Recorded Future
V
Vulnerabilities – Threatpost
I
InfoQ
雷峰网
雷峰网
C
Check Point Blog

Natalya Kosenko’s Blog

First six months of being a developer First six months of being a developer My dream to work as a developer came true My dream to work as a developer came true Enjoying Android development through pain Life of a developer is not what I thought Life of a developer is not what I thought Dockerizing Next.js application Dockerizing Next.js application Little joys of engineering manager Little joys of engineering manager Failed to get freelance programmer job Failed to get freelance programmer job Study Master’s in NTU - continuation of my story Study Master’s in NTU - continuation of my story What it feels like to study Master’s in NTU Singapore What it feels like to study Master’s in NTU Singapore Writing Context Managers in Python Writing Context Managers in Python
Enjoying Android development through pain
Natalya Kosenko · 2019-10-14 · via Natalya Kosenko’s Blog

A few months ago I was sitting at my friend’s house, as usual talking about programming and drinking tea. Somehow we came to a conclusion that why don’t we build a mobile app. The friend was going to do a design, while I supposed to code. My coding enthusiasm stopped after I tried React Native and then Kotlin, could not choose whether I want to build a hybrid app or native (but actually I just got lazy and scared I can’t make it).

Nevertheless, this semester I signed up for Mobile App Development course in NTU, decided to give it one more try. I did not have a choice of iOS or Android, hybrid or native, the choice was made for me by the course’s curriculum: Android Java. And this is how my evenings with Android have started…

I can do web frontend, I thought. I can do backend. I should definitely have no problem with Android. I started with small things: got some understanding about activity lifecycle, gestures, scene transitions, intents, etc. Wrote a couple of small games. After that, inspired by my own imaginary success, I decided to do something slightly bigger: an application that gets some data from API and displays it.

First commit I committed on 29 September. Since then I have been writing code almost every evening and every free time during weekend. Guess, how far have I progressed so far? Only a couple of screens both of which are half way done. These are the screens:

These 2 weeks I went through despair, self-depreciation, frustration with Android overall and especially with Java, feeling myself miserable (but in between there were short moments of enjoyment). These are a few things that made me struggle:

  • XML Layouts. Basically, in Android layout can be created by writing XML code or by using drag-and-drop interface. Drag-and-drop drove me crazy: elements did not look the same way in Emulator as they looked in Android Studio, elements did not want to move or moved by themselves whatever places they wanted. Writing XML code felt slightly better, but it is super verbose: just an empty screen with 1 button on it could be 15 lines of xml code.

  • Got confused between Constraint, Relative and Linear layouts. Got confused even more when I found out that RelativeLayout is a legacy which was replaced by ConstraintLayout. How I supposed to know when do I use which? Until now no clue, but I guess it should come with practice.

  • Adding a list to the screen and populating it with data from the API was a nightmare. At first I used a ListView. With the help of Stack Overflow was able to make it work. Then discovered that ListView is a legacy which is replaced by RecyclerView. Spent 2 days to replace ListView with RecyclerView (until now do not fully understand how my code works (especially RecyclerView Adapter) but it works).

  • Making an element at the top of RecyclerView scroll together with RecyclerView took me another 2 days (until I found such a wonderful thing as NestedScrollView).

  • Java itself feels very verbose. 570 lines of Java code was written for these 2 screens (and additionally 454 lines of xml code by the way): Well, I can’t complain about Java, it is what it is. But still, I feel like I wrote tons of code, but in reality there is nothing. It’s like when you come to an expensive restaurant, pay a lot but come out hungry - this is how I feel after writing Java code.

Having said all of that, deep inside my heart I enjoyed all this time. It is not the same kind of enjoyment I have when writing Python or React.js code, but something different. The code is compiling, the app is not crashing, scroll is working - what more can I wish for?