Skip to content

Instantly share code, notes, and snippets.

@lyqht
Created July 14, 2019 16:28
Show Gist options
  • Save lyqht/53a9096fab8bc2856aa6892a2ad02944 to your computer and use it in GitHub Desktop.
Save lyqht/53a9096fab8bc2856aa6892a2ad02944 to your computer and use it in GitHub Desktop.

A very brief intro to Android vs iOS

tags: Mobile Development

Notes based on: https://www.linkedin.com/learning/learning-ios-for-android-developers/welcome?u=2062740

Please note that the programming language section will not be covered in detail, as the language only matters if you are developing specifically for that platform.

If you find the notes to be too brief and want to learn more indepth on each topic, be sure to checkout the Android Developer Site & iOS developer site!

Android

Activity Life Cycle

The event loop is initialized when the app moves to the foreground.

  • onCreate: initialize resources and create the UI.
  • onPauseand/or onDestroy: save changes to data before your app moves from the foreground to the background or your app process is destroyed.

Android Services

There are two types of Android Services.

  1. Started services: merely set off on their assigned task until finished.
  2. Bound services: provides a handle for other components to interact with and receive notifications

Android Broadcast Receivers

Broadcast Receivers can be declared either in the Android Manifest or the Context.

  • For those declared in the AndroidManifest.xml, the receiver will still be registered even when the app is closed.
  • For those declared in the Context object, the receiver will be registered as long as the Context is still in scope.

These receivers will be on listening mode and when they receive an appropriate broadcast, they will call the onReceive method to cause a change in the app that they are designated for.

For the resources of each app such as images, videos and contacts, they are provided via the Content Provider. Outside apps cannot access the app's resources directly and have to request content from the Content Provider of the app. There also exist the System Content Providers which can provide an app's data to outside apps.

Programming

Java code is compiled into ByteCodes (*.class) that can be interpreted by the Java Virtual Machine (Android Runtime) and can be run by the Android OS Hardware.

iOS

Activity Life Cycle

  • willFinishLaunchingWithOptions: the initiation of UI and resources
  • applicationWillResignActive: Save data before app moves to the background
  • applicationWillTerminate: This method is different from Android and may not be called. Hence it is not recommended to do any cleanup / saving of state here. Cleanup must happen earlier in the life cycle.

Programming

Swift is compiled into Binary Code that can run on OS devices.

Comparison Tables

Life Cycle

Development Tools

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment