How to Start Android Development With an iOS Background
In your experience as a developer, you may have only developed iOS apps.
This isn’t that uncommon.
One of the reasons why all of your previous clients may have been building iOS apps is because it’s 30% more expensive to build Android apps.
Based on what I just mentioned, you might even be able to charge them more money for this service.
Outside of the monetary benefits, this is great news for your career as a developer. Learning how to develop Android apps gives you the opportunity to learn a new skill.
The ability to develop Android apps will add credibility to your resume. Ultimately, it will make you more marketable as well. You’ll be able to land more clients in the future.
But developing an Android app may seem overwhelming if you’ve never done it before. Obviously, you don’t want to mess anything up, but it could also be a challenge for you to learn.
I’m here to tell you that there’s no reason for you to worry.
Android development isn’t really that much more difficult, it’s just different.
I’ve built apps for both the Apple App Store as well as the Google Play Store. There are actually lots of similarities between the two platforms that you may not realize.
While you may be comfortable developing iOS apps, you can’t hide from the fact that Android dominates the global market share.
So you knew that this day would be coming eventually. Now that it’s finally here, I want to make sure you’re fully prepared.
Here’s what you need to know about Android development.
Similarities between iOS and Android development
Apple and Android development have more in common than you might think.
So it’s not like you need to start completely from scratch here. Your background as an iOS developer will actually make it much easier for you to learn about building Android apps.
Android gets written in Java, which is an OOP (object oriented programming) language. It’s also the official language of Android, and it’s supported by the Android Studio.
If you’ve been using Objective-C and Swift as your programming languages for iOS development, these languages are also OOP, so you’re already familiar with this concept.
The difference between these languages is that there are different names for the programming terms.
So in iOS, you’ve been familiar with terms like:
- overriding methods
These same concepts apply to Android, but Java uses words like:
Your Android development will also encompass the same design patterns. You’ll get to use factory methods and singletons for this.
However, you’ll be using the Java Object as opposed to NSObject.
Differences between Xcode and Android Studio
Once you start working in Android Studio, you may even realize that it has some additional features that you wish were available in Xcode.
Android Studio is better for autocomplete and searching in terms of both speed and performance.
Furthermore, Android Studio reduces boilerplate code for certain subclasses such as the ones with import statements and new method generation. It’s also better for fixing compiler errors.
For the most part, you’ll realize that both Android Studio and Xcode will give you the same support system as you develop your app.
There are also several small differences between these two integrated development environments. For example, the UI code is written differently and it’s also presented differently.
Android studio has singular XML files while Xcode uses nibs and storyboards. Compared to the iOS simulator, the Android emulator is much slower for debugging.
In terms of coding, Android development is going to require more code to get written for your app. It’s just the nature of using Java.
So if you were building two identical apps for both iOS and Android, the Android coding would definitely take you longer to write.
One of the benefits of Android Studio is the background compilation that’s built into the system. This allows you to identify any issues faster than you would in Xcode.
Take a look at how both of these IDEs are trending over the last year in terms of global web search.
As you can see, Android Studio has a higher interest than Xcode.
Based on this data, we can speculate and assume that more developers are using Android Studio to develop apps.
This makes sense since we already discussed how the Android platform as a whole dominates the market share across the world.
How long have you been an iOS developer?
For those of you who have been around for a while, you remember the good old days where you only had to worry about one screen size.
But as Apple rolled out new devices, developers had to adapt. On the other hand, Android always had more devices, so developers were used to handling different screen sizes.
Since this has always been something that Android developers needed to think about, the software you’ll be using the develop is superior for accommodating multiple screen sizes.
It’s going to be much quicker and easier for you to create auto layout constraints for your Android app compared to iOS development.
Learning the syntax will be a little bit difficult for you at first. But the more you spend time working, the easier it will become. So don’t worry, you’ll be able to do it.
Semantics and syntax differences between Android and iOS
As I just said, there will definitely be a learning curve when it comes to the syntax of Android development. I wanted to dedicate an entire section to explain some key differences in both the syntax and semantics.
Here’s what you need to know.
When it comes to multiple resolution screen support, you’re used to using asset catalogs in iOS development.
But with Android, you’re going to use the res folder. This will help you with XML layout files as well as value files and images. These will all be organized based on the structure of devices with different screen resolutions.
If you’re using Objective-C the iOS messages that get passed to nil objects are called no-ops. Swift allows you to use optional chaining for this.
This is going to be different for Android development.
Now you’re going to have to use Null to check objects. If you don’t, then all of the methods on Null are going to crash.
View Class Component
Developing iOS apps means you’ve used UIViews and UIViewControllers. Both of these have the ability to get created from anywhere.
Regardless of where they get created, they can still be presented on any superview.
You’ll use Fragments and Activities to create a dynamic UI for Android apps.
UI Layout Files
Let’s continue discussing UI.
Usually, the iOS development consists of singular storyboard files. However, these could be broken up into several storyboard files as well as nib files.
But with Android, there’s going to be a separate XML layout file for each unique UI.
Here’s what iOS uses for lists:
But Android uses:
So you’ll notice some differences here for sure.
Project Configuration File
Apple projects require info.plist files to configure your app. These determine which document types your app will support as well as the icon that gets displayed for a bundle.
You can do some configuration with the build.gradle files for your Android development. But your primary configuration will be AndroidManifest.XML files.
Your app is required to have this as the root before any code can be run.
Swift uses native properties. Here’s what the shorthand setter declaration looks like.
With Objective-C you’ve been using properties that are auto synthesized.
You’re going to need setFoo and getFoo methods to do this when building your Android apps.
Apple developers use SAViewController as class prefixes in Objective-C and Modules for Swift.
Anytime you’re coding private instance variables they need to start with the letter “m” such “mFoo.”
Auto Layout is the default support system for iOS. It has customized implementation with OS rotation methods while maintaining state.
Android offers multiple options for your orientation changes as opposed to just one default support option.
You can use these to rebuild or destroy activities for a new orientation. There are also new layouts available based on qualifier values.
These values were taken directly from the Android developer page, so it’s a great reference.
Xcode has a workspace, which is a document that keeps projects in groups so that you can work on them together. You can also store any other files or documents in the workspace for your iOS app.
Android Studio has several modules that bundle code and other resources together for a single project.
- Background Service
These are all different types of their work queue processors.
The iOS primitives are:
You’ll notice some similarities here with Android:
Android uses the Integer class as an object to wrap values of the primitive type int.
Resuming Killed Apps
Unless you’re using the state restoration principles, your iOS app will start from scratch and relaunch the app.
The Android process is a little bit different. It maintains a stack of the activities. This allows the app to restore with loadState and saveState methods.
Loosely Coupled Callbacks
Delegation is used for iOS development. This is a pattern where one object from a program acts in coordination with another object.
The delegated object keeps the other object, known as the delegate, as a reference and sends it a message when appropriate.
This message informs the delegate about an event that was just handled.
Android uses Adaptors, which is a bridge between the AdapterView and data from the view.
UITextView is used to display lots of text. It also has an option that allows for user interaction with iOS apps.
With UILabel you can’t directly edit text. You’ll need to use UITextField to edit small amounts of text as an Apple developer.
Android uses EditText and TextView to edit displayed text.
Apple development requires Carthage, Cocoapods, or Package Manager.
Gradle is the standard choice for Android. However, you can also decide to use Ant or Maven instead.
A few other notes about Android Development
You’ll need to figure out where you want to set your minimum SDK for Android devices.
If you’ve been building iOS apps, this question isn’t necessarily new to you, but the circumstances are different.
Here’s what I mean. There are still lots of old Android operating systems in use. You want to make sure that your app is compatible with as many devices and operating systems as possible.
To help you determine your minimum SDK, click on “help me choose” in Android Studio.
You’ll see data about the platform and API version distribution if you use this tool.
Once your app gets built, you’re going to need to find to find beta testers to see how it performs and help you work out any bugs or glitches.
Again, this isn’t new, as I’m sure you’ve done this your iOS apps.
However, it’s much easier to get your app approved by the Google Play Store than the Apple App Store.
So you can release your app and wait to get feedback from actual users as opposed to beta testers. But this strategy could backfire if your app doesn’t perform well.
You don’t want negative ratings and reviews to discourage users from downloading your app.
That’s why I recommend taking advantage of the beta testing through the Google Play Console. Now you can get direct feedback without getting poor ratings and you won’t have to go through a third party.
Developing an Android app isn’t harder, it’s just different than what you’re used to if you have an iOS background.
But like I said before, you need to embrace this new opportunity.
It’s going to make you more marketable as a developer and you can make more money building Android apps as well.
As you can see from this guide, there are actually lots of similarities between iOS and Android development.
The biggest differences have to do with the terms and programming language.
Once you get used to working in Android Studio you may even wish that Xcode had some of those features the next time you build an iOS app.
Just make sure you take your time and learn everything now. As time passes, developing Android apps will get easier.
What’s the biggest challenge you’re facing building an Android app as a developer with an iOS background?