I still remember the day back in 2016 when I decided to start developing Android, and that was one of the best decisions I’ve made in my life. It’s been around two and a half years now and I’ve had the opportunity to learn a lot of things in Android and to unlearn them. I didn’t have a mentor or someone at first when I started to guide me to do things the right way. I made a lot of mistakes and wasted a lot of time and rectified them later. Later, after a year and a half, I got the chance to work with Envato Market, who endorsed my first “ABC Mobile Security” project after 3 times hard rejection and 1 time soft rejection.
At that time, I was fighting to sell my first app to Envato Market with my own mind. I was depressed by the Envato officials ‘ bad comments about my product, but I never gave them up and that’s why I’ve been working with them over the past 1 year. I developed 15 apps this year and they’re at Envato Market. I learned what to do and what not to do most importantly. I’ve been trying to help other developers in ways I can, directly and indirectly, for quite some time. In this article, I’ll share some of the gems I’ve collected over the years. It might help someone get started faster and not repeat the mistakes I made once. Disclaimer: I’ll focus primarily on Android and some programming and product development concepts in this article, so if you’re not familiar with any of these, you may not want to read more. Others, just plunge into it. That’s right. 🙂
1.Don’t reinvent your wheel
I had a bad idea not to use open – source libraries at first. I just wanted to do it myself, whatever I needed. It was a terrible idea seriously.
If you have a problem developing your app, and if someone else has solved that problem before and in a good way, why not use it? You can save a lot of time for yourself.
2. Choose Libraries Wisely
In Github there are lots and lots of open – source libraries that you can use for FREE. But don’t get too excited and blindly begin using libraries. Check the number of stars the library has, the better. Check if some other popular libraries were also created by the author of that library. Check out the issues (open and closed) that can give you a better understanding of how robust and stable the library is in production.
You should dive into that library’s code if you can afford the time and check yourself if it’s really worth it You just want to make sure your code is reliable, bug – free and high – quality.
3. Sit, Take a Cup of Coffee and Read More Code
We spent most of our time reading others code than writing ourselves. If you are not doing that, START today. Whatever code you are able to write today is only because you have read and learned something, somewhere, someday. It’s just a reflection of what you already know. You can only grow and improve yourself by reading and learning from other work.
The great thing about Android is that it is a completely open-source platform. Dive into the code and check how they have implemented the framework. There are thousands of open-source libraries in Github. Just pick a library and see how the developer have implemented it.
4. For God Sake, Maintain Proper Coding Standards
If you compare coding with writing, then coding standards is like your handwriting. As you would be reading more of others code, other people will also be reading a lot of your code and you don’t want to scare the shit out of them, do you? And if you are working in an organization and collaborating with other developers heavily, do take special care about it. Write short, clean and readable code that YOU and people reading your code would enjoy thoroughly. Your code should read like a story.
Code is Poetry. Don’t complain if you write a piece of code and your colleagues don’t talk to you for a few days. Bonus To start with, you must thoroughly go through this && this
5. You Need ProGuard, Yes, You Need It!
Never ever, ever make the mistake of releasing your app on the Play Store without using ProGuard. ProGuard not only minifies your code, but it obfuscates your code making it harder for reverse-engineers to understand, replicate and manipulate it. Its absolutely free and comes bundled with the Android SDK, and there is absolutely no reason for you not to use I have seen several developers releasing their app on the market without ProGuard. It should not take more than a few hours for a not-so-skilled hacker to manipulate an the app released without Proguard. Pro Tip: But if you want top-notch security, then ProGuard is like a cardboard while you need a safe, and here it is, DexGuard.
6. Analytics Is Your Best Friend
If you want to create a truly amazing app, you need to heavily rely on analytics tools to analyze the performance and usage of different parts of your app. By analytics, I refer to both crash reporting and app usage tracking and you need both of them. Whatever you do, you can never make something perfect. When real users will start using your app on a variety of Android devices and on various Android versions available, you will even see some of your best written code to fall flat on the ground. Crash reporting tools can help you to track and fix them, one crash at a time. You also need to start thinking like a marketer and analyze the usage of various portions of your app. This is what will help you bridge the gap between what you made and what your users actually want. Pro Tip: Here is an affordable market analysis tool, I love to use.
7. Time to Optimize Your App
This is something that most of us generally dont do, but you should and you need to. There is a big difference between writing code and writing optimized code. Write code that runs quickly, takes less memory and consumes less device storage. An unoptimized app works well under normal circumstances, but when put to different stressful situations, it can show you its true colors. Check the amount of memory used by your app and look for memory leaks. Remember, a tiny leak can sink a big ship. Spend time on understanding how the Garbage Collector works in Java, create heap dumps and analyze your live objects. Pro Tip: Use Leak Canary to detect your memory leaks. It can save you a lot of time by automating this task for you.
8. Test, Test and When You Are Done, Test Again!
There is nothing more important than testing. This is something that should be at the top of your list. Test your app as thoroughly as possible. Spend time for writing automated test cases. Create various stressful situations for your app and see if it can survive. I had once made the mistake of releasing my app out of hurry and didn’t spend proper time testing it. I was waiting for my users to face bugs, report it and then I would go and fix them. Never, ever, ever do that. You might save a day, or two, or a week by cutting down time from testing, but will probably have to spend more than twice later. Don’t do anything out of hurry, take your time and think long term. Be a visionary. Sow now, reap later.
9. Make it Difficult for the Hackers
The open-source nature of Android is what makes it vulnerable to attacks. Every Android app can be decompiled, reverse-engineered, ripped open, analyzed and manipulated with ease.You don’t want that to happen to your app, right? You should know how to securely store API keys locally in your app. If you are dealing with sensitive data of the users, then you must know how to encrypt them, what algorithm to choose (secure yet fast).You should also store the encryption keys securely either in the server or locally (if needed). You should prevent your app data from being backed up using the ADB (Android Debug Bridge).
If you are storing sensitive data in the database, consider obfuscating it. If your app has a premium version which gets cracked and gets released for free. You would incur a serious loss in business, right? There are several things you can do to prevent your app from getting tampered.
There is nothing like 100% security. Any skilled and determined hacker with the right resources, tools and patience can crack your app. All you want to do is make it difficult, rather very difficult for the hacker to crack it. I have tried to share some of the lessons that I have learned in this short journey with Android development. I will continue my journey, learn more and share even more. I hope it helps someone and makes their life a bit easier.
If you like this article, do give it a thumbs up, comment on it and share with with your friends.