Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Introduction to Android Development - GMS and HMS

Introduction to Android Development - GMS and HMS

Android Development Basics
Introduction to Android Studio
Starting Basic Application
Templates
Android Studio Features
Intro to GMS and overview
Intro to HMS
Why important
Impact on platform

N2Android

July 10, 2020
Tweet

More Decks by N2Android

Other Decks in Technology

Transcript

  1. Agenda • Android Development Basics • Introduction to Android Studio

    • Starting Basic Application ◦ Templates • Android Studio Features • Intro to GMS and overview • Intro to HMS ◦ Why important ◦ Impact on platform • Example Code • Questions
  2. Android Development Basics • Programming Language - Java / Kotlin,

    XML • IDE - Android Studio • Framework developed and maintained by Google ◦ Open source project ◦ Source.android.com • Android Developer Guide ◦ developer.android.com • Google Developer Guide ◦ developers.google.com
  3. Android Development - Kotlin • Google endorsed language • Interoperable

    with Java • Many features simplifying and reducing boilerplate code • Kotlin introduces the following features ◦ Null Safety ◦ Lambda Expressions and inline Functions ◦ Extension Functions ◦ Coroutines ◦ Smart Casts ◦ To name a few
  4. Android Studio Introduction • Android studio official IDE for android

    development - 5 to 6 years • Before Android Studio - Eclipse ◦ Horrible ◦ Very un-user friendly • Android studio only free IDE from JetBrains with all the features ◦ Ongoing development and support ◦ Latest Stable Version 4.0 • Android Studio is your 1 stop shop for Android Development
  5. Android Development - Templates • What are they? ◦ Kickstarters

    with already defined ▪ Skeleton ▪ Android Basic Building Blocks ready to go ▪ Architecture • MVVM on most of them ▪ Unit Test Base ▪ Gradle Build system already setup and configured • Just press play!
  6. Android Studio - App Popular Templates • Basic Activity •

    Bottom Nav • Navigation Drawer • Tabbed Activity • Master/Detail Flow • Map Activity
  7. Android Studio - App Less Used Templates • Native C++

    ◦ Build C libraries to integrate into Android Apps • Empty Activity ◦ Clean activity with no predefined structure, navigations or actions • Google AdMob Ads Activity ◦ Add basic activity for hosting Google Ads
  8. Android Studio - Other Supported Templates • Android Wear ◦

    Smart watches • Android TV • Android Automotive ◦ Car interfaces using Android • Android Things ◦ Embedded operating system apps for smaller devices running Android
  9. Android Studio - Features • Instant App Run • Visual

    Layout Editor ( XML) • Fast Emulator • Intelligence Code Editor • Add on App Template Creation • Builds to all Android Devices • Firebase setup integration • Performance Analysis • Source Control Management • Many More!
  10. Google Mobile Services (GMS) • GMS services consists of many

    of the features we enjoy on our Android devices ◦ Google Play Store - Access to Android applications ◦ GMail - Most people have a gmail account linked to their device ◦ Chrome - Google Search ◦ Google Maps ▪ Location searches ▪ Listed information about locations ◦ Youtube ◦ Google Cloud hosted services ▪ Cloud capabilities for developers to use in applications ◦ android.com/gms
  11. GMS - What it provides for Android Frequently referred to

    as the heart of Android and its applications Provides multiple capabilities for applications to leverage on and provide functionalities Allows distribution of developed applications via Play Store
  12. Worldwide Smartphone User Statistics • In 2020 there are 3.8

    Billion Smartphone users worldwide ◦ Roughly 70 % of those users are on Android ◦ 21 % of users are using iOS ◦ Rest other operating systems • Majority Share Device Manufacturers ◦ Apple ◦ Samsung ◦ Huawei
  13. Trade Sanctions by the US • In 2018 the US

    started pushing aggressive trade sanctions against China • Forcing American owned companies like Google to start cutting off ties with Chinese companies like Huawei ◦ Initially sparking the idea of Huawei developing their own OS ◦ In time it became clear that the Android Open Source Project would still be used ▪ Without GMS ▪ Forcing Huawei to expand their long running/neglected AppGallery (HMS) ecosystem
  14. Android without GMS? • User Features lost ◦ Google Playstore

    ▪ No method of application distribution ◦ Google Search ◦ Youtube ◦ Google Drive • Developer Capabilities lost ◦ Location services ◦ Firebase ◦ Google developed cloud services • The list goes on
  15. Android OS considerations • Uniform experience across multiple devices from

    different manufacturers - Diverging further ◦ Beyond the UI changes already made ▪ Samsung ▪ Huawei ▪ Xiaomi MUI UI ▪ One Plus ◦ How far will the modifications to Android stretch with this new trend
  16. HMS - What does this mean for developers? • Develop

    Android apps supporting both ecosystems (HMS and GMS) • Trade-offs supporting both from dev point of view ◦ Builds ◦ Versioning ◦ Code bases • Older Huawei devices with GMS and HMS ◦ Apps listed on both stores ▪ Same package name? ▪ Versioning the app? ▪ Conflicts between two stores? • Difficulty porting GMS only apps to support HMS? • If simple ◦ Others like Samsung also diverge? ▪ Something like SMS?
  17. HMS - What does this mean for Android users? •

    Can no longer use Google provided backups • Other ex. Samsung - Samsung ID • Huawei ID ◦ GMS apps backed up and restored on HMS ecosystem ▪ How do apps behave? • Android standard experience diverging further among platforms ◦ Beyond UI changes • Integration into a new ecosystem not linked to Google history... ◦ Many users are well integrated into some google services if not all
  18. Huawei Mobile Services (HMS) • Huawei provides ◦ User Features

    ▪ AppGallery (Replacing Google PlayStore) ▪ Video (Replacing Youtube) ▪ Browser (...) ◦ Developer Features ▪ Location Services ▪ PushKit ▪ DriveKit ◦ Many more cloud services
  19. Android Development 101 • Understand ◦ Platform Architecture ◦ Android

    Studio ◦ Basic Components / Building Blocks ◦ Android Build System - Gradle ◦ Android Lifecycle ◦ Android JetPack ◦ Bonjour le monde!
  20. Android Studio - IDE • One stop shop for Android

    development • Free usage • Works on all OS ◦ Windows ◦ Mac ◦ Linux • Provides all the tools required to develop Android Applications ◦ Coding ◦ Building ◦ Debugging ◦ Analysing Performance
  21. Android App Components • Activities ◦ Entry Point to interaction

    with user ◦ View System integrates to Activities and Fragments • Services ◦ Entry Point for keeping app and processes running in the background • Broadcast Receivers ◦ Allows app to respond to system wide broadcasts • Content Providers ◦ Manages a shared set of data stored ▪ In the file system ▪ In an SQLite database ▪ On the web
  22. Android App Other Components • Android Manifest ◦ Declares App

    requirements ▪ Filters • Intent Filters ▪ Permissions • However user must accept the permissions when required • Resources ◦ Text displayed ◦ Colour codes ◦ Images • Intents and Intent Filters • And many more
  23. Android Build System - Gradle • App.gradle • Defines supported

    SDK versions ◦ SDK 19 - KitKat ◦ SDK 21 - Lollipop ◦ SDK R - Latests un-named build ◦ Etc • Libraries used by the app ◦ Definitions and configurations ◦ Version management ▪ Ex. Android X lib version ◦ Support libraries - deprecated with X ◦ External API based libraries
  24. Android Lifecycle • Lifecycle provides ◦ A way to react

    to user and OS events ◦ Ex. user kills the app ▪ Maybe we need to stop a service ◦ User pauses the app ▪ User backgrounding the app ▪ Maybe we must store data
  25. Android JetPack - Android X Libs • Suite of libraries

    and tools ◦ Accelerates Development ◦ Eliminates boilerplate code ◦ Allows building high quality and robust apps • Components ◦ Foundational ▪ Cross cutting functionality - Ex. Backwards compatibility ◦ Architecture ▪ Helps design robust, testable and mainable apps ◦ Behaviour ▪ Allows integration of Android services - Ex. Permissions and Notifications ◦ UI ▪ Provides widgets - to allow ease of development and delightful experiences