11

I am very much new to AirWatch Concept but had gone thoroughly about AirWatch. I have gone through the following links,

http://developer.air-watch.com/android/application-configuration-with-the-android-sdk/

http://developer.air-watch.com/android/android-sdk-setup/

but in vain.

Could anyone please help me regarding the integration of Air Watch in Android ?

Things i have done so far,

I have created app in the https://apidev.awmdm.com, and i have added assignemnts. The question here is, How can i get the assignment details in my android application that were added in the Air Watch Console.

Help is really appreciated.

Update:

I am able to create and push the application from AIR WATCH CONSOLE to my Device. Now, the issue i am facing is, If i am adding some application configuration in the AIR WATCH CONSOLE, i am not able to get those details in my application.

I have gone through the below Url for the above scenario,

https://appconfig.org/android/ which is very much similar to https://appconfig.org/ios/

I have implemented those things that were mentioned in the above url but still then i am not able to get those details.Please let me know if i am wrong anywhere.

I got to know that the key value pairs that were being passed in Air watch console will be coming into com.apple.configuration.managed key in iOS. Does any one have an idea that how these key value pairs will come. As far as i know, they will be handled via Restriction Manager. But no idea/clue how to handle in Android.

Updated:

xml/app_restrictions.xml:

<?xml version="1.0" encoding="utf-8"?>
<restrictions xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools">

    <restriction
        android:key="ManagedServer"
        android:restrictionType="string"
        android:title="Managed Server"
        tools:ignore="ValidRestrictions" />

    <restriction
        android:key="@string/mdm_key_managed_server_name"
        android:restrictionType="string"
        android:title="@string/mdm_key_managed_server_url"
        tools:ignore="ValidRestrictions" />
    <restriction
        android:key="@string/mdm_key_managed_server_url"
        android:restrictionType="string"
        android:title="@string/mdm_key_managed_server_url"
        tools:ignore="ValidRestrictions" />

</restrictions>

oncreate Method :

IntentFilter restrictionsFilter =
                new IntentFilter(Intent.ACTION_APPLICATION_RESTRICTIONS_CHANGED);

    BroadcastReceiver restrictionsReceiver = new BroadcastReceiver() {
        @Override
        public void onReceive(Context context, Intent intent) {

            // Get the current configuration bundle
            Bundle appRestrictions = myRestrictionsMgr.getApplicationRestrictions();

            // Check current configuration settings, change your app's UI and
            // functionality as necessary.
            Toast.makeText(LoginActivity.this, "Reciever Called", Toast.LENGTH_LONG).show();
            RestrictionsManager myRestrictionsMgr =
                    (RestrictionsManager)
                            getSystemService(Context.RESTRICTIONS_SERVICE);
            if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.LOLLIPOP) {
                if (myRestrictionsMgr != null) {
                    Bundle appRestrictions = myRestrictionsMgr.getApplicationRestrictions();
                    if (appRestrictions != null) {
                        if (appRestrictions.containsKey("ManagedServer")) {
                            String mConfigDetails = appRestrictions.getString("Managed Server");
                            Toast.makeText(LoginActivity.this, "" + mConfigDetails, Toast.LENGTH_LONG).show();
                        }
                    }
                }
            }
        }
    };

    registerReceiver(restrictionsReceiver, restrictionsFilter);

List of Users:

enter image description here

When i am actually trying the other command:

enter image description here

Update:

Created a sample app and published to Play Store. App link as follows,

https://play.google.com/store/apps/details?id=com.manu.samplemdm

Now, its a play store app. When I am sending Application Configuration but unable to receive it in the Application. Its giving me still empty bundle from the application.

Help would be really appreciated.

enter image description here

Help is really appreciated

4

2 回答 2

2

除了告诉您如何创建应用程序并设置应用程序配置、键值对以推送到您的设备的 AirWatch 资源之外,您还需要查看Android Restriction Manager API。按照链接中描述的步骤操作。

整个过程的工作原理是,在您将 MDM 设置为 AirWatch 后,AirWatch 会控制 AndroidForWork 环境。然后,AirWatch 从 AirWatch 控制台管理设备,并将应用配置推送到您设备中的 AndroidForWork。您需要实施 Android Restriction Manager 才能访问您的 MDM 传递给您的这些数据。市场上的所有 MDM 都是一样的。

更新:

为了在开发阶段将您的应用程序安装到工作容器中,您可以使用adb将其从复制Personal ContainerWork Container.

首先,列出设备中的所有活跃用户:

./adb shell pm list users

然后,从用户列表中找到工作用户的 ID,并在下面的命令中设置它以及应用程序的包名称和应用程序的 Main Activity。

./adb shell am start —user 13 -n “your.apps.package.name/your.main.activity.package.name”

命令中的 13 是工作用户的 ID。在我的情况下,它是 13。

有关./adb托管配置文件中命令的更多信息,请参阅此链接并检查页面的最底部。

于 2017-02-20T16:26:28.123 回答
1

与 AirWatch 集成有几种不同的方法。这取决于您尝试使用的技术集。根据我在您的帖子中看到的内容,我认为这些是与您最相关的两个:

  1. AirWatch SDK
  2. AppConfig 标准

这两种方法都可以完成类似的功能,但每种方法都有不同的部署要求。听起来您已经采用了第二种方法,即使用 AppConfig 标准和 Google 提供的本机 API 来让应用程序读取通过 AirWatch 传递的配置值。

需要注意的重要一点是,Android 上的 AppConfig 标准方法要求设备支持“Android for Work”注册,这是 Google 发布的一种相对较新的管理协议。值得注意的是,AirWatch 确实支持 Android for Work 注册,因此只需将 AirWatch 测试实例配置为“Android for Work 注册”而不是传统的旧 Android 注册协议。有关 Android for Work 的更多信息,请访问: https ://enterprise.google.com/android/solutions/personal/

如果您已经是 AirWatch 的客户,如果您尚未在其资源门户上创建一个帐户以获取有关如何在 AirWatch 中设置 Android for Work 的文档,这可能会有所帮助。https://resources.air-watch.com

我希望这有帮助。

于 2017-02-16T21:15:56.267 回答