Do you want to start in Android development? I tell you my story.

Nowadays mobile development has increased a lot. You can read on the Internet about an old woman who developed her first mobile app for iOS or a kid that makes a living by developing games for Android. But, how did they start?

Around the world, there are a lot of institutes and universities that teach how to create mobile applications in just two months with a perfect certificated and may working when finishing the course. However, not all people can afford for these because Android courses can cost around $300 by month.

I entered in Android programming thanks to the Internet and tutorials. Now I work as an Android Developer in a smartwatches company. Let me tell you how I started.

Image from wallpapercave.com

Brief early story

On my childhood, I used to develop my own website using HTML and CSS, also, I liked that the people who used to visit my website have an account registered in it. I learned PHP with Dreamweaver (actually, I learned by reading the PHP and SQL code generated).

When I was 18 I wanted to create my own mobile application to allow students knowing each other by going to their Universities sharing their cars as carpooling. But I did not know how to do it! What did I do? I started to google it.

Yes. I started searching “how to create a mobile app”. It’s funny because I found a lot of resources such as hybrid and native applications tutorials. Honestly, I was afraid of native applications because when I saw the java callbacks examples (mainly) were something I had never seen. So, I decided to develop a hybrid app because I knew how to do web pages using JavaScript, HTML and CSS. It took me 4 hours to develop a simple game but reading on forums I realized that developing hybrids apps was not going to be the best idea if I would want to create an advanced app using native features as the mobile phone camera. Then I gave the big step: starting on native apps. On those times, I did not have a MacBook with Xcode but I had an iPhone… I looked for android native app development.

My first steps

I remember a YouTube channel of an Indian programmer who taught all Android components: from buttons and simple clicks to the filling of RecyclerViews getting information from a database using the Volley Library. But my early months weren’t like doing a lot of Android Studio small projects for every ‘lesson’. I applied all lessons to my in-development app of those times. While I was creating my first app, I was learning how to do specific things thanks to video tutorials.

Each thing I wanted my app have, I searched it on YouTube. I used to watch video tutorials because reading documentation was boring for me but over time you realize that it’s not so. In articles, readme files of sample codes or Android Developers documentation, you notice that there is information that video tutorials do not mention or they didn’t take it into account. Maybe if you’ve already been a couple of months in Android development you identify with this.

My first official app was “Tapme!”, a game I wrote firstly in JavaScript (hybrid app). I developed it using REST API services I created in a MySQL web host for saving users scores. I paid for a Google Developer account to publish apps on Google Playstore, it costs $25 and it’s a single payment in contrast to Apple that you must pay $100 per year.

Based on trial an error, I learn many things on the Google Developer Console. It’s important to know that package names of applications must not change after you upload them to Google Playstore, it is like the ID of your app. Moreover, you must read how to sign your app and do not forget the release key .jks file you generate for uploading the application, if you lose it, you won’t be able to upload an APK file for updating the app. And don’t forget to up your versionCode number when trying to upload a new version in Playstore. You can download Tapme! from this link: https://play.google.com/store/apps/details?id=com.jflavio1.tapme.

In those times, I never cared about best practices like making unit tests to my apps, take advantage of the use of design patterns, the importance of use the debugging tool, know how much useful is the Android Monitor for avoiding memory leaks or take time for reading about android architecture and learn how it works. I was like a kid.

And nowadays…

Today I’m working in a start-up as an Android Developer. I also have learned a lot here. I invest time on reading how different libraries work, android developers’ blogs and also, I wrote my own android library for managing Wi-Fi networks: WifiConnector.

Few weeks ago, I made what I consider a big step: compile Android Source Code from AOSP (Android Open Source Project), being sincerely, it took me about 5 business days. It’s incredible to learn how Android works and how it compiles apps.


Learn from your errors

This is so important, really.

You are going to be the same Junior Programmer if you use the last thing that worked.

Analyze your code and learn from others.

I remember I used to repeat buttons style in many different activities and fragments. This is so bad because when you want to change the style of the application, you have to find all your buttons and change them. My activities classes never inherited from a parent class.

This is a simple error that I realized with time and I tell them so that you don’t either.

Improve your code by checking seniors and professionals code in GitHub for instance, and compare your initial code style. This is why is so important to learn new things and analyze others code because you can watch how distinct people translate their ideas into code.

Best practices and recommendations

May be this is the most important part of the article. I do not consider me as an Android Senior Developer but I think with experience I have gained, I can write about what things I recommend and regard as useful for beginners so they do not fail in the same mistakes as me.

Do not start programming an app ‘crazy’. Take time writing the basic things you want your app do. Afterwards, put it on a cool design for finally develop it. This must not take you more than one or two hours.

Create parent classes and styles.

This is a good recommendation to implement. Having parent classes allows you to have control of all classes that inherits from them and makes your code easy to refactor and maintainable.

UML Diagram for activities classes.

For example, if you are thinking about building a medium/large app, you could use this UML Diagram. In this case, we have SuperLoginActivity for all activities that are going to have the same behavior and styles for login screens. The same with SuperRegisterActivity. I create two more activity classes for swipes and button screens. Notice that upper activities are, essentially, abstract classes and does not have a xml resource. You could do the same with fragments and all you can imagine. As a little tip, the use of nomenclature for names could apply for everything, from variables and classes’ names to xml resources’ names.

Use a nomenclature for names.

As I mentioned before, you should use names that allow you to identify objects, resources, images, classes, and all of them just by typing some keywords. For instance, I use this nomenclature: <WHERE>_<TYPE>_<RESOURCE_NAME>. So, if I want to look for a button in a fragment I would type: loginFragment_btn_loginBtn.

Divide your packages by modules or classes types.

This could be useful in a future. There are two types of techniques for naming packages. If you name them by type, means that classes are going to be divided by their type, in other words, you can find all activities in one packages, all fragments in one package, all adapters in one package and so. On the other hand, if you name them by module means that you are going to divide classes by your app functionality, so in one package you are going to find classes, fragments, adapters and many others by classes types.

Learn how to use the Android Monitor.

It’s important to know how to use this tool provided by Android Studio. May be not in order to become an expert but for identifying memory leaks and reduce your app RAM use thanks to Memory Monitor. Few months ago, I found a good article about this: http://www.theshiftingbit.com/Fixing-Memory-Leaks-in-Android-Studio.

Watch Android Performance Pattern Videos.

They are on YouTube and may are good resources for beginners. For example, for Memory Monitor: https://www.youtube.com/watch?v=7ls28uGMBEs.

Take a time to learn how android works.

Maybe you are not thinking to become an AOSP developer and create your own custom ROM, but knowing how this great platform works is a basic stuff you must read. Link with summary: https://developer.android.com/guide/platform/index.html.

Learn about agile methodologies.

This is something you can find on the Internet very easy. Knowing the main tools of development like agile methodologies used by teams will serve you when you start to work.

Have a testing culture.

Every significant change you make, test it. Create a testing class for assure you are not breaking other functionalities.

Use a version control system.

This is so important if you find a job as a developer. GitHub for open source projects or Gitlab if you do not want anyone watch your code.

Learn from others.

As I mentioned on above section, learning from others code is very useful. You can compare how you do shape your ideas in contrast them. This could be applied for libraries source code; your knowledge increases a lot if you follow this recommendation.

IMPROVE YOURSELF.

The most important thing of all recommendations I could give to you. Do not limit you. Do not settle. If you develop some function then write it again in other way and compare which one works better, which one adapts to changes and allow you to make easy unit tests.


Useful links

Here I share some links that makes my life easier:

If you are a beginner or are thinking on starting in this world, I hope this article could help you. I am not a professional android developer with 5 years of experience, I’m like you, a developer that wants to learn more and more.