Let device act as printer - android

I am trying to connect my Android Tablet to a hospital machine.
This machine has the ability to print to several printers like a "Canon IP2600".
But when I connect my Tablet to the machine and try to print from the machine to the tablet, the machine says: USB Printer not found. (of course).
Now my question is, how can I make the machine think there is a printer connected instead of an android tablet?
My theory is: when connecting the tablet to the machine, the tablet usb device descriptor is sent to the machine and this device descriptor doesn't resemble one of a "Canon IP2600".
Am I thinking in the right direction? Any advice is welcome.

AFAIK tablets aren't designed to be "printed" to.
I'm not saying what you want to do is impossible, but I'm not sure if it's realistic. You're going to be looking at building a lot of custom software. In order to "print" to a usb device, you're going to need to write drivers for you OS (I'm assuming windows) that will allow the computer to see that cable connection as a printer. Even after you've done that, you need to write some more drivers and software to allow the tablet to understand when it's been connected to a computer and accept incoming prints.
I'm not sure how flexible your requirements are, but a more realistic option might be to use Google Drive (formerly Google Docs). You could print on the computer to a PDF file (using something like PrimoPDF) and save it directly in the Google Drive folder. With sync setup, the file would be available on your tablet using the Google Drive App within seconds.

Related

Access Modem - Android Device (Nexus 5)

Device : Google Nexus 5 (Un-rooted)
Host Machine : Window 7
I want to Access Android Device as a Modem (using COM or Modem Port) and eventually pass AT Commands using HyperTerminal/Teraterm.
So after connecting the device to a Windows Box, The Device gets detected under Device Manager, but doesn't show any COM Port (other than the default COM0).
On right click and update driver, It shows it cannot find drivers.
I have tried the following options, but no luck with any.
Tried this on a rooted Nexus 5, but doesn't expose which /dev/smdX to use. Tried all combinations, didn't work.
Tried the Google USB Drivers from the Google Android's Website. No changes.
From here. I Installed drivers from LG Electronics, No changes in COM Port.
Universal Naked Driver helped me get to ADB Shell interface, but
thats not what I want.
In all of the Above procedure USB Debugging was enabled (Just saying).
I also heard the phone has to put into Modem mode to fire AT Commands.
If so, How do I do that ?
Or Is this a device driver Issue ?
Conclusion:
I want to access the Modem of the Android Device and fire AT Commands to it.
Could you please tell what am I missing ?
Any help on this would be really appreciated.
It's difficult to give an exact answer to this question, because it depends on how the manufacturer has implemented the device drivers. Unfortunately, there is a lot of information that isn't in the public domain.
It is possible, that the manufacturer has implemented some code to convert the device to a modem. Doing this yourself is device-specific, and proprietary. You might be able to get hold of a converter, for example bundled with the manufacturer's dashboard application for the PC, if such a thing exists.
Some devices don't expose the modem port at all. They may be visible as a network adapter, or as an always-connected LAN connection. If the device is visible as a network adapter, then you can access it via Windows Mobile Broadband API, or via MBIM for some newer devices.
To check if the device is visible as a network adapter, and get information about it, open a cmd box and type
netsh mbn show interfaces
Windows Mobile Broadband API doesn't give as many details as a good AT command set, but performs basically the same functions. MBIM is an industry standard interface with similar functionality, available on the Windows 8+ desktop via the Mobile Broadband DeviceServices API, for devices that support it.
If the device shows as an always-on LAN connection, there is probably a proprietary, high level interface for mobile functionality.
Driver behaviour can differ for different operating systems. If you have the chance to try the device on Windows Vista, 7 and 8, you may see different behaviour.

Android phone usb

I want to make a remote control for my tv using my android phone. I plan to connect my external infrared device to the phone via usb. An application on the phone should do the processing and send out commands to the infrared device via usb. Is it possible to explicitly access the phone's usb interface from the application to send/receive data? The data will just be short binary strings. In one instance, the phone should be the host and in the other instance, the phone should be a client.
For this to be possible, I believe you will need a USB host driver for your phone. While these drivers are available for some devices (see link), you'll need to have root access to install them, and it won't be easy. For instance, here's a description of how to install a USB host driver for the Nexus One.
Given how few devices support USB host, there seems to be very little documentation one how one would actually go about accessing a specific USB device. The second link above, to the Nexus One driver, provides some sparse details. Beyond that I can only assume that you'd need to write your own driver for the specific device, which would probably be similar to standard Linux USB driver development. This XDA thread (started by the author of the N1 USB host driver) is probably the best source of information you'll find.
Unfortunately the short answer is that what you want to do will be very difficult, and you certainly won't be able to distribute your work easily if you do manage it. Good luck!

USB Android I/O

Is it possible to access the USB port on Android phones? (Droid X for example)
Here is my usage case:
Have a USB device attached to the Android phone. The phone listens for data on this USB device. (The USB device is connected to a USB->RS-232 converter that has I/O attached to it)
This would be slick if possible. Does anyone know if this is possible?
Would be slick, yup. Not possible though. There's a feature request for it: http://code.google.com/p/android/issues/detail?id=738
Actually it is possible on a lot of the phones if you are able to install a new kernel with a USB host driver and rig up a custom cabling scheme to provide usb bus power to the device as the phone won't. A few phones even shipped with this capability already live.
I don't know if the Droid X specifically ships with this already, can have it added (if you are able to flash kernels), could have it added but no one has written the host driver yet, or is missing the hardware capability.
You also would need to enable the appropriate usb serial converter device driver (identified by experimenting with the device on a desktop linux box), but that's probably already in the kernel sources and just needs to be selected in the config. You may also need to create a device file for the /dev/ttyUSB0 or whatever and give it permissions appropriate to the application that wants to access it. (This requires root, but if you can reflash the kernel, you can get root)
If you want to pursue this, search the android kernel google group for posts about USB host mode.
One serious downside to putting the USB into host mode is that you loose the adb interface into the phone, which makes working on your projects hard. You'll probably need to either build an adapter for the low voltage debug serial port if there is one (as on G1, mytouch, etc) so you can get a console shell (or just use that instead of USB to talk to your peripheral) or at a minimum set up an ssh and sftp server on the wifi.
Since you want serial anyway, another option people have used is to get a bluetooth-to-serial module from an outfit such as sparkfun.
A bluetooth to serial adapter might solv your problems.
You can find one at https://www.sparkfun.com/products/582. Boards from other companies are also available for example on ebay.

Using My Android as a USB Device

I've been able to find a few posts on StackOverflow about how to control USB devices using an Android phone -- which I understand is impossible (The Android being a USB device and all.)
However, I would be perfectly happy to set up my application to communicate with the other computer (a Linux host) as a USB device. (Like a really expensive mouse...)
Does anybody have information about how to set up an Android app/phone to use the USB connection and exchange data with a host computer. Obviously, it already works at some level -- it's how Eclipse and Android SDK/debugger do what they do, but I'm still looking for some way to do this in an application.
(My current phone, BTW, is a Droid Incredible.)
Thanks,
R.
Basically you'd need to install the USB device driver and the ADB toolsuite from the SDK, either that or reverse engineer their functionality and build it into something else.
Then you enable USB debugging on the phone.
And then you can do something like an adb port forward to allow an application on the pc to connect to a network socket listener on the phone. Note that connections cannot be made in the other direction, but once a connection is made it is bidirectional.
If your version of android supports tethering over USB, you could also leverage that to implicitly create a network between the PC and the phone, at which point you can make connections in either direction. Just make sure nothing starts accidentally pumping lots of data through the phone's mobile network!
(Many android phones actually can experimentally function as USB hosts, but you have to compile new drivers into the kernel, install the new version, and make up a cable to provide USB power to the device as the phone cannot. Also you lose the ADB over USB channel which makes debugging a pain)

Reading the connected computer's drives from an Android App?

I would like to have an application sync itself with some files on a host computer.. Anyone know if this is possible? Eg: When you connect an Android phone to a computer i would like an application on the android system to read some allowed folders on the connected computer. Making it so the user doesn't have to sync files itself.
I ask possible, because i assume it isn't.. for security.
You won't be able to do it solely from the Android end, because Windows doesn't make the local drives available through the USB port like that (unless you have some custom driver on the Windows side).
Your Android device will probably show up to windows as a USB drive. If you have an SD card plugged in, you may see a second drive from the Windows side.
To do something like this, you'd probably need to have software running on the Windows side that did the syncing, and then copy the data from the /sdcard directory on the Android device to wherever you ultimately need it to be.

Categories

Resources