Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

About launching android env with home screen #121

Closed
llv22 opened this issue Mar 9, 2023 · 3 comments
Closed

About launching android env with home screen #121

llv22 opened this issue Mar 9, 2023 · 3 comments
Labels
question Further information is requested

Comments

@llv22
Copy link

llv22 commented Mar 9, 2023

Dear colleagues:

I'm now trying to use android_env for one research topic. Instead of monitoring one specific application, I need to check how users operate on the emulator (esp. click, navigation, input) and leverage adb logging or interceptor to understand what happened behind for API calling.

Is it possible to do this via textproto setting? launching to the home and accessing multiple apps to simulate a more flexible user scenario?

I saw @kenjitoyama mentioned in #19, you're mainly relying on accessibility events to access the third party apps or default apps lacking source code.

"We haven't trained explicitly for YouTube, it was just an example. However, we did train agents on apps for which we don't have the source code such as the Clock or System Settings by reusing accessibility events. Please see https://github.com/deepmind/android_env/blob/main/docs/example_tasks.md#accessibility-forwarder. "

I don't know whether there are more possibilities to do android apps monitoring, beside accessibility events?

@kenjitoyama kenjitoyama added the question Further information is requested label Apr 3, 2023
@kenjitoyama
Copy link
Collaborator

Hi @llv22, what limitations do you see from using accessibility events / trees? They are very comprehensive and allow you listen for events such as clicks, swipes, keyboard inputs, apps being opened/closed and a bunch of other things. Please see https://developer.android.com/reference/android/view/accessibility/AccessibilityEvent for details.

The reason we use Accessibility events is that they're already supported by the Android ecosystem, many apps provide support with additional information like labels for buttons which are super useful. On top of that, this is already unit-tested and implemented in on every modern Android phone, without requiring additional binary pushes. If you do anything custom, you will have a problem to deploy such solution and to make it work across different devices, Android versions and so on.

Let me know what you think.

Thanks!

@llv22
Copy link
Author

llv22 commented Apr 5, 2023

@kenjitoyama I worked out an accessibility service on an Android device and found gesture movement capture via AccessbilityEvent can't be captured generally in the Android system. If you check https://developer.android.com/reference/android/view/accessibility/AccessibilityEvent documentation, the supported gesture events are under the model of touch exploration model, which is different from the normal gesture that we talked. For instance, if I figure-wipe the bottom of the screen, can we detect this event as a whole? or only detect mouse events, then compose them into the figure-wipe event?

So just like mentioned in https://github.com/deepmind/android_env/blob/c53f779b344497640ce9899b3717408e81b49848/docs/environment.md#action-space, if we try to detect gesture like

Touch & Hold | Flick Left | Flick Right | Scroll (H) | Scroll (V) | Drag & Drop

, we have to develop our own wrapper? could you confirm?

@kenjitoyama
Copy link
Collaborator

We had lots of problems with Touch Exploration mode in the AccessibilityForwarder and have disabled it.

Android doesn't have a native notion of swipe, fling, drag or anything like that. These higher level concepts are left to app developers who may or may not use existing libraries to detect them. For example, Android provides one such library here: https://developer.android.com/reference/android/view/GestureDetector. In our experience it works well and you just have to adjust some constants depending on your personal preferences.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants