<?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 Ramit Pahwa on Medium]]></title>
        <description><![CDATA[Stories by Ramit Pahwa on Medium]]></description>
        <link>https://medium.com/@ramitpahwa?source=rss-21947fd5ac08------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*GZUWE0KVFC1jlNulNSh1Uw.jpeg</url>
            <title>Stories by Ramit Pahwa on Medium</title>
            <link>https://medium.com/@ramitpahwa?source=rss-21947fd5ac08------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 15 Nov 2026 09:12:23 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@ramitpahwa/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[Making your Android Application Enterprise-Ready...]]></title>
            <link>https://proandroiddev.com/making-your-android-application-enterprise-ready-20bfea6f3209?source=rss-21947fd5ac08------2</link>
            <guid isPermaLink="false">https://medium.com/p/20bfea6f3209</guid>
            <category><![CDATA[android]]></category>
            <category><![CDATA[android-enterprise]]></category>
            <category><![CDATA[android-for-work]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[work]]></category>
            <dc:creator><![CDATA[Ramit Pahwa]]></dc:creator>
            <pubDate>Mon, 02 Aug 2021 15:19:35 GMT</pubDate>
            <atom:updated>2021-08-02T15:19:35.327Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*31YJg59TI-ziIbtvFEk48w.png" /><figcaption>Android For Work / Android Enterprise Source: brio. co. in</figcaption></figure><h3>Introduction</h3><p>With ever-growing mobile usage and with the recent advent of work from home scenarios, many enterprises are in the market for secure applications which can allow their employees to have access to sensitive data and prevent data leaks. Therefore, mobile applications which can securely enable the usage of sensitive data are the need of the hour in the enterprise ecosystem.</p><p>Mobile apps drive employee productivity and IT must move beyond static app distribution to meet security, management, and productivity. Enterprise Mobility Management (referred to as EMM ) allows enterprises to enroll their employees in either a Bring-Your-Own-Device (BYOD) or Company-Owned-Personally-Enabled (COPE) device programs.</p><p>EMM addresses the challenges associated with mobile security by providing a simplified, efficient way to view and manage all devices from the central admin console. It allows enterprise IT administrators to prevent data leakage and remotely configure the application on these devices as per the company’s enterprise policy. Employees benefit from instant mobile productivity and a seamless out-of-the-box experience, and enterprises benefit from secure work-ready apps with minimal setup.</p><p>Android Mobile Applications has moved to a single application model which supports both personal and work environments from within the same application in a seamless and secure manner, thus enabling productivity. We showcase Android Application in both personal and Work mode (Notice the briefcase icon at the bottom right of the application icon)<a href="https://www.miradore.com/blog/separate-work-time-from-free-time-with-android-work-profile/">[1]</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9PFC-1P3jLyudAWC_oy06Q.png" /></figure><h3>Setting up work profile</h3><p>Different EMM vendors have a different workflow to help you create a work profile, or one can be provided to you by your organization.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fimgur.com%2Fa%2FxREabNp%2Fembed%3Fpub%3Dtrue%26ref%3Dhttps%253A%252F%252Fembed.ly%26w%3D500&amp;display_name=Imgur&amp;url=https%3A%2F%2Fimgur.com%2Fa%2FxREabNp&amp;image=https%3A%2F%2Fi.imgur.com%2FZWArUWl.gif%3Fnoredirect&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=imgur" width="500" height="502" frameborder="0" scrolling="no"><a href="https://medium.com/media/0f0dfa9db0d41f97cfef15db871ceea8/href">https://medium.com/media/0f0dfa9db0d41f97cfef15db871ceea8/href</a></iframe><p>Here I will demonstrate the process to create a work profile using the TestDPC <a href="https://github.com/googlesamples/android-testdpc">[2] </a>application which can be used to simulate the Work Profile and Restrictions which can be applied to a work-managed android application. The creation, once you have downloaded the APK from the link, is straightforward. Once this provision is complete now you will see personal and work applications (for that application that supports Work Mode)separately on your device.</p><blockquote>Note : You can access both personal and work profiles from setting application</blockquote><h3>Work mode in Action</h3><p>I will be using the enterprise sample application to demonstrate how the enterprise version of the application can behave in work mode. This basically gives the IT admin of the organization to control features of the application they want to restrict.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fimgur.com%2F0HUK5nz%2Fembed%3Fpub%3Dtrue%26ref%3Dhttps%253A%252F%252Fembed.ly%26w%3D500&amp;display_name=Imgur&amp;url=https%3A%2F%2Fimgur.com%2F0HUK5nz&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=imgur" width="500" height="636" frameborder="0" scrolling="no"><a href="https://medium.com/media/af51342f8ba60769453f9b359c9cb14a/href">https://medium.com/media/af51342f8ba60769453f9b359c9cb14a/href</a></iframe><p>The application demonstrates how we can restrict the say hello button in a managed application.</p><p>The IT Administrator for the organization can specify the restrictions for the application and those functionalities will then be restricted for all the users of the application.</p><p>This allows companies to have a single application with these restrictions in place instead of the different distribution of APK and allows the organization to deploy according to their restrictions, implementation of this is explained in detail below.</p><h3>Checking if the Application is Work Application?</h3><p>Android provides us with <strong>DevicePolicyManager</strong> class, which lists down admin available for the device which can then be used to get the package name. The <strong>isProfileOwnerApp()</strong> or <strong>isDeviceOwnerApp()</strong> API helps us identify whether the application in question is managed or other the entire device is managed.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/8ce937164e627bee34444a8dc523d174/href">https://medium.com/media/8ce937164e627bee34444a8dc523d174/href</a></iframe><p>The restriction to be imposed are added as an XML wherein the default values for these restrictions are specified. The different types of restrictions which can be imposed are enumerated in the XML below, here I will be showcasing how one of the listed restrictions can be used to control application behavior.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/8a908292f69590403d566129c1319d96/href">https://medium.com/media/8a908292f69590403d566129c1319d96/href</a></iframe><p>These restrictions can be stored in <strong>SharedPreference</strong> so that they can be accessed across application sessions. We have the <strong>RestrictionsManage</strong>r class which can be used to get all<strong> getManifestRestrictions()</strong> which returns a list of restrictions. We then store the preference for the restrictions to be utilized to check the availability of a particular feature i.e. if the feature is allowed by the IT admin for your organization.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/8793115fa4486049cfb411a8780ccd98/href">https://medium.com/media/8793115fa4486049cfb411a8780ccd98/href</a></iframe><h3>Finally …</h3><p>The above code can be used to control the feature inside the work application, thus providing the additional functionality for the organization to restrict some features while allowing others in the work-managed application. We need to create a broadcast receiver for <strong>ACTION_APPLICATION_RESTRICTIONS_CHANGED</strong> which sends out a broadcast when restrictions change.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/1e8f6471c9f0d68dd3fc269cf43daee7/href">https://medium.com/media/1e8f6471c9f0d68dd3fc269cf43daee7/href</a></iframe><p>The <strong>canUpdateSayHello()</strong> will use these restrictions to determine if the button needs to be disabled or not.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/1941187185e5a86ad6d8861618418d10/href">https://medium.com/media/1941187185e5a86ad6d8861618418d10/href</a></iframe><p>I hope the above article can help you understand some of the basics of managed apps and give you insights on how you can implement Restrictions for your Application, and make it enterprise-ready.</p><h3>Useful Links</h3><p>[1]<a href="https://developers.google.com/android/work/overview">https://developers.google.com/android/work/overview</a></p><p>[2]<a href="https://github.com/googlesamples/android-testdpc">https://github.com/googlesamples/android-testdpc</a></p><p>[3] <a href="https://github.com/android/enterprise-samples">https://github.com/android/enterprise-samples</a></p><p>[4] <a href="https://www.miradore.com/blog/separate-work-time-from-free-time-with-android-work-profile/">https://www.miradore.com/blog/separate-work-time-from-free-time-with-android-work-profile/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=20bfea6f3209" width="1" height="1" alt=""><hr><p><a href="https://proandroiddev.com/making-your-android-application-enterprise-ready-20bfea6f3209">Making your Android Application Enterprise-Ready...</a> was originally published in <a href="https://proandroiddev.com/">ProAndroidDev</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>