How to access screen capture function of DDMS by IP - android

Looking for a program, or, if it doesn't exist, a way to capture the screen of an Android-based device (proprietary touch-remotes) by entering the IP address of the device.
Anyone know of something that could do this for me or, if not, what I might need to do to package up something that could do this?

Actually, the "screen capture" capability is built into Android itself - DDMS simply invokes it.
It would be fairly straightforward to:
a) write an Android service, that
b) listens on a port, and
c) does its own screen capture when invoked.
Here's an example for programmatically doing a screen capture:
Get Webview content into bitmap
Android Screenshots and Screen Capture

You could use something like Wifi ADB to setup an ADB connection over Wifi. It should then be possible to get the screen shot using the device using DDMS.

EDIT: Actually, I ended up writing a simple C++ program that asks for an IP address in a console window, does command "adb connect " with the input IP address, thus establishing a connection via ADB to a device at a specified IP address, and then the C++ program starts up "Droid#Screen" software. Since the ADB is already started, the program will simply display whatever is coming in from the ADB! I have a feeling other 3rd party programs would work too.

Related

How to block specific urls in Android

I am developing a parental kind of App in which there is a requirement to block specific urls from all the browsers in the Device. I think this is an old question but couldn't find any solution yet on stack.
Do you have any working solutions. Assumption - The device is rooted.
Regards,
sha
I have two resources for you:
Since the device is rooted you can work directly with iptables. iptables will give you very precise control over all coming and going data packets. Check out open source projects like AFWall+ on GitHub for iptables in action.
If you want to be able to run your app on unrooted devices look into creating a fake VPN. You don't send any data to an actual VPN server, you simply use the VPN API to filter all the information coming and going. Check out Disconnect (whenever they actually share their open source code...) or OpenVPN which is what Disconnect builds on.

Fake incoming call

I am looking for a way how to automate incoming calls for testing with MonkeyTalk. That means I can run some external scripts. In our Continuous Integration tool I need something capable of running in the headless mode.
WHAT I TRIED
DDMS
Telnet
ADB
DDMS from Eclipse is not the way to go as it supports only GUI.
Telnet seemed like a good choice but it's a pain in the ass to write some command line scripts for it. In Windows I didn't make it. There exists some ways in Linux though.
ADB offers only outgoing calls by using the famous
adb shell am start -a android.intent.action.CALL tel:1112223333
With ADB I also tried to invoke a broadcast with extra state ringing but NO...
QUESTION
How can I fake an incoming call to an emulator using a script? I need to set my own number, of course.
On google's android studio I think it gives you access to internet & google accounts. You could just log in, install "hangouts dialer" from the play store, then (on another phone, with a different google account) call the previously used google account. I haven't tested this though, and I don't know if the phone handles this as an actual call or just opens hangouts.
Alternatively, you could just set up two emulator instances and dial the console port number, in the window title "Android Emulator #####", as said in this question.

Android 4.0.3. USB Host - sending data via controlTransfer

I am new to Android and just started working with Android 4.0.3. which enables USB Host connection. I'm trying to send some signal via USB to a camera, let's say it is supposed to be some characters that the camera has to receive and e.g. start recording. I wanted to do it via controlTransfer(), but I am unable to understand what each part of the logic of this method means. I've checked many fora, but everywhere I see it people keep refering to it as if it was obvious.
What is the request ID, value and index?
Or maybe there is some other approach to the problem that I don't know. I know for sure that you can send a signal via USB from Linux terminal to that camera and as android has a linux kernel so maybe the way to go would be to start a terminal and do it the Linux way?
Thanks for any tips :)
controlTransfer() intended to send commands via control endpoint (endpoint 0). Request ID, index and value and part of USB protocol. Please refer to http://www.beyondlogic.org/usbnutshell/usb6.shtml#SetupPacket for more information.
Do you has protocol description for your camera?
I suppose, you need to use other endpoint (as described in camera protocol) to send characters to a camera.

Bluetooth + simulating mouse

anyone know if its posible to make an application to simulate a touchscreen mouse or trackpad by bluetooth??
How can I make that the PC (or MAC) knows me as a mouse device?
Regards,
Juan
You should have a look at the Bluetooth HID specification. It may be possible, depending on the stack of the device that you are using to emulate a mouse/trackpad. I'm not familiar with the stack on Android (assuming that's the platform you're using from the tag on your question) so I don't know if it's possible from there.
Essentially, you create a HID service on the L2CAP protocol. The service record specifies the HID descriptors which describe the data being sent from emulating device. The HID driver on the host computer should be able to interpret that data.
It might be useful to try to connect to another Bluetooth mouse/trackpad from the desktop (Bluecove on a stack other than Microsoft is a good way to hack around in Bluetooth). Have a look at the service record for the HID service on the mouse/trackpad. Also, look at the data coming from the mouse/trackpad for an idea of what needs to be sent and when.
Alternatively, you could write a server application on your computer that communicates via another Bluetooth protocol (e.g., RFCOMM/SPP) to the input-device emulator app running on your phone. The server application would simulate the input device (e.g., move the mouse pointer around on the screen, etc).
Instead of creating your own project why dont you contribute to the remotedroid project?
I'm assuming you know your bluetooth api's well. Remote droid uses Wifi and OSC messaging to communicate with the PC.
Yes you may use GlovePie with the wiimote connected to BlueSoeil, It will alow you to do anything with you computer with the wiimote. It also has a Language it uses
I think you want this:
Serverless Bluetooth Keyboard & Mouse for PC/Phone
It's even open-source!
Unfortunately it is not open source, it just has a GitHub readme for some reason.
But still the app is quite good!

Ringing myself using android emulator

I am developing a small application on Google's android emulator.
I am trying to figure out how I can simulate a phone call from one instance of an emulator to another (both running on my computer). Does anyone know how this can be done?
Thank you very much.
Launch the dialer application on the
first emulator. As the
number to dial, enter the console
port number of the second emulator you'd
like to simulate a call on.
You can see the port number of the instance in the windows title of the emulator.
alt text http://www.freeimagehosting.net/uploads/6c15bc13f1.png
Press "Dial". A new inbound
call appears in the second emulator
instance.
Alternatively to the solution provided by Kami, you can use DDMS or just the android console (in Linux and assuming emulator port is 5554):
$ telnet localhost 5554 <<!
> gsm call 12345678
> !
simply open the DDMS from the eclipse and choose emulator control
and you'll find a tel bar just type the phone number you want the emulator to receive and hit call
In order for calling the port number to work, both emulator instances must be started from the same android AVD manager process. Two separate 'android' processes launching different emulators will not be able to call each other.
In Emulator's "Extended Controls" window, there's an option to ring the phone artificially by means of a button "Call Device". See screenshot below:

Categories

Resources