My Journey: What 3 Years of Android Development have taught me the hard way
I'm writing this post to share my journey through Android development, a journey that has taught me many valuable
lessons. I'm penning this article in the hopes that it may assist others who, like me, have faced challenges in this
field.
Back in mid-2016, after graduation, I embarked on my first job. It wasn't until the beginning of 2017 that I decided to
venture into Android Development, a decision that turned out to be one of the best I've made in my life. I had the
opportunity to work on an Android application and learned a great deal during this time.
When I initially delved into Android development, I lacked a mentor or someone to guide me along the right path. I made
numerous mistakes and often spent a considerable amount of time rectifying them. However, the silver lining is that I
learned extensively from these mistakes.
Throughout this period, I not only learned what to do but, more importantly, what not to do. Understanding what not to
do is often more critical in coding than knowing what to do. It might sound amusing, but it holds true. Here, I'm
sharing some invaluable lessons I've learned during my journey, with the hope that they may help newcomers avoid the
mistakes I once made.
1. Learn from Every Mistake and Avoid Repetition
In the beginning, I made numerous mistakes, but I also learned from each one of them. My advice to you is this: learn
from your mistakes but avoid repeating them. Making a mistake isn't the issue; it's crucial not to repeat it and to gain
knowledge from it.
2. Learn Before You Work on It
Another important piece of advice is to read as much as possible. Refer to others' code before you start writing your
own. When you're new to coding, you write what you believe is correct, but there are often opportunities to improve your
code. Trust me, reading and learning from others' code, such as on Stack Overflow, is an excellent approach. Most of
what you write today is based on something you've read elsewhere. Android offers numerous open-source projects. Dive
into that code, but choose libraries wisely. It's essential to select a well-established library and understand how
developers have implemented it. Avoid simple copy-pasting; strive to comprehend the code. Understanding the code is
paramount.
3. Maintain Code Structure
Just as you read others' code, others will also refer to your code. Thus, maintaining a standard code is crucial. Write
clean, concise, and readable code so that anyone reading it, including yourself, will find it enjoyable. When starting
out, we often lack exposure to coding, so we name methods and variables according to our understanding. This can make it
challenging for others to comprehend. Make your code easily understandable and modifiable. Don't obsess over elaborate
names; it's more about selecting names that everyone can agree on. Coding standards can enhance code maintainability and
reduce complexity.
4. Stay Updated with the Latest Technologies
I strongly recommend staying updated with the latest in Android technology. You don't need in-depth knowledge of
everything, but having a general understanding is beneficial. This knowledge allows you to learn and experiment when
needed. Remember to keep track of Gradle versions, API levels, and everything else crucial for building outstanding
Android apps.
5. Optimize Your App for Speed
Always prioritize app speed, and Gradle plays a role in this regard. Long Gradle build times can slow down your
development process. Start by optimizing your build speed through Gradle updates. Additionally, consider using a
profiler, a suite of tools to explore, optimize, and troubleshoot performance. Analyze CPU usage, memory consumption,
network traffic, disk usage, etc. These techniques can help optimize your app's performance. Make it a habit to measure
your app's performance before release; this practice yields better results.
6. Ensure App Security
Numerous software and techniques can decompile your APK file, potentially exposing your class files and resource files
to third parties. Thus, it's your responsibility to enhance your application's security. ProGuard rules can assist in
shrinking, obfuscating, and optimizing your app.For more, you can go through this Link.
These are fundamental aspects to be mindful of, but beyond these, Android encompasses many other areas such as device
compatibility, code flexibility, scalability, 9-patch drawable, architectural patterns like MVC and MVP, and
user-friendliness. These seemingly small elements also play a crucial role in building the best Android app possible.
I hope you find this article enjoyable and that these tips are beneficial to many of you. Please don't forget to like,
share, and comment on the blog. Thank you for reading.