This document provides an overview of key differences between iOS and Android development for iOS developers looking to learn Android development. It summarizes UI paradigms like the action bar and overflow menu in Android. It also covers differences in project structure, activities versus view controllers, fragments, data storage options, layouts, and publishing apps to Google Play Store which has lower fees than the Apple App Store.
20. Simulator
I used to think the iOS simulator was painful, now I
realise it's pretty awesome.
Skip the Android simulator all together and deploy to
a real device, or be prepared to spend a lot of time
waiting.
Consider to use Genymotion, a fastest Android
emulator for app testing and presentation.
22. Project Structure
The source code is structured via the Java package
hierarchy, and it can be structured as you please.
However, a common practice is to use top-level
categories for activities, fragments, views, adapters,
and data (models and managers).
24. Project Structure
The res folder is a collection of images, XML layout
files, and XML value files that make up the bulk of the
non-code assets.
25. Project Structure
Android uses Layouts which are xml. They are
completely independent from each other. Android
Studio also has a nice WYSIWYG editor
26. Project Structure
On iOS, images are either @2x or not, but on Android
there are a number of screen density folders to
consider.
29. Project Structure
This file is the equivalent of the Project-Info.plist file on
iOS, and it stores information for activities, application
names, and set Intents (system-level events) that the
application can handle.
30. Activities
Activities are the basic visual unit of an Android app,
just as UIViewControllers are the basic visual
component on iOS.
31. Activities
Instead of a UINavigationController, the Android OS
keeps an activity stack that it manages.
36. Fragments
Also note that fragments do not have their own
contexts and they rely heavily on activities for their
connection to the application’s state.
37. Fragments
Tablets are a great fragment use case example: you
can place a list fragment on the left and a detail
fragment on the right.
39. List Views and Adapters
ListViews are the closest approximation to
UITableView on Android, and they are one of the most
common components that you will use.
40. List Views and Adapters
Like UITableView has a helper view controller,
UITableViewController, ListView also has a helper
activity, ListActivity, and a helper fragment,
ListFragment.
41. List Views and Adapters
On Android we don’t have datasources and
delegates for ListView.
42. List Views and Adapters
We have adapters. Adapters come in many forms, but
their primary goal is similar to a datasource and table
view delegate all in one.
43. List Views and Adapters
Adapters take data and adapt it to populate a
ListView by instantiating views the ListView will
display
44. AsyncTasks
In place of Grand Central Dispatch on iOS, on
Android we have access to AsyncTasks.
46. Layout
The primary structure that you will deal with will be
subclasses of ViewGroup – RelativeLayout,
LinearLayout, and FrameLayout are the most
common.