A Plan For Capture
Posted by brownm04 on 2012-04-18 09:59
I think I have an idea for how to implement this that will actually work. Unfortunately it still requires the long winded re-implementation of the MonkeyRecorder and Ripper tools to handle this.
We don't actually need to get the height and width and send them to the Capture tool. Instead, we add functionality in the adr-server application to return a view that houses a coordinate.
1. Launch Capture tool (modified MonkeyRecorder and Ripper tool)
2. The Capture tool opens the socket with the emulator
3. User clicks a coordinate (x, y)
4. Send (x, y) over the socket to the emulator
5. Add a function in the server that takes the point and goes through all the current views and sees which view houses the point (height and width are populated since the user could see the button)
6. Returns that view over the socket to the Capture tool
7. Capture tool receives the view and rips just that view
P.S. The reason I didn't think of this earlier was I didn't know the adr-server had the functionality to add more methods and stuff and how we could traverse the views on screen when I suggested MonkeyRecorder.
We don't actually need to get the height and width and send them to the Capture tool. Instead, we add functionality in the adr-server application to return a view that houses a coordinate.
1. Launch Capture tool (modified MonkeyRecorder and Ripper tool)
2. The Capture tool opens the socket with the emulator
3. User clicks a coordinate (x, y)
4. Send (x, y) over the socket to the emulator
5. Add a function in the server that takes the point and goes through all the current views and sees which view houses the point (height and width are populated since the user could see the button)
6. Returns that view over the socket to the Capture tool
7. Capture tool receives the view and rips just that view
P.S. The reason I didn't think of this earlier was I didn't know the adr-server had the functionality to add more methods and stuff and how we could traverse the views on screen when I suggested MonkeyRecorder.
Home / Developer API / Tour / Get a Project - Solutions for Bug & Issue Tracking, Collaboration Tools, Subversion Hosting, Git Hosting
Androidguitar is powered by Assembla.
4 Comments
By brownm04 on 2012-04-18 10:21
By brownm04 on 2012-04-18 10:45
1. Set up the adb connection just like the ripper and Socket
2. Calls the adb command to start the application on the emulator just like the ripper
3. Show the frame and buttons just like MonkeyRecorder except in a manner you guys choose (if you change where the buttons are go for it)
4. When a user clicks a part of the screen, the Capture tool sends the coordinate over the Socket to the adr-server application in the form "getViewAtPoint" "X,Y"
5. Wait for the server to send back the JSON object (can look at how the ripper handles getRootWindows or getContainer to turn the JSON object back into useful stuff)
6. Use this ADRView to populate the step that the user took
7. Continue steps 3-7 until the user clicks export test case button on frame
- Need to decide exactly what to rip - if it's just what the user clicks, you can just call rip on the returned ADRView JSON object. If it's more, just do the checks after each click to see if it's a new window, and if so, rip the entire window but don't keep ripping after all the components are ripper (just rip this window)
By highvoltage81 on 2012-04-19 07:33
We create a composite listener, which contains our event listener, and the apps. then unregister the default listener, and register our composite listener, and treat the input events in a "pipe" fashion, where it is first handled by the default listener, then forwarded over to our listener, where we can do with it whatever we want (rip,... etc)
Comments? suggestions?
By brownm04 on 2012-04-19 12:01