【问题标题】:Get back json response from android management API call从 android 管理 API 调用中取回 json 响应
【发布时间】:2020-04-23 18:55:57
【问题描述】:

我在我的 android 应用程序中使用 android management api。现在我想获取我的 android 应用程序的策略,我正在使用这个方法 policies.get 来获取策略。现在我想要的是在我的应用程序中从响应中获取 json。我就是这样做的

checkPolicy(ENTERPRISE_ID,name);


 private void checkPolicy(String enterpriseName, String policyId)
            throws IOException {
        System.out.println("Getting policy...");
        String name = enterpriseName + "/policies/" + policyId;
          androidManagementClient
                .enterprises()
                .policies()
                .get(name)
                .execute();

    }

我在这里使用正确的方式来获取政策,但我不知道如何得到回复?我的意思是像这个page。我输入参数并收到一个json。现在我需要在应用程序中做什么来获取响应 json

【问题讨论】:

    标签: android android-management-api


    【解决方案1】:

    您的请求应采用enterprises/{enterpriseId}/policies/{policyId} 的形式

    您可以将响应保存到变量中:

     var policyJson = androidManagementClient
                    .enterprises()
                    .policies()
                    .get(name)
                    .execute();
    

    【讨论】:

      猜你喜欢
      • 2020-02-02
      • 2016-10-18
      • 1970-01-01
      • 2018-05-31
      • 1970-01-01
      • 2017-01-21
      • 2023-01-28
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多