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

Darko Grozdanovski - THE POWER OF EMM

Darko Grozdanovski - THE POWER OF EMM

droidcon Berlin

July 16, 2018
Tweet

More Decks by droidcon Berlin

Other Decks in Programming

Transcript

  1. On the agenda today: • What is an EMM? •

    What is AppConfig? • Code an app with Managed Configuration • Overview of the deployment workflow • Create a managed configuration
  2. What is an EMM? The infrastructure that enables organizations to

    run their enterprise apps, manage and secure the corporate data
  3. Modern enterprise deployment • Always deploy using EMM and Google

    Play • Distribute using Managed Configurations
  4. What is AppConfig? • The community’s mission is to streamline

    the adoption and deployment of mobile enterprise applications by providing a standard approach to app configuration and management, building upon the extensive app security and configuration frameworks available in the OS. https://appconfig.org
  5. Benefits for Developers • EMM vendor neutral solution • Reduce

    need for proprietary SDK • Reduce need for App Wrapping
  6. Benefits for Enterprises • Leverage existing EMM investments • Better

    native onboarding user experience • Greater selection of business apps
  7. Members of AppConfig - Apps • A huge ecosystem of

    apps that are part of the community • New ones are constantly added • In-house apps can also use it
  8. When you DON‘T NEED to write code • Lock down

    a device into kiosk • Create an app VPN • Single Sign On with existing identity management providers • Disable screen capture • Disable copy/paste • Restrict input methods • Whitelist/Blacklist specific system apps
  9. AppConfig - Managed Configuration • Create and manage application configurations

    directly the EMM admin console • A set of native Android API‘s enabling a deeper integration with an EMM system • Empowers the IT admin and eases app deployments
  10. Any combination of key value pairs that an app needs

    including dynamic user/device related properties
  11. Custom device or user attributes • Forward attributes from an

    Identity provider such as Active Directory • Manually define attributes and their values
  12. Common configuration options • Username – typically full email address

    or just company domain for easier sign in • Server/Resource endpoint configurations • Crash reporting on/off • Device analytics on/off • On-device data retention policies • Prefered apps to interact with (for sending emails, opening PDF, viewing images)
  13. Limitations and drawbacks • Testing the integration • Only works

    in Android Enterprise deployments • Requires Android 5.0 and up • Some API methods are available starting from Android 5.1 and 6.0 • Only primitive values can be delivered – No files/images etc…
  14. How to get around some of these limitations • Provide

    reasonable defaults in case a managed configuration cannot be used • Know your audience – Ask the organization about the devices they are using, specifically their OS version • Host complex configurations/files/photos that the app needs and point to those with an identifier through configuration – Ex. https://mycdn.com/mobileiron/logo.png - where „mobileiron“ is the identifier to the resources for the specific organization.
  15. Add XML file with app restrictions <?xml version="1.0" encoding="utf-8"?> <restrictions

    xmlns:android="http://schemas.android.com/apk/res/android" > <restriction android:key="string" android:title="string resource" android:restrictionType=["bool" | "string" | "integer" | "choice" | "multi-select" | "hidden" | "bundle" | "bundle_array"] android :description="string resource" android :entries="string-array resource" android :entryValues="string-array resource" android :defaultValue="reference" > <restriction …/> ... </restriction> <restriction …/> ... </restrictions> src/main/res/xml/app_restrictions.xml
  16. Field Type – Bundle Array API Level 23 – Android

    6.0 • Contains a subset of restrictions • Contains a bundle • Can dynamically add more items in the array from the Admin UI <restriction android:description="@string/description_bookmarks" android:title="@string/title_bookmarks" android:key="bookmark_list" android:restrictionType="bundle_array"> <restriction android:title="@string/title_bookmark" android:key="bookmark" android:restrictionType="bundle"> <restriction android:title="@string/title_bookmark_key" android:key="bookmark_name" android:restrictionType="string"/> <restriction android:title="@string/title_bookmark_value" android:key="bookmark_value" android:restrictionType="string"/> </restriction> </restriction>
  17. Read Configured values private fun stringValueInASingleMethod(key: String = "serverUrl"): String

    { val restrictionsManager = context.getSystemService(Context.RESTRICTIONS_SERVICE) as RestrictionsManager val entry = restrictionsManager.getManifestRestrictions(context.packageName).first { key == it.key } val applicationRestrictions = restrictionsManager.applicationRestrictions return if (applicationRestrictions.containsKey(key)) { applicationRestrictions.getString(key) } else { entry.selectedString } }
  18. Register change receiver • It’s a broadcast receiver which needs

    to be registered in code • Delivers a notification when the restriction values are updated • Typical use is for kiosk apps, apps for task workers etc..
  19. Register change receiver private var broadcastReceiver: BroadcastReceiver? = null public

    override fun onStart() { super.onStart() broadcastReceiver = object : BroadcastReceiver() { override fun onReceive(context: Context, intent: Intent) { // Fetch and use new values } } this.registerReceiver(broadcastReceiver, IntentFilter(Intent.ACTION_APPLICATION_RESTRICTIONS_CHANGED)) } public override fun onStop() { super.onStop() if (broadcastReceiver != null) { this.unregisterReceiver(broadcastReceiver) broadcastReceiver = null } }
  20. Check if device is under management Check for an empty

    bundle. This means your application acts like it’s unmanaged. There is no configuration being delivered. The app is NOT managed by an EMM system, it has been installed by other means. fun isDeviceManaged(): Boolean = !restrictionsManager.applicationRestrictions.isEmpty
  21. Check if device is configured properly Check for a bundle

    with a single key value pair with KEY_RESTRICTIONS_PENDING set to true. This means your application is being managed, but isn’t configured correctly. You should block this user from your app, and direct them to their IT administrator. API Level 22 – Android 5.1
  22. Enable Android Enterprise in EMM • Use any Google Account

    (preferably create one that will only be used by the organization)
  23. Enable Android Enterprise in EMM • This ID will be

    used by the developers inside google play later on
  24. Suggestion – enroll into work profile for testing • Can

    test the interaction between work and private partitions of the device • Can more easily enable USB debugging and view logs • Easier to remove after done, no need to factory reset device
  25. Release the app on Google Play • Release process on

    google Play is exactly the same as any normal app • Turn on Managed Google Play inside Pricing and Distribution to target organizations
  26. Release the app on Google Play • App can be

    released privately only to specific organizations. It wont be visible on the public Google Play store in this case
  27. Release the app on Google Play • Distribute the app

    to multiple organizations by adding their Google Enterprise ID to the list within Google Play
  28. Create a managed configuration • Enter all the details and

    save the config • After saving the configuration will be published to the devices • It will be available immediately for any new app installations