How to get x,y co-ordinates from the touch events and use it with robotium.

1,391 views
Skip to first unread message

Addy

unread,
Nov 4, 2011, 8:11:23 AM11/4/11
to Robotium Developers
Hi,

From the android device I am getting touch events by "adb shell
getevents",
But this events the code is in HexaDecimal and I want to this in
decimal like x ,y co-ordiante so I want to use it with robotium to
test clickOnScreen on my activity. So is there any method to convert
this hexadecimal code into decimal and get X,Y co-ordiante?

I think Yahor can help me on this. I found his blog on some site on
this touch events.

Thanks.

Yahor Paulavets

unread,
Nov 4, 2011, 8:33:09 AM11/4/11
to robotium-...@googlegroups.com
Hello,

Please check my old post:
http://softteco.blogspot.com/2011/03/android-writing-events-low-level-touch.html

To convert from HEX to DEC, please do (Ubuntu) in terminal: echo $(( 0xFF ))
Or use java to convert the values, for instance, implement your own click method, which will be accepting
hex coords and convert them to dec coords (A lof of samples in google)

Best regards,
Yahor


--
You received this message because you are subscribed to the Google Groups "Robotium Developers" group.
To post to this group, send email to robotium-...@googlegroups.com.
To unsubscribe from this group, send email to robotium-develo...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/robotium-developers?hl=en.


Addy

unread,
Nov 7, 2011, 12:08:59 AM11/7/11
to Robotium Developers
Hi,

Thanks for your reply,

I will look on that.


Regards,

Addy

On Nov 4, 5:33 pm, Yahor Paulavets <ypaulav...@agilefusion.com> wrote:
> Hello,
>
> Please check my old post:
>
> http://softteco.blogspot.com/2011/03/android-writing-events-low-level...
> <view-source:http://softteco.blogspot.com/2011/03/android-writing-events-low-level...>
>
> To convert from HEX to DEC, please do (Ubuntu) in terminal: echo $(( 0xFF ))
> Or use java to convert the values, for instance, implement your own
> click method, which will be accepting
> hex coords and convert them to dec coords (A lof of samples in google)
>
> Best regards,
> Yahor
>
Reply all
Reply to author
Forward
0 new messages