Way to automate the actions on an app that is owned by a 3rd party

时间:2015-08-07 02:43:18

标签: android

I need a way to automate the actions on an app that is owned by a 3rd party. The basic operator is the ability to Tap buttons and and put text in input boxes.

The idea is, the tool I needed will always be running. When it gets a notification, it will start the target app (Instagram), fill out forms and tap buttons, then exit.

Could you help me how can I do it? I have no idea at all. Thank you.

1 个答案:

答案 0 :(得分:1)

我相信你所寻找的是分享意图。更多信息here

例如:

Intent shareIntent = new Intent(android.content.Intent.ACTION_SEND);
shareIntent.setType("image/*");
shareIntent.putExtra(Intent.EXTRA_STREAM, Uri.parse("file://" + imageLocalPath));
shareIntent.setPackage("com.instagram.android");
activity.startActivity(shareIntent);

PS:我不认为你可以自动执行动作,因为触发“发布到Instagram”按钮,如果这就是你要求的。我认为他们的API也不允许您自动上传。您可以做的最好的事情是让应用程序通知您按“发布到Instagram”并为您填写必要的字段/图像/视频。