Skip to content

Commit 0aded59

Browse files
committed
erikre-oob2208-15363982 1.4
1 parent ba8c682 commit 0aded59

6 files changed

Lines changed: 237 additions & 236 deletions

File tree

memdocs/intune/developer/app-sdk-android-appendix.md

Lines changed: 35 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
# required metadata
33

4-
title: Microsoft Intune App SDK for Android developer integration and testing guide
4+
title: Microsoft Intune App SDK for Android developer integration and testing guide, appendix
55
description: The Microsoft Intune App SDK for Android lets you incorporate Intune mobile app management (MAM) into your Android app.
66
keywords: SDK
77
author: Erikre
@@ -30,12 +30,15 @@ ms.collection:
3030
ms.custom: intune-classic
3131
---
3232

33+
3334
# Microsoft Intune App SDK for Android developer guide
35+
> [!NOTE]
36+
> This guide is broken into several distinct stages. Start at [Stage 1: Planning the Integration].
3437
3538
The Microsoft Intune App SDK for Android lets you incorporate Intune app protection policies (also known as **APP** or MAM policies) into your native Java/Kotlin Android app. An Intune-managed application is one that is integrated with the Intune App SDK. Intune administrators can easily deploy app protection policies to your Intune-managed app when Intune actively manages the app.
3639

3740
## Stage Goals
38-
The guide contains greater detail about the Intune App SDK's architecture, information about uncommon integration steps, and other helpful content.
41+
The Appendix contains greater detail about the Intune App SDK's architecture, information about uncommon integration steps, and other helpful content.
3942

4043
## The SDK in Greater Detail
4144

@@ -44,7 +47,7 @@ Through the [build tooling], the Intune App SDK attempts to minimize the integra
4447
Prior to the build tooling, developers needed to perform all replacements manually.
4548

4649
> [!NOTE]
47-
> Apps *must- now integrate with the SDK [build tooling], which will perform all of these replacements automatically (except for [manifest replacements]).
50+
> Apps *must* now integrate with the SDK [build tooling], which will perform all of these replacements automatically (except for [manifest replacements]).
4851
4952
Android base classes are replaced with their respective MAM equivalents in order to enable Intune management.
5053
The SDK classes live between the Android base class and the app's own derived version of that class.
@@ -70,7 +73,7 @@ The table below lists many of the MAM replacements.
7073
| android.app.ListActivity | MAMListActivity |
7174
| android.app.ListFragment | MAMListFragment |
7275
| android.app.NativeActivity | MAMNativeActivity |
73-
| android.app.PendingIntent | MAMPendingIntent (see [Pending Intent]:#pendingintent) |
76+
| android.app.PendingIntent | MAMPendingIntent |
7477
| android.app.Service | MAMService |
7578
| android.app.TabActivity | MAMTabActivity |
7679
| android.app.TaskStackBuilder | MAMTaskStackBuilder |
@@ -110,7 +113,7 @@ For example, when deriving from [MAMActivity], instead of overriding `onCreate()
110113
The Java compiler should enforce the final restrictions to prevent accidental override of the original method instead of the MAM equivalent.
111114

112115
### Wrapped System Services
113-
For some system service classes, it's necessary to call a static
116+
For some system service classes, it is necessary to call a static
114117
method on a MAM wrapper class instead of directly invoking the desired
115118
method on the service instance.
116119
For example, a call to
@@ -135,13 +138,13 @@ Again, the required build plugin automatically makes these replacements.
135138
| android.app.blob.BlobStoreManager | MAMBlobStoreManager |
136139
| android.app.blob.BlobStoreManager.Session | MAMBlobStoreManager.Session |
137140

138-
Some classes have most of their methods wrapped, for example, `ClipboardManager`, `ContentProviderClient`, `ContentResolver`,
139-
and `PackageManager` while other classes have only one or two methods wrapped, for example, `DownloadManager`, `PrintManager`, `PrintHelper`,
141+
Some classes have most of their methods wrapped, e.g. `ClipboardManager`, `ContentProviderClient`, `ContentResolver`,
142+
and `PackageManager` while other classes have only one or two methods wrapped, e.g. `DownloadManager`, `PrintManager`, `PrintHelper`,
140143
`View`, `DragEvent`, `NotificationManager` and `NotificationManagerCompat`.
141144

142145
### Manifest Replacements
143-
It may be necessary to perform some of the above class replacements in the manifest and in Java code. Of special note:
144-
- Manifest references to `android.support.v4.content.FileProvider` must be replaced with `com.microsoft.intune.mam.client.support.v4.content.MAMFileProvider`.
146+
It may be necessary to perform some of the above class replacements in the manifest as well as in Java code. Of special note:
147+
* Manifest references to `android.support.v4.content.FileProvider` must be replaced with `com.microsoft.intune.mam.client.support.v4.content.MAMFileProvider`.
145148

146149
### MDM and MAM Enrollment
147150
As discussed in [Stage 4's Registration vs Enrollment], the Intune App SDK will "enroll" accounts that your app registers so that account is protected with policy.
@@ -153,7 +156,7 @@ MDM enrollment is entirely separate from App Protection Policy enrollment.
153156
An SDK-integrated app can have an account enrolled for App Protection Policy without that account being enrolled for Device Management.
154157
Likewise, a user can have enrolled a device for Device Management without having any SDK-integrated apps with accounts enrolled for App Protection Policy.
155158

156-
Typically, when developers and administrators refer to enrollment, they're referring to MDM enrollment, as App Protection Policy enrollment is largely invisible to both developers and end users.
159+
Typically, when developers and administrators refer to enrollment, they are referring to MDM enrollment, as App Protection Policy enrollment is largely invisible to both developers and end users.
157160
See [Enroll Android devices] for more details on MDM enrollment.
158161

159162
## Integration Tips
@@ -171,36 +174,36 @@ If you don't see your app's package name here, it indicates that the account log
171174
For description on each MAM policy setting, refer to
172175
[Android app protection policy settings in Microsoft Intune].
173176
For a description of how these settings will show up in the Company Portal logs, refer to [Review client app protection logs].
174-
When MAM policy isn't being enforced as expected, we recommend that you check Company Portal logs or the diagnostic UI, verify that your app is managed by MAM policy, and confirm the policy settings have expected values.
177+
When MAM policy is not being enforced as expected, we recommend that you check Company Portal logs or the diagnostic UI, verify that your app is managed by MAM policy, and confirm the policy settings have expected values.
175178

176179
You can collect Company Portal logs in one of the following ways:
177180
- Through the Company Portal
178181
- Open the Company Portal app
179-
- Select on the three dots menu on the up right corner
180-
- Select Settings
181-
- Under Diagnostic Logs, select Save Logs
182+
- Click on the three dots menu on the up right corner
183+
- Click Settings
184+
- Under Diagnostic Logs, click Save Logs
182185
- Follow the prompt to choose the output directory to save the Company Portal logs.
183186
- Use `adb shell pull` command to pull the logs from your Android device to your local machine.
184-
- [Use Microsoft Edge for Android to access managed app logs]. This will display UI for
187+
- [Use Edge for Android to access managed app logs]. This will display UI for
185188
collecting Company Portal logs and viewing MAM diagnostics.
186189
- Call `MAMPolicyManager.showDiagnostics(context)` to display the same UI for collecting Company Portal logs.
187190

188191
### Quickly testing with changing policy
189-
As you're developing and testing your app's integration of the Intune App SDK, you may frequently change the App Protection Policy settings for your test user.
192+
As you are developing and testing your app's integration of the Intune App SDK, you may frequently change the App Protection Policy settings for your test user.
190193

191-
By default, integrated apps will check in with the Intune service for updated policy every 30 minutes, when active.
194+
By default, integrated apps will check-in with the Intune service for updated policy every 30 minutes, when active.
192195
You can avoid this wait and force a check-in through the Company Portal:
193196

194-
1. Launch the Company Portal. You don't need to sign in.
195-
2. Select the ... menu icon.
196-
3. Select Settings.
197+
1. Launch the Company Portal. You do not need to sign in.
198+
2. Click the ... menu icon.
199+
3. Click Settings.
197200
4. Scroll to the setting called "Management Policy".
198201
5. Press the Sync button.
199202

200203
This will immediately schedule a check-in and will retrieve up-to-date policy targeted to your app and account.
201204

202205
### Troubleshooting AndroidX Migration
203-
If you integrated the Intune App SDK *before- leveraging AndroidX, you may encounter an error like this while migrating to AndroidX:
206+
If you integrated the Intune App SDK *before* leveraging AndroidX, you may encounter an error like this while migrating to AndroidX:
204207

205208
```log
206209
incompatible types: android.support.v7.app.ActionBar cannot be converted to androidx.appcompat.app.ActionBar
@@ -226,7 +229,7 @@ As discussed above, the MAM build plugin/tool will automatically rewrite classes
226229

227230
### Default enrollment
228231
Your application can alternately register for App Protection Policies through a simplified process called **default enrollment**.
229-
This feature is primarily to support private line-of-business apps that haven't integrated MSAL.
232+
This feature is primarily to support private line-of-business apps that have not integrated MSAL.
230233

231234
> [!WARNING]
232235
> Default enrollment comes with significant tradeoffs and is **not recommended**.
@@ -241,8 +244,7 @@ Default enrollment will force the end user to install the Company Portal and com
241244
Enable default enrollment with the following steps:
242245

243246
1. If your app integrates MSAL or you need to enable SSO,
244-
[configure MSAL](#configure-microsoft-authentication-library-msal)
245-
following [common MSAL configurations](#common-msal-configurations) #2. If not, you may skip this step.
247+
[configure MSAL]. If not, you may skip this step.
246248

247249
2. Enable default enrollment by adding the following value in the manifest under the `<application>` tag:
248250

@@ -257,7 +259,7 @@ Enable default enrollment with the following steps:
257259
```
258260

259261
### Isolated Processes
260-
The Intune App SDK can't apply protections to isolated processes.
262+
The Intune App SDK cannot apply protections to isolated processes.
261263
Support for isolated processes (`android:isolatedProcess`) requires the addition of the meta-data tag below.
262264

263265
> [!Warning]
@@ -272,15 +274,15 @@ Support for isolated processes (`android:isolatedProcess`) requires the addition
272274
If your app contains a custom screen capture feature that bypasses Android's `Window`-level `FLAG_SECURE` restriction, you must check screen capture policy before allowing full access to the feature.
273275
For example, if your app uses a custom rendering engine to render the current view to a PNG file, you must first check `AppPolicy.getIsScreenCaptureAllowed()`.
274276

275-
If your app doesn't contain any custom or third-party screen capture features, you aren't required to take any action to restrict screen captures.
277+
If your app does not contain any custom or third-party screen capture features, you are not required to take any action to restrict screen captures.
276278
Screen capture policy is automatically enforced at the `Window` level for all MAM integrated apps.
277279

278280
Any attempts by the OS or another app to capture a `Window` in your app will be blocked as required.
279281
For example, if a user attempts to capture your app's screen through Android's built-in screenshot or screen recording features, the capture will be automatically restricted without participation from your app.
280282

281283
### Policy enforcement limitations
282284

283-
- **Using Content Resolvers**: The "transfer or receive" Intune policy may block or partially block the use of a content resolver to
285+
* **Using Content Resolvers**: The "transfer or receive" Intune policy may block or partially block the use of a content resolver to
284286
access the content provider in another app.
285287
This will cause `ContentResolver` methods to return null or throw a failure value (for example, `openOutputStream` will throw `FileNotFoundException` if blocked).
286288
The app can determine whether a failure to write data through a content resolver was caused by policy (or would be caused by policy) by making the call:
@@ -289,7 +291,7 @@ The app can determine whether a failure to write data through a content resolver
289291
MAMPolicyManager.getPolicy(currentActivity).getIsSaveToLocationAllowed(contentURI);
290292
```
291293

292-
or if there's no associated activity:
294+
or if there is no associated activity:
293295

294296
```java
295297
MAMPolicyManager.getCurrentThreadPolicy().getIsSaveToLocationAllowed(contentURI);
@@ -304,25 +306,25 @@ The service checks the caller to ensure that only the Company Portal is allowed
304306
### Reflection limitations
305307
Some of the MAM base classes (for example, `MAMActivity`, `MAMDocumentsProvider`) contain methods (based on the original Android base classes) which use parameter or return types only present above certain API levels.
306308
For this reason, it may not always be possible to use reflection to enumerate all methods of app components.
307-
This restriction isn't limited to MAM, it's the same restriction that would apply if the app itself implemented these methods from the Android base classes.
309+
This restriction is not limited to MAM, it is the same restriction that would apply if the app itself implemented these methods from the Android base classes.
308310

309311
### Robolectric
310-
Testing Intune App SDK behavior under Robolectric isn't supported.
311-
There are known issues running the SDK under Robolectric due to behaviors present under Robolectric that don't accurately mimic those on real devices or emulators.
312+
Testing Intune App SDK behavior under Robolectric is not supported.
313+
There are known issues running the SDK under Robolectric due to behaviors present under Robolectric that do not accurately mimic those on real devices or emulators.
312314

313-
If you need to test your application under Robolectric, the recommended workaround is to move your application class logic to a helper and produce your unit-testing apk with an application class that doesn't inherit from MAMApplication.
315+
If you need to test your application under Robolectric, the recommended workaround is to move your application class logic to a helper and produce your unit-testing apk with an application class that does not inherit from MAMApplication.
314316

315317

316318
<!-- Appendix links -->
317319
<!-- internal links -->
318320
[manifest replacements]:#manifest-replacements
319321
[some method calls must also be replaced]:#wrapped-system-services
320-
[Pending Intent]:#pendingintent
321322
[MAMApplication]:#mamapplication
322323

323324
<!-- Other SDK Guide Markdown docs -->
324325
[Stage 1: Planning the Integration]:app-sdk-android-phase1.md
325326
[build tooling]:app-sdk-android-phase3.md#build-tooling
327+
[configure MSAL]:app-sdk-android-phase2.md
326328
[Stage 4's Registration vs Enrollment]:app-sdk-android-phase4.md#registration-vs-enrollment
327329

328330
<!-- Other MEM docs -->

0 commit comments

Comments
 (0)