我对AirWatch的概念还很陌生,但已经仔细了解了AirWatch。我查看了以下链接:
http://developer.air-watch.com/android/application-configuration-with-the-android-sdk/
http://developer.air-watch.com/android/android-sdk-setup/
但没有成功。
请问是否有人可以帮助我在Android中集成Air Watch?
目前我已经完成以下步骤:
我已经在https://apidev.awmdm.com中创建了应用程序,并添加了任务分配。我的问题是,如何在Android应用程序中获取在Air Watch控制台中添加的任务分配详细信息。
非常感谢您的帮助。
更新:
我已能够从AIR WATCH CONSOLE创建和推送应用程序到我的设备上。现在我面临的问题是,如果我在AIR WATCH CONSOLE中添加了一些应用程序配置,则无法在我的应用程序中获取这些详细信息。
我已查看以下URL以了解以上情况:
https://appconfig.org/android/,这与https://appconfig.org/ios/非常相似。
我已经按照上述URL中提到的内容进行了实现,但仍然无法获取这些详细信息。如果我哪里做错了,请告诉我。
我知道在Air watch控制台中传递的键值对将出现在iOS的com.apple.configuration.managed
键中。任何人都知道这些键值对将如何出现吗?据我所知,它们将通过Restriction Manager
进行处理。但是不知道如何在Android中处理。
更新:
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
方法:
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);
用户列表:
当我尝试其他命令时:
更新:
创建了一个示例应用程序并发布到Play商店。 应用程序链接如下,
https://play.google.com/store/apps/details?id=com.manu.samplemdm
现在,它是一个Play商店应用程序。 当我发送应用程序配置但无法在应用程序中接收它时。 它仍然从应用程序给我一个空绑定。
真的很感谢您的帮助。
非常感激您的帮助。