<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Jon Markoff on Medium]]></title>
        <description><![CDATA[Stories by Jon Markoff on Medium]]></description>
        <link>https://medium.com/@jmarkoff?source=rss-c02259e9778b------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*bNJPdBNz0JoFZneklC4Xqw.jpeg</url>
            <title>Stories by Jon Markoff on Medium</title>
            <link>https://medium.com/@jmarkoff?source=rss-c02259e9778b------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 20 Nov 2026 21:29:05 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@jmarkoff/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[How Mobile Apps are Helping With Workplace Safety]]></title>
            <link>https://medium.com/androiddevelopers/how-mobile-apps-are-helping-with-workplace-safety-a46959587c7d?source=rss-c02259e9778b------2</link>
            <guid isPermaLink="false">https://medium.com/p/a46959587c7d</guid>
            <category><![CDATA[ux]]></category>
            <category><![CDATA[android-development]]></category>
            <category><![CDATA[material-design]]></category>
            <category><![CDATA[covid19]]></category>
            <category><![CDATA[onboarding]]></category>
            <dc:creator><![CDATA[Jon Markoff]]></dc:creator>
            <pubDate>Tue, 13 Apr 2021 16:03:07 GMT</pubDate>
            <atom:updated>2021-04-13T22:44:42.027Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xFRt8zwX8khIYTBdTiJNlg.png" /><figcaption>Illustration by <a href="https://twitter.com/VPoltrack">Virginia Poltrack</a></figcaption></figure><h3><strong>Build Better Workplace Safety Apps</strong></h3><p><em>With Avani Agarwal, Todd Burner, Paul Ruiz, and Sean Ginevan</em></p><p>In the early months of the COVID-19 pandemic, developers faced new requests for building applications and functionality to help enterprises manage safety within their workplace. As many jurisdictions begin to loosen restrictions on the types of workplaces that can remain open, we wanted to highlight challenges you may face as a developer and show you how to overcome them. Examples of tools for keeping workers safer with Android can include screening surveys, notifications, and contact tracing tools for the workplace.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*HUworlFRWI_0ZoHD" /><figcaption>ProtectWell for UnitedHealth Group employee attestation screening user flow</figcaption></figure><p>Developers face a new challenge of navigating a complex set of guidance on how to potentially keep an app running for long periods of time in a safe and privacy preserving environment. When adding COVID functionality to workplace apps it’s essential to preserve these elements of privacy and device interaction.</p><h3>User Onboarding</h3><p>Let’s start with the basics. No matter what your return to work experience entails, empathy and safety must be a part of your design and implementation. Recognize that, for many employees, the return to the workplace will seem different, unfamiliar, perhaps even uncomfortable. For example: depending on your solution, you may need to have your app running in the foreground as a persistent notification. This could look scary to some users who do not understand why you want this new app running all the time. In your onboarding UX flows, you should disclose all <a href="https://developer.android.com/training/permissions/requesting#principles">permissions</a> required individually, before asking the user to accept; including the user actions that can be taken, including:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*7ZPjz5gblkuE_yX7" /><figcaption>PwC uses clear messaging to inform employees about Automatic Contact Tracing</figcaption></figure><ul><li>Location. Your app may need to use <a href="https://support.google.com/googleplay/android-developer/answer/9799150?hl=en">location services in the background,</a> for example, to run contact tracing functions or to set <a href="https://developers.google.com/location-context/geofencing">geofence</a> to ensure that your app is only functional while at work.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*yDgbLVZ3WXvwg-Fq" /><figcaption>PwC allows admins to create geofences in a web UI that establishes tracing parameters</figcaption></figure><ul><li>Bluetooth. This can be used to keep track of devices that have come near or in contact with each other. Bluetooth requires the <a href="https://developer.android.com/guide/topics/connectivity/bluetooth#Permissions">location permission</a>.</li><li>Notifications (FCM), to wake up the device and let the users know of any pertinent information.</li><li>Persistent foreground notifications are useful for demonstrating that a service is being kept alive and letting the user know what is happening.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/320/1*9-ulZA75dRK7uLYKTbGteA.png" /><figcaption>ProtectWell notifications</figcaption></figure><ul><li>Application scope: If your application will be handling sensitive workflows like contact tracing or proof of vaccination, you should make it clear to users the scope of how long you will require access to sensitive information like health data or employee interactions.</li></ul><p>In designing your return to work workflows, remember to apply Hick’s Law — the simple concept that the more choices that are presented to a user, the longer it will take them to reach a decision. This may seem like common sense, but the rush to quickly complete an app with as much functionality as possible can negate this rule.</p><h3>Handling notifications for your app</h3><p>Notifications have their pitfalls and it is recommended that you tread lightly without inundating the user. Here is some user feedback and lessons learned around daily reminder notifications:</p><p><em>“We built ProtectWell to be used daily to keep our users and everyone around them symptom and exposure free. Since ProtectWell is used mostly by organizations with employees and students, we received feedback that users did not like the daily reminders during weekends, holidays and vacations. We do say that ‘COVID doesn’t take the weekends’ off so we always encourage our users to check in everyday regardless if they are headed to work or school. However this was great feedback and helped us understand how our product was being used and what we needed to do to keep iterating on our designs.”</em> — Ishraf Ahmad, Director of Product and Design | ProtectWell</p><p>It is important to limit the number of times a user receives alerts and keep the language clear and ensure any required actions super directed — even allowing for resolution with the notification itself. Giving users the choice for when and how to receive “daily reminders” creates more agency.</p><p>For tracing applications, providing indications when an app is running tracing functions also creates agency.</p><p><em>“Almost all of the users were concerned about how their data was being collected from their employers, and if it was kept private or shared externally. But they expressed willingness to participate in order to help safeguard the workplace. They wanted to clearly understand when the app ‘starts’ and ‘stops’,”</em> said Lauren Mills, Associate Product Manager from PwC.</p><p>Notifications can help address this concern by providing more contextual information to an employee about when tracing is happening, especially when its functionality is bound by a geofence. In addition to bounding functionality based on location, developers might consider allowing users to automate when the app can run, for instance turning on at 8am and off by 6pm, in order to mitigate the number of notifications from the app.</p><p>Using the <a href="https://firebase.google.com/docs/cloud-messaging/android/client">Firebase Cloud Messaging SDK</a> is the fastest way to notify your employees of changes to work policies. First go to the Firebase Console and setup FCM, then simply import FCM into your <a href="https://firebase.google.com/docs/cloud-messaging/android/client#add_firebase_sdks_to_your_app">build.gradle</a>. From there you can notify users of your app directly through the Firebase console and from the <a href="https://firebase.google.com/docs/cloud-messaging/server">server side</a> component using one of the many client SDKs. If you want to automate messaging, or segment your users you can use additional FCM functionality.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*FCNEqHlWO_X_ITRX" /><figcaption>ProtectWell for UnitedHealth Group designs for reminders</figcaption></figure><h3>Enabling tracing workflows for your app</h3><p>While Exposure Notifications are a valuable framework to help employees understand their risk of exposure, sometimes you need more granular tracing data. This is particularly true in facilities or areas where social distancing may be more difficult. Based on publicly available information, we’ve seen this accomplished through three separate approaches:</p><ol><li>Measurement of employee interactions with Bluetooth beaconing infrastructure using fixed and badge-based beacons. This allows a company to survey employee movement and density across a corporate building or campus, as well as potentially record where infected individuals have been.</li><li>Commercial deployment of person-to-person based tracing technologies. These technologies are designed to survey employee interactions through measurement of Bluetooth and Wi-Fi signals.</li><li>Internally developed person-to-person based tracing technologies. This approach is based on open source frameworks, such as Herald, BlueTrace, or PACT.</li></ol><p>If you need to take the approach of developing your own tools, the <a href="https://developers.google.com/nearby/connections/overview">Nearby Connections API</a> can be used to talk to other local devices in a peer-to-peer fashion. This could work as follows: each app would advertise itself as an endpoint, while simultaneously discovering other devices. This is important because all devices need to be accessible to each other. Paying attention to the connection lifecycle is important here to keep track of the amount of time devices are near each other. This could be used to kick off a warning to let users know they’ve been around each other too long or to let people in a conference room know if they’re at a safe capacity.</p><p>Remember that use of functions like Nearby require the use of background location and many users may not pick the right permissions. Lauren Mills from PwC pointed out that, in their experience, “Multiple users had confusion around requiring background location permissions and were hesitant to give the app permissions ‘all of the time’. Even with the copy on the location permissions screen, many chose the wrong option (allow while in use), only to be guided to correct it later from our status screen.”</p><p>In designing your application, you’ll want to check to <a href="https://developer.android.com/training/permissions/requesting#already-granted">understand</a> if your users have granted the right permissions at runtime. If your app finds that a permission check fails, be sure to provide easy-to-understand guidance on how to resolve the issue.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*oq6xQEiXuSlLNFN5" /><figcaption>PwC provides clear guidance to users on what to do if a permission check fails</figcaption></figure><h3>Sensitive Data Protection</h3><p>If you’re building an app that persists or accesses sensitive health information requiring user interaction, you may want to look at our <a href="https://developer.android.com/training/sign-in/biometric-auth">Biometrics APIs</a> to ensure that the user on the device is the user you are expecting. Sometimes you will need to verify that the user on a device is who you’re expecting. If your app requires personally identifiable information (PII), such as health data for your users, then we would recommend checking out our Biometrics APIs for ensuring user presence.</p><p>All data that is sensitive PII, as well as health information, should be encrypted using <a href="https://developer.android.com/topic/security/data">EncryptedSharedPreferences</a>, which is part of the <a href="https://developer.android.com/jetpack/androidx/releases/security">Jetpack Security suite</a>.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/3f8d1484a674c9110c5cbffef7bb6e67/href">https://medium.com/media/3f8d1484a674c9110c5cbffef7bb6e67/href</a></iframe><h3>Battery life considerations</h3><p>Because enterprise tracing apps cannot persist in the background, developers will have to take on several optimization considerations. Power management and battery optimization best practices need to be well understood, such as <a href="https://developer.android.com/topic/performance/power/power-details">power management restrictions </a>that are in place to improve battery life of devices. In some cases, battery optimizations need to be turned off or tweaked in order to handle frequent checks with <a href="https://developer.android.com/guide/background">background services</a>. Developers should also understand and test how their application will function if placed in <a href="https://developer.android.com/training/monitoring-device-state/doze-standby">doze</a> and leverage frameworks like <a href="https://developer.android.com/guide/components/foreground-services">foreground services</a> and <a href="https://developer.android.com/topic/libraries/architecture/workmanager">WorkManager</a> to keep the app functioning as long as required by your use case. Applications can also be woken up remotely if a connection is lost due to power management using <a href="https://firebase.google.com/docs/cloud-messaging/concept-options#setting-the-priority-of-a-message">High Priority messages</a>. Foreground Services have <a href="https://developer.android.com/about/versions/12/foreground-services">additional restrictions in Android 12</a>, please be aware of them to ensure that your service will start running as expected.</p><h3>Deployment</h3><p>For enterprises publishing within their own organization, you should expect to publish apps to respond to COVID-19 using <a href="https://support.google.com/googleplay/work/answer/6138458?hl=en">managed Google Play</a> wherever possible. This will ensure that general consumers do not confuse apps from your organization with others designed to help combat the pandemic. Doing so will allow you to also easily remove these applications from employees’ devices in the event they are no longer required.</p><p>If your app requires publishing to the broader Google Play Store, you’ll need to ensure you are compliant with Google Play’s <a href="https://support.google.com/googleplay/android-developer/answer/9889712?hl=en">COVID-19 apps policies</a>. Depending on your use cases, this may require coordination between your organization and relevant public health authorities to receive proof of authorization in order to publish to the Play Store.</p><p>Organizations should ensure that only authorized users within an enterprise can access your app.. One way to accomplish this is through the use of OpenID’s AppAuth <a href="https://github.com/openid/AppAuth-Android">enterprise authentication</a> library, which provides examples and sample code to authenticate native apps with <a href="https://developer.chrome.com/docs/android/custom-tabs/overview/">Chrome Custom Tabs</a>.</p><p>There are many options to protect your workplace by guiding employees to be safer through the use of technology. Android has the ability to provide these tools, whether it be through the use of the Bluetooth stack, employee ID cards, and/or geofencing APIs. Happy Coding!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a46959587c7d" width="1" height="1" alt=""><hr><p><a href="https://medium.com/androiddevelopers/how-mobile-apps-are-helping-with-workplace-safety-a46959587c7d">How Mobile Apps are Helping With Workplace Safety</a> was originally published in <a href="https://medium.com/androiddevelopers">Android Developers</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Data Encryption on Android with Jetpack Security]]></title>
            <link>https://medium.com/androiddevelopers/data-encryption-on-android-with-jetpack-security-e4cb0b2d2a9?source=rss-c02259e9778b------2</link>
            <guid isPermaLink="false">https://medium.com/p/e4cb0b2d2a9</guid>
            <category><![CDATA[encryption]]></category>
            <category><![CDATA[security]]></category>
            <category><![CDATA[app-development]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[development]]></category>
            <dc:creator><![CDATA[Jon Markoff]]></dc:creator>
            <pubDate>Tue, 25 Feb 2020 23:01:01 GMT</pubDate>
            <atom:updated>2024-06-18T21:20:53.013Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*WefQBkBtLer3zIo6" /><figcaption>Illustration by <a href="https://twitter.com/VPoltrack">Virginia Poltrack</a></figcaption></figure><h3><strong>Data encryption on Android with Jetpack Security</strong></h3><p><strong>Update: June 17, 2024 — </strong>The <a href="https://developer.android.com/privacy-and-security/cryptography#jetpack_security_crypto_library"><strong>Jetpack Security crypto library has been deprecated</strong></a>. This means that it is no longer being actively developed or supported by Google. As a result, it is recommended that you migrate to a different library for your encryption needs.</p><p>There are a number of alternative libraries available, such as:</p><ul><li><strong>Android KeyStore:</strong> This is the built-in key store on Android devices. It provides a secure way to store encryption keys.</li></ul><p>If you are using the Jetpack Security crypto library, it is recommended that you migrate to one of these alternative libraries as soon as possible.</p><h4><strong>Update: April 21st, 2021:</strong></h4><p>Jetpack Security is now <a href="https://developer.android.com/jetpack/androidx/releases/security#1.0.0">stable 1.0.0</a>!</p><h4><strong>Update: December 2nd, 2021:</strong></h4><p>Jetpack Security <a href="https://developer.android.com/jetpack/androidx/releases/security#security-crypto-1.1.0-alpha03\">1.1.0–Alpha-03</a> released, adding support for API level 21+ which includes a redesigned MasterKey implementation.</p><p>Have you ever tried to encrypt data in your app? As a developer, you want to keep data safe, and in the hands of the party intended to use. But if you’re like most Android developers, you don’t have a dedicated security team to help encrypt your app’s data properly. By searching the web to learn how to encrypt data, you might get answers that are several years out of date and provide incorrect examples.</p><p>The <a href="https://developer.android.com/topic/security/data.md">Jetpack Security</a> (JetSec) crypto library provides abstractions for encrypting Files and SharedPreferences objects. The library promotes the use of the <a href="https://developer.android.com/training/articles/keystore">AndroidKeyStore</a> while using safe and well-known <a href="https://github.com/google/tink/blob/master/docs/PRIMITIVES.md">cryptographic primitives</a>. Using EncryptedFile and EncryptedSharedPreferences allows you to locally protect files that may contain sensitive data, API keys, OAuth tokens, and other types of secrets.</p><p>Why would you want to encrypt data in your app? Doesn’t Android, since 5.0, <a href="https://source.android.com/security/encryption">encrypt the contents of the user’s data partition</a> by default? It certainly does, but there are some use cases where you may want an extra level of protection. If your app uses <a href="https://developer.android.com/training/data-storage/shared">shared storage</a>, you should encrypt the data. In the app home directory, your app should encrypt data if your app handles sensitive information including but not limited to personally identifiable information (PII), health records, financial details, or enterprise data. When possible, we recommend that you tie this information to biometrics for an extra level of protection.</p><p>Jetpack Security is based on <a href="https://github.com/google/tink">Tink</a>, an open-source, cross-platform security project from Google. Tink might be appropriate if you need general encryption, hybrid encryption, or something similar. Jetpack Security data structures are fully compatible with Tink.</p><h3>Key Generation</h3><p>Before we jump into encrypting your data, it’s important to understand how your encryption keys will be kept safe. Jetpack Security uses a <em>master key</em>, which encrypts all subkeys that are used for each cryptographic operation. JetSec provides a recommended default master key in the MasterKeys class. This class uses a basic AES256-GCM key which is generated and stored in the AndroidKeyStore. The AndroidKeyStore is a container which stores cryptographic keys in the TEE or StrongBox, making them hard to extract. Subkeys are stored in a configurable SharedPreferences object.</p><p>Primarily, we use the AES256_GCM_SPEC specification in Jetpack Security, which is recommended for general use cases. AES256-GCM is symmetric and generally fast on modern devices.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/f7a0726a9eee26239a749c0c671d51c8/href">https://medium.com/media/f7a0726a9eee26239a749c0c671d51c8/href</a></iframe><p>For apps that require more configuration, or handle very sensitive data, it’s recommended to build your KeyGenParameterSpec, choosing options that make sense for your use. Time-bound keys with <a href="https://developer.android.com/jetpack/androidx/releases/biometric">BiometricPrompt</a> can provide an extra level of protection against rooted or compromised devices.</p><p>Important options:</p><ul><li>userAuthenticationRequired() and userAuthenticationValiditySeconds() can be used to create a time-bound key. Time-bound keys require authorization using BiometricPrompt for both encryption and decryption of symmetric keys.</li><li>unlockedDeviceRequired() sets a flag that helps ensure key access cannot happen if the device is not unlocked. This flag is available on Android Pie and higher.</li><li>Use setIsStrongBoxBacked(), to run crypto operations on a stronger separate chip. This has a slight performance impact, but is more secure. It’s available on some devices that run Android Pie or higher.</li></ul><p><strong>Note:</strong> If your app needs to encrypt data in the background, you should not use time-bound keys or require that the device is unlocked, as you will not be able to accomplish this without a user present.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/1f8e66462a1d507b491748d6a052cd42/href">https://medium.com/media/1f8e66462a1d507b491748d6a052cd42/href</a></iframe><h3>Unlocking time-bound keys</h3><p>You must use BiometricPrompt to authorize the device if your key was created with the following options:</p><ul><li>userAuthenticationRequired is true</li><li>userAuthenticationValiditySeconds &gt; 0</li></ul><p>After the user authenticates, the keys are unlocked for the amount of time set in the validity seconds field. The AndroidKeystore does not have an API to query key settings, so your app must keep track of these settings. You should build your BiometricPrompt instance in the onCreate() method of the activity where you present the dialog to the user.</p><p>BiometricPrompt code to unlock time-bound keys</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/0f8cf0309b388c0dccc23d06b41f409f/href">https://medium.com/media/0f8cf0309b388c0dccc23d06b41f409f/href</a></iframe><h3>Encrypt Files</h3><p>Jetpack Security includes an EncryptedFile class, which removes the challenges of encrypting file data. Similar to File, EncryptedFile provides a FileInputStream object for reading and a FileOutputStream object for writing. Files are encrypted using <a href="https://github.com/google/tink/blob/master/docs/PRIMITIVES.md#streaming-authenticated-encryption-with-associated-data">Streaming AEAD, which follows the OAE2 definition</a>. The data is divided into chunks and encrypted using AES256-GCM in such a way that it’s not possible to reorder.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/be38474642c633bfb1b1340651dc1275/href">https://medium.com/media/be38474642c633bfb1b1340651dc1275/href</a></iframe><h3>Encrypt SharedPreferences</h3><p>If your application needs to save Key-value pairs — such as API keys — JetSec provides the EncryptedSharedPreferences class, which uses the same SharedPreferences interface that you’re used to.</p><p>Both keys and values are encrypted. Keys are encrypted using <a href="https://tools.ietf.org/html/rfc5297">AES256-SIV-CMAC</a>, which provides a deterministic cipher text; values are encrypted with AES256-GCM and are bound to the encrypted key. This scheme allows the key data to be encrypted safely, while still allowing lookups.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/0677b3c0cd4412f97f532ffc11101eca/href">https://medium.com/media/0677b3c0cd4412f97f532ffc11101eca/href</a></iframe><h3>More Resources</h3><p><a href="https://github.com/android/security-samples/tree/master/FileLocker">FileLocker</a> is a sample app on the Android Security GitHub samples page. It’s a great example of how to use File encryption using Jetpack Security.</p><p>For the latest developments, please check back here. For questions, feel free to reach out to me (<a href="https://twitter.com/jonmarkoff">@jonmarkoff</a>) on Twitter.</p><p>Happy encrypting!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e4cb0b2d2a9" width="1" height="1" alt=""><hr><p><a href="https://medium.com/androiddevelopers/data-encryption-on-android-with-jetpack-security-e4cb0b2d2a9">Data Encryption on Android with Jetpack Security</a> was originally published in <a href="https://medium.com/androiddevelopers">Android Developers</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Publishing private apps just got easier]]></title>
            <link>https://medium.com/androiddevelopers/publishing-private-apps-just-got-easier-40399c424b8a?source=rss-c02259e9778b------2</link>
            <guid isPermaLink="false">https://medium.com/p/40399c424b8a</guid>
            <category><![CDATA[continuous-integration]]></category>
            <category><![CDATA[app-development]]></category>
            <category><![CDATA[fastlane]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[enterprise]]></category>
            <dc:creator><![CDATA[Jon Markoff]]></dc:creator>
            <pubDate>Mon, 03 Dec 2018 18:01:49 GMT</pubDate>
            <atom:updated>2018-12-03T18:01:49.814Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pMcEGyuowOHWqtbwVs74-g.png" /><figcaption>Illustration by <a href="https://twitter.com/VPoltrack">Virginia Poltrack</a></figcaption></figure><p>Whether your organization has 5 apps or 100, there are tools available to help automate the process of managing all of the Play Store listings. <a href="https://developers.google.com/android-publisher/">Google Play</a> has a developer API which enables management of Play store listings, APKs, and more. In January 2017 Google acquired the developer tool suite <a href="http://fabric.io/blog/fabric-joins-google/">Fabric</a> from Twitter, as part of this acquisition was <a href="https://fastlane.tools/"><em>fastlane</em></a>, a suite of app automation tools. <em>fastlane</em> can automate screenshots, manage beta deployments, and sign/push apps to the Play store.</p><p>Additionally, the <a href="https://developers.google.com/android/work/play/custom-app-api/get-started">Custom App Publishing API</a> enables Managed Google Play users to create private hosted apps without a <a href="https://developer.android.com/distribute/best-practices/develop/target-sdk">minimum version check</a>. <a href="https://support.google.com/googleplay/work/answer/6137711?hl=en">Managed Google Play</a> is a marketplace for Android Enterprise that adds support for private apps. <a href="https://support.google.com/a/answer/2494992?hl=en">Private apps</a> are Android apps that are distributed only to internal users and not publicly available. Private app deployments are available within minutes of creation. A <em>fastlane</em> <a href="https://github.com/fastlane/fastlane/pull/13421">pull request</a>, built by <a href="https://github.com/janpio">Jan Piotrowski</a>, a core contributor was built to allow for a code-free method of deployment. History on the feature request is in this github issue <a href="https://github.com/fastlane/fastlane/issues/13122">here</a>. For more background on Managed Google Play and Google Play Protect, please see this <a href="https://www.blog.google/products/android-enterprise/safely-and-quickly-distribute-private-enterprise-apps-google-play/">blog post</a>.</p><p><strong>Why this is important:</strong> The Custom App Publishing API or <em>fastlane</em> greatly simplifies and reduces the friction of migrating to Managed Google Play and integrates into continuous integration tools and processes.</p><h3>Setup</h3><p><strong>Important: </strong>Make sure to use the following best practices for <a href="https://developer.android.com/studio/publish/app-signing">app signing</a> when creating debug and production keystores. Do not lose your production keystore! Once it has been used with an application id on Google Play (including private apps), you cannot change the keystore without creating a new application listing and modifying the application id.</p><p><strong>Recommended:</strong> Utilize <a href="https://developer.android.com/studio/publish/app-signing#google-play-app-signing">Google Play App Signing</a> to sign your APKs. This is a safe option to make sure that your keystore will not be lost. Please see the implementation details <a href="https://support.google.com/googleplay/android-developer/answer/7384423?hl=en">here</a>.</p><p><strong>Important:</strong> All apps (including private apps) on Google Play must have a unique application id and cannot be reused.</p><p>When publishing private apps, there are 3 steps you need to take before this is available.</p><p>Please follow the <a href="https://developers.google.com/android/work/play/custom-app-api/get-started">Setup Instructions</a> which will guide you through the following steps:</p><ol><li>Enable the Google Play Custom App Publishing API in the Cloud API Console</li><li>Create a service account, download a new private key in JSON format.</li><li>Enable Private Apps, instructions to follow.</li></ol><h3>fastlane setup</h3><ul><li>Please see this <a href="https://docs.fastlane.tools/getting-started/android/setup/">doc</a> to install <em>fastlane. </em>Managed google play support is included with fastlane.</li></ul><h3>Enable Private Apps — Get the Developer Account Id</h3><p>This <a href="https://developers.google.com/android/work/play/custom-app-api/get-started">guide</a> shows the steps to create private apps which requires creating an OAuth callback to receive the developerAccount id. There are two methods for enabling private apps: using fastlane or using the API. Here’s how to use each and their level of difficulty:</p><h4>Use fastlane — Easy</h4><pre>&gt; fastlane run get_managed_play_store_publishing_rights</pre><p><strong>Example Output:</strong></p><pre>[13:20:46]: To obtain publishing rights for custom apps on Managed Play Store, open the following URL and log in:</pre><pre>[13:20:46]: <a href="https://play.google.com/apps/publish/delegatePrivateApp?service_account=SERVICE-ACCOUNT-EMAIL.iam.gserviceaccount.com&amp;continueUrl=https://fastlane.github.io/managed_google_play-callback/callback.html">https://play.google.com/apps/publish/delegatePrivateApp?service_account=<strong><em>SERVICE-ACCOUNT-EMAIL</em></strong>.iam.gserviceaccount.com&amp;continueUrl=https://fastlane.github.io/managed_google_play-callback/callback.html</a></pre><pre>[13:20:46]: ([Cmd/Ctrl] + [Left click] lets you open this URL in many consoles/terminals/shells)</pre><pre>[13:20:46]: After successful login you will be redirected to a page which outputs some information that is required for usage of the `create_app_on_managed_play_store` action.</pre><p>Pasting the link into a web browser and authenticating with your account owner of the managed play account will send forward</p><h4>Use the API — Moderate</h4><p><strong>If</strong> you don’t plan to build a web user interface for managing your apps, you can use this basic node script below and launch with Firebase functions to quickly and easily get the developerAccountId. If you don’t care, you can set the continueUrl to <a href="https://foo.bar/">https://foo.bar</a> (or another fake url) to get the developerAccountId although this is not recommended for security purposes.</p><p><strong>Cloud Functions for Firebase setup</strong></p><p>This <a href="https://firebase.google.com/docs/functions/get-started">guide</a> shows how to set up cloud functions. The following code can be used for the endpoint.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/55be650ae2f78ee01100d0fb186c7c31/href">https://medium.com/media/55be650ae2f78ee01100d0fb186c7c31/href</a></iframe><h3>Create Private App Listing</h3><h4>Use fastlane — Easy</h4><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/84a2fdeca08505aaa9b23f37a20d08ab/href">https://medium.com/media/84a2fdeca08505aaa9b23f37a20d08ab/href</a></iframe><pre>&gt; fastlane create_private_app</pre><h4>Use the API — Moderate</h4><p>API <a href="https://developers.google.com/android/work/play/custom-app-api/publish">documentation</a>. Client libraries are available in <a href="https://developers.google.com/api-client-library/java/apis/playcustomapp/v1">Java</a>, <a href="https://developers.google.com/api-client-library/python/apis/playcustomapp/v1">Python</a>, <a href="https://developers.google.com/api-client-library/dotnet/apis/playcustomapp/v1">C#</a>, and <a href="https://developers.google.com/api-client-library/ruby/apis/playcustomapp/v1">Ruby</a>.</p><h4>API Example</h4><p>Written in Ruby, this sample code authenticates with a <a href="https://developers.google.com/android/work/play/custom-app-api/get-started#create_a_service_account">Google service account</a> json keyfile and then calls the Play Custom App Service to create and upload the first version of a private APK. This code is only used for the first time an app is created, and subsequent updates should use the upload apk functionality in the Play Publishing API.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/5af2942fe3a13f6ceb6be90e98656c15/href">https://medium.com/media/5af2942fe3a13f6ceb6be90e98656c15/href</a></iframe><h3>Updating Private Apps</h3><p>Once a private app has been created, the <a href="https://developers.google.com/android-publisher/">Google Play Publishing API</a> can push new APKs after the initial creation of the Play store listing. <em>fastlane</em> supports this feature to upload new APKs to Play, and more info can be found <a href="https://docs.fastlane.tools/getting-started/android/release-deployment/">here</a>.</p><h3>Deployment to users</h3><p>Managed Google Play requires an EMM (Enterprise Mobility Management) system to distribute apps to users. More information <a href="https://support.google.com/googleplay/work/answer/6145139?hl=en">here</a>.</p><p>It has never been easier to deploy and manage your private enterprise apps. Both methods of deploying apps through Managed Google Play are viable, it all comes down to you your CI system and if you want to write any code. Give <a href="https://fastlane.tools/">fastlane</a> a shot, and it should save you tons of time.</p><p>If you run into any issues, bugs can be filed against fastlane on <a href="https://github.com/fastlane/fastlane/issues">github</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=40399c424b8a" width="1" height="1" alt=""><hr><p><a href="https://medium.com/androiddevelopers/publishing-private-apps-just-got-easier-40399c424b8a">Publishing private apps just got easier</a> was originally published in <a href="https://medium.com/androiddevelopers">Android Developers</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>