2
我試圖在UI Automator android中進行api調用。我的代碼發佈在下面。我們可以這樣做一個API調用:是否可以在UI Automator中進行API調用Android
String enter_url = "www.abc.com";
new UiObject(new UiSelector().text("Enter URL or Search & Win")).setText(enter_url);
getUiDevice().click(745, 969);
//calling check class
new check().execute(enter_url);
//AsyncTask
private class check extends AsyncTask<String, Void, String> {
@Override
protected String doInBackground(String... args) {
String myurl = args[0];
//making api call here
// the json string is stored here
String result = sb.toString();
System.out.println("Result is :" + result);
return result;
}
}