Programming Tips

Starting Your career As An Android Developer And Mistake To Avoid As A Beginner

Today we will be discussing an important topic that so many android developer do ask when trying to choose a part in app development and also speak on some common mistake that beginners do make while starting their career in app development and teach on how we can avoid them as well.

Building android applications is really a nice skill to develop because with the rate of android user from the last five years , their’s hope of making big cash with building android applications.

So we will be giving 101 guild of becoming a successful android developer and we will also share some source that one can get help in developing an android app.

Guide to Becoming a Better Android App Developer

Did you realize that consumers spend nearly $86 billion on apps each year? If you are an app developer, finding a way to make your programs stand out from the competition should be your main goal. Failing to focus on making your apps functional and engaging can make it difficult to achieve the level of success you are after.

While there are thousands of Android app developers in this country, there are only a handful of developers that create unique apps for their audience.

Becoming a great Android app developer is not an overnight process. You will have to work hard and practice your craft on a regular basis to hone your skills. Below is the chart of how android has been engaged in our daily life

Getting Familiar With Android Frameworks is Essential

When we say you need to get familiar with Android frameworks, we aren’t talking about framework documentation. Getting in-depth knowledge of Android framework code is essential when trying to work within this system successfully.
There are a number of developers who shy away from learning this framework code because they are intimidated.
If you are looking to get a better understanding of how everything works together to create your app, then you have to jump in with both feet when it comes to learning the code included in Android frameworks.
While it may be confusing at first, you will start to get a better understanding of this code the more you use it in real-world situations.

Using Intents is a Vital Part of the Android App Development Process

One of the key components of the Android framework is intents. In short, an intent is a description used to dictate what operations are going to be performed. When used correctly, intents are able to link together abstract chunks of code and various other applications.
Generally, intents are used by Android app developers when they want to launch various activities within their program.
For instance, if you have a large app that acts as a gallery, you will need to provide users with the ability to share links of these images via SMS. You can do that a few different ways.
Request to send SMS permissions with this code:
<uses-permission android:name="android.permission.SEND_SMS" />
Create an SMS intent with this code:
Intent sendIntent = new Intent(Intent.ACTION_VIEW); sendIntent.setData(Uri.parse("sms:" + telephoneNumber)); sendIntent.putExtra("sms_body", x); startActivity(sendIntent);
If you are new to the world of Android app development, it is probably best for you to use the intent code. The best part about using this code is that it can be applied to a variety of different development tasks.

The Fear of Missing Out Can Create Big Problems

Most newcomers to the world of Android app development fail to realize just how expansive this market is. Trying to learn everything about the Android development process in a few months is impossible.
Many new developers have a fear that they are missing out on better development techniques and practices within the Android app world.
Rather than letting this fear of missing out lead to vast mistakes, you need to slow down and take time to learn the intricacies of each part of the development process.
Not only will this make you a better app developer, but it can also help you avoid mistakes in the beginning stages of your career.

Understanding Bitmaps is Important

One of the main things the most successful apps on the Android market have in common is plenty of user content. Having well-formatted images can draw users in and will make your app extremely popular. The only problem with putting lots of images in your app is that they take up a lot of memory.
An image has to be loaded into your app’s memory before it can be loaded by users. One of the most common methods used by developers to get images on their programs is by using bitmaps.
If you want to display an image that you took with your own camera, you will need to use the following formula:
memory_needed_in_bytes = 4 * image_width * image_height;
Among the most common bitmap configuration is ARGB_8888. This code basically provides 8 bits for each of the pixels in the picture you are uploading. While there are alternative bitmap configurations, they tend to leave the images looking pixelated or with a green tint to them.
When trying to display bitmaps efficiently, be sure to consider these tips:
  • Know the view you will be showing your images in.
  • Larger images will need to be scaled or cropped accordingly.
  • Only show images that are easily displayed within in your app.
By following these basic rules, you can keep the images within your app viewable and appealing for users. Having images that are too large for the frameworks within in your app will make them hard to see.

Create Start Methods

Are you going to be launching various activities within your app? If so, creating adequate start methods is important. By doing this, you can avoid repeating pieces of code. The more coding errors you have in your program, the more application performance management issues you will have.
When you are already using the same data for multiple activity launches, you should bundle it so it can be passed around a variety of different parameters. Here is just one of the ways you can accomplish this goal via code.
public static void start(Context context, Bundle bundle) {

Intent starter = new Intent(context, NextActivity.class);

starter.putExtra(AppConstants.BUNDLE, bundle);


As time goes by, you can learn these tricks of the app development trade. Utilizing the power of start methods will make your app run faster and more efficient. Often times, new developers ignore their coding mistakes until they cause major problems.
The best way to catch these issues is by going over each line of code you write with a fine-tooth comb. While this will take a great deal of time and effort, it will be worth it considering the problems it can help you prevent.

Learn Java Design Patterns

There will be times that you will get stuck on critical programming problems during the app development process. One of the best ways to get past these problems is by using various design patterns.
Generally, Java design patterns will allow you to build an adequate solution for your app development problems with ease.
If you are working with a team of developers, you will often hear them throw around terms like Facade or Decorator patterns.
Getting a better understanding of Java design patterns will help you avoid getting confused when these matters are discussed. Check out this link if you are looking for a crash course on design patterns and how they can be used.

Becoming a Great App Architect

Some developers make the mistake of dumping all of their code into the Activities or Fragments section of their Android framework. Generally, this leads to the code becoming unmanageable. Having all of your code in one big file will also make it difficult to both test and maintain it.
Rather than making this crucial mistake, you will need to learn how to properly layout your app’s architecture. Many developers use things like MVVM or Redux to help with the structuring of their code.
Generally, these tools will advise developers to separate the various parts of their app to make them easier to manage. This means that separating things like view and data interactions and your app’s business logic is essential.

Clean Coding Guidelines for Android

The key to having a successful and glitch-free app is developing it with clean code. Luckily, there are a variety of resources out there that can help you develop clean code.
The following are just some of the things you need to consider when trying to avoid coding issues during the app development process.

Basic Code Architecture

When trying to develop a great coding architecture, you need to keep the word testability in mind. Making sure that each line of code you write is in line with unit-tests is crucial. By developing lines of code that can be properly tested, you can make your program easier to read and maintain.
When trying to develop clean architecture principles, be sure to abide by the following rules:
  • Abide by the Single Responsibility Principle. This principle basically states that each class should have a single reason to change.
  • Your classes should be extendable, but not easy to modify from the outside.
  • Each layer of abstraction should allow you to replace implementations and parts.
  • Avoid putting logic into one big layer. Ideally, you want this part of your code to be spread out into a number of different interfaces.
  • Each class should depend on abstractions rather than implementations.
By structuring your code using these basic tenets, you can avoid disasters throughout the app development process.

The Why Behind Clean Code Structure

One of the biggest questions new developers have is why having clean code structure is so important? With clean code structure, you are able to write tests to find out how sound your code is.
If your code is all over the place, you will have to writes tests using large classes and dependencies. Not only is this extremely difficult, but it can also lead to insufficient testing of the code in question.

Be Realistic when Creating a New App

Most Android app developers start out with good intentions when building new programs. Often times, a new developer will overthink and over analyze their idea until it is a shell of its former self.
While you will need to change certain aspects of your app as the development process goes on, you need to keep the basic design and functionality principles you started out with.
Before pursuing a new idea for an app, you need to establish a need for this program in the market. Neglecting to do this research can lead to your new app failing, which is never a good thing.
Looking to see who your competition will be in this niche market and how well they are currently performing can help you decide whether or not an app idea is worth pursuing.

Being Consistent is the Key to App Development Success

Learning how to be consistent with both the quality of your app code and the functionality you offer is important. As time goes by, consumers will start to expect a certain degree of consistency from the companies they download apps from.
If you fail to deliver this consistency, it is only a matter of time before consumers move on to a competitor.
As you develop more apps, you will start to get a feel for the basic steps that need to be followed. Having a template in place for this process will not only help you, but it can also make your apps more consistent.
Before the app development process starts, you will need to work on ironing out all of the details regarding what the program will do and what goals you have. With this information, you can have a successful development process.
Communicating With Your Team
Are you working on a team with a number of different app developers? Properly communicating with these individuals can make or break this project.
Generally, you will need to meet with the other developers on the project to discuss what coding style is being used and to find out what jobs you are in charge of completing.
Some new developers make the mistake of being a lone wolf when working in a team of other app development professionals.
Doing this will usually lead to problems and may prohibit you from learning more about your chosen profession. Instead of alienating yourself from the group, you need to do all you can to learn from your team.
Rushing through the Android app development process is a recipe for disaster. Sacrificing the functionality of your app so you can be first to market is a bad idea that will usually generate less than stellar results.
The extra time you put into developing an app the right way will pay off in the long run.
Top 10 Most Common Mistakes That Android Developers Make

#1: Developing for iOS

To my great pleasure, this Android mistake is far less common nowadays (partially because clients are beginning to realize that the days when Apple was setting all the design standards are long gone). But still, every now and then, we see an app that is an iOS clone.

Don’t get me wrong, I’m not an Android programming evangelist! I respect every platform that moves the mobile world a step forward. But, it’s 2014 and users have been using Android for quite a while now, and they’ve grown accustomed to the platform. Pushing iOS design standards to them is a terrible strategy!

Unless there is a super good reason for breaking the guidelines, don’t do it. (Google does this all the time, but never by copy-pasting.)

Here are some of the most common examples of this Android mistake:

  1. You should not be making static tabs, and they don’t belong on the bottom (I’m pointing at you Instagram).
  2. System notification icons should not have color.
  3. App icons should not be placed inside a rounded rectangle (unless that’s your actual logo ex. facebook).
  4. Splash screens are redundant beyond the initial setup/introduction. Do not use them in other scenarios.
  5. Lists should not have carets.

These are just a few of the many other small things that can ruin the user experience.

 #2: Developing for Your Android Device

Unless you are building a kiosk/promo app for a single tablet, chances are your Android app won’t look good on every device. Here are a few Android programming tips to remember:

  • Density-independent pixels (dp) are different than normal pixels (px).
  • Resources are included multiple times to account for different densities and orientations.
  • 9-patch drawables are stretched to fit the screen.

There are literally thousands of possible scenarios, but after a while you develop a sense for covering them all with a handful of cases.

You don’t own thousands of devices? Not a problem. The Android Emulator is super good in replicating physical devices. Even better, try out Genymotion, it’s lightning fast and comes with a lot of different popular preset devices.

#3: Not Using Intents

Intents are one of Android’s key components. It’s a way of passing data between different parts of the app or, even better, different apps on the system.

Let’s say you have a gallery app that can share a download link to some images via SMS. Which of the two options seems more logical?

Option 1:
Request the SEND_SMS permission.

  •   <uses-permission android:name=”android.permission.SEND_SMS” />
  • Write your own code for sending SMS using the SmsManager.
  • Explain to your users why your gallery app needs access to services that can cost money, and why they have to grant this permission to use your app.

Option 2:

Start an SMS Intent and let an app designed for SMS do the work

  •   Intent sendIntent = new Intent(Intent.ACTION_VIEW);
  •   sendIntent.setData(Uri.parse(“sms:” + telephoneNumber));
  •   sendIntent.putExtra(“sms_body”, x);
  •   startActivity(sendIntent);

In case that you have any doubts, best solution is option 2!

This approach can be applied to almost anything. Sharing content, taking pictures, recording video, picking contacts, adding events, opening links with native apps, etc.

Unless there is a good reason to make a custom implementation (ex., a camera that applies filters), always use Intents for these scenarios. It will save you a lot of programming time, and strip the AndroidManifest.xml of unnecessary permissions.Also, have you tried rotating your device? All hell can break loose…

#4: Not Using Fragments

A while ago in Honeycomb, Android introduced the concept of fragments. Think of them as separate building blocks with their own (rather complex) life cycles that exist inside an Activity. They help a lot with optimizing for various screens, they are easily managed by their parent activity, can be reused, combined and positioned at will.

Launching a separate activity for each app screen is terribly inefficient, since the system will try to keep them in memory as long as it can. Killing one won’t free the resources used by the others.

Unless you want to dig deep into the Android core and read this article, advocating against fragment usage, you should use fragments whenever possible. It basically says that fragments and cursor loaders have good intended purpose, but poor implementation.

#5: Blocking the Main Thread

The main thread has a single purpose: keeping the user interface responsive.

Although the science behind measuring the frame rate our eyes/brain can perceive is complex and influenced by a lot of factors, a general rule is that anything below 24 fps with delay greater than 100 ms won’t be perceived as smooth.

This means that the user’s actions will have a delayed feedback, and the Android app you have programmed will stop responding. Stripping the user of his control over the app leads to frustration, frustrated users tend to give very negative feedback.

Even worse, if the main thread is blocked for a while (5 seconds for Activities, 10 for Broadcast Receivers), ANR will happen.

This was so common in Android 2.x, that on newer versions the system won’t let you make network calls in the main thread.

To avoid blocking the main thread, always use worker/background threads for: 1. network calls 2. bitmap loading 3. image processing 4. database querying 5. SD reading / writing

#6: Reinventing the Wheel

“OK, I won’t use the main thread. I’ll write my own code that communicates with my server in a background thread.”

No! Please don’t do that! Network calls, image loading, database access, JSON parsing, and social login are the most common things you do in your app. Not just yours, every app out there. There is a better way. Remember how Android has matured and grown as a platform? Here’s a quick list of examples:

  1. Use gradle as a build system.
  2. Use Retrofit / Volley for network calls.
  3. Use Picasso for image loading.
  4. Use Gson / Jackson for JSON parsing.
  5. Use common implementations for social login.

If you need something implemented, chances are it’s already written, tested and used widely. Do some basic research and read some Android programming tutorials before writing your own code!

#7: Not Assuming Success

Great. We have learned that there is a better way for handling long running tasks, and we are using well documented libraries for that purpose. But the user will still have to wait. It’s inevitable. Packages are not sent, processed and received instantly. There is a round trip delay, there are network failures, packages get lost, and dreams get destroyed.

But all this is measurable. Successful network calls are far more likely than unsuccessful ones. So why wait for server response before handling the successful request? It’s infinitely better to assume success and handle failure. So, when a user likes a post the like count is immediately increased, and in unlikely event that the call failed, the user is notified.

In this modern world immediate feedback is expected. People don’t like to wait. Kids don’t want to sit in a classroom obtaining knowledge that has uncertain future payoff. Apps must accommodate to the user’s psychology.

 #8: Not Understanding Bitmaps

Users love content! Especially when the content is well formatted and looks nice. Images, for instance, are extremely nice content, mainly due to their property of conveying a thousand words per image. They also consume a lot of memory. A lot of memory!

Before an image is displayed on the screen, it has to be loaded into the memory. Since bitmaps are the most common way to do this, we’re going to provide an Android programming guide for the whole process:

Let’s say you want to display an image on your screen that you just took with your camera. The total memory needed for this is calculated with the following formula: memory_needed_in_bytes = 4 * image_width * image_height;

Why 4? Well, the most common / recommended bitmap configuration is ARGB_8888. That means that for each pixel we draw, we need to keep 8 bits (1 byte) for the alpha, the red, the greed and the blue channel in memory, in order to properly display it. There are alternatives, like the RGB_565 configuration that requires half the memory than ARGB_8888, but loses the transparency and the color precision (while maybe adding a green tint).

Let’s assume you have a brand new device with full HD screen and 12 MP camera. The picture you just took is 4000×3000 pixels large and the total memory needed to display it is: 4 bytes * 4000 * 3000 = 48 MB

48 megabytes of your RAM just for a single image!? That’s a lot!

Now let’s take the screen resolution into consideration. You are trying to show a 4000×3000 image on a screen that has 1920×1080 pixels, in worst case scenario (displaying the image full screen) you shouldn’t allocate more than 4 * 1920 * 1080 = 8.3 MB of memory.

Always follow the Android programming tips for displaying bitmaps efficiently:

  1. Measure the view you’re showing your images in.
  2. Scale / crop the large image accordingly.
  3. Show only what can be displayed.

 #9: Using Deep View Hierarchy

Layouts have an XML presentation in Android. In order to draw content, the XML needs to be parsed, the screen needs to be measured, and all the elements need to be placed accordingly. It’s a resource- and time-consuming process that needs to be optimized.
This is how the ListView (and more recently the RecyclerView) works.
If a layout has been inflated once, the system reuses it. But still, inflating the layout must happen at some point.
Let’s say you want to make a 3×3 grid with images. One way of doing this is a vertical LinearLayout containing 3 LinearLayouts with equal weight, each of them containing 3 ImageViews with equal weight.
What do we get with this approach? A warning that “nested weights are bad for performance”.
There is a saying in the Android programming world, that I just made up: “With little effort all hierarchy can be flattened”.
In this case RelativeLayout or GridLayout will efficiently replace the nested LinearLayouts.

#10: Not Setting the minSdkVersion to 14

Well, this is not a mistake, but it is bad practice.
Android 2.x was a huge milestone in developing this platform, but some things should be left behind. Supporting older devices adds more complexity for code maintenance and limits the development process.
The numbers are clear, the users have moved on, the developers shouldn’t stay behind.
I’m aware that this doesn’t apply for some big markets with old devices (ex. India), and setting the minSdkVersion to 14, on the Facebook App, means leaving couple of million users without their favorite social network. But, if you are starting fresh and trying to create a beautiful experience for your users, do consider eliminating the past. Users that don’t have the resources, or feel the need to upgrade their device/OS, won’t have the incentive to try out a superior version of your Android app and ultimately spend money on it.

Wrap Up

Android is a powerful platform that evolves quickly. It may not be reasonable to expect users to keep up the pace, but it’s crucial for the Android developers to do so.
Knowing that Android is not just on our phones or tablets is even more important. It’s on our wrists, in our living rooms, in our kitchens, and in our automobiles. Getting the basics right is of utmost importance before we start expanding.
Thanks to Ivan Dimoski that took time to write this article on TOPTAL THE ANDROID DEVELOPERS FORUM

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button