USB Host + Power support - java

In a project I am currently working on, I am using a PIPO T9 tablet to run an app that uses the USB port to communicate with a transceiver. The reason I chose this tablet is because it has a usb port and a 5vDC power input (seemingly) allowing it to be powered while the USB port is in use. I found out later that only one can be used at a time.. So now I have been searching for a way to either:
Programattically force the tablet to disable USB host while the app is not being used. Hopefully allowing the tablet to switch to charging from the 5vDC line, or
Use an OTG Y cable to charge and get data from the USB port
So far I have tried the OTG Y cable method and it seems that this wont work with the tablet. When the tablet is off it has no trouble charging but as soon as its switched back on, charging stops. I have seen some similar questions on here and the recommendation was to use USB Accessory mode but I'm struggling to find out whether this will work with a tablet running 4.42 (NOTE: This tablet has been Rooted).
As always if anyone has any advice I would hugely, hugely appreciate it.
Thank you in advance :)

Related

Is there a way to get power drawn from a USB port in windows using Java?

I actually have been working on a Java program that will show the power draw from a connected USB device in my laptop. I am aware that you can get it through device manager but I would like to get it through Java. I did research about my issue a bit and found out that your can use USB4Java to deal with USB devices. However I am not able to find a specific solution on how to get my connected device's power draw from the USB port. Is there a way to do this in Java?

Connection to HID USB device (keyboard and mouse) in android

I am trying to develop an android app for managing HID devices.
Using UsbManager and getDeviceList() provided from google sdk and following the android sdk official documentation, I am in condition to set up a connection with various devices (as pen drives, external HD, usb "phone" etc.), but I am not in condition to connect the android smartphone to usb mouse and keyboard: they are not listed by getDeviceList() method at all, even if android OS is able to recognize and use it!
In fact, I am using the mouse and the keyboard with the mobile without any problem.
I am using for my test a samsung galaxy S4.
Any one can give me some explanation about this, please?
Thank you!
p.s.: I also tried to use app like "USB Host Diagnostic" and the result is the same: the app can not recognize connected mouse and keyboard...but mouse and keyboard are still working perfectly...
Have you looked at Android Open Access Protocol yet? In the section titled HID Support:
The AOA 2.0 protocol adds four new USB control requests to allow the accessory to act as one or more HID input devices to the Android device. Since HID support is done entirely through control requests on endpoint zero, no new USB interface is needed to provide this support.
HTH.

WiFi connection beetween a few devices and Android tablet

I need some theoretical knowledge about this kind of connection. I've got a router with open wifi. I have also two (this number can change up to 15) devices connected to that network and one android tablet.
The main point is to show on a tablet data from these 2 devices at the same time.
So, what's the best idea to develop that idea on Android(API 2.3)? Using sockets or wifi connection( each in one thread)? Thanks for all solutions. Cheers.

Why can't OSX detect android Galaxy S for USB debugging?

I searched for similar questions on this issue but found none related to Mac OSX.
Situation:
Trying to test android apps on a Galaxy S (Details below) but Mac is not detecting the device. Tried all the things below and have wondered whether this might be a driver issue (which I've heard things about for Samsung USB debugging).
Questions:
1) Are samsung drivers required for android USB debugging?
2) And are they available for Mac OSX?
3) Any other reasons OSX might not detect device for usb debugging?
Things I tried:
Enabled USB Debugging # Settings >> Applications >> Development >> USB Debugging
Enabled Tethering # Settings >> Wireless and network >> Tethering >> USB
Tethering
Set Tethered mode # Settings >> USB connection >> Tethered mode
Attempt to detect devices via ./adb devices (from platform
tools dir)
Verified that "Unknown Sources" is checked # Settings >> Applications >> Unknown Sources
Verified that device is connected to Mac
Restarted phone
Restarted mac
Added various device / product ids to adb_usb.ini
Did ./android update adb (which does adb kill-server / start-server)
Using:
Samsung Galaxy S (4G) with Sprint
Mac OSX 10.6.8
Eclipse Classic 3.7.1
Have you tried connecting the phone using a powered USB hub? I haven't tried it yet but found this blog post that suggests it may help for Samsung Galaxy devices.
http://esausilva.com/2010/10/02/how-to-set-up-adb-android-debug-bridge-in-mac-osx/
Go to Tethering select and then deselct USB Tethering and you are done.
this worked like a charm.
make sure that you plugin your device in the usb ports on the mac itself, not on the keyboard usb-ports.
Well I tried all kind of stuff for a phone that was working yesterday but not today. Finally replacing the cable between the phone and my mac solved the issue.
USB driver problems happens under Windows.
For MacOS, I had nothing to do : ADB found my device.
You don't need tethering : it's for sharing an Internet connection.
USB Debugging is needed. Also make sure you authorize your Galaxy to use Unknown sources (# Applications -> Unknown sources (it's a check box)).
This happens all the time with lots of phones. Two things that have worked for me are (1) type "adb kill-server" at the command line, or (2) try another cable.
This may sound crazy, but I tried every suggestion on this page except what finally worked:
Use the Samsung USB cable that comes with the S7 (my S6 cable worked too)
Every other USB cable I tried did not work. I don't know exactly why (USB 2 vs 3?), but that is what worked for me.
Of course, make sure USB debugging is turned on, and yada yada yada, but I did all that and still NOTHING. The moment I plugged in the USB cable that came with my S7 I got the RSA fingerprint message, and confirmed USB debugging, and the device showed up in Android Studio when I clicked Run.
HTH
--jsp
Go to
Settings
Wireless and Networks
USB Utilities
Detach the USB cable
Select Connect Storage To PC
Reconnect your USB cable to your phone.
Source: Galaxy S II Forums - Help, Mac won't recognize my galaxy S 2
This is what worked for me on Samsung Duos:
Go to settings > More > About device(at the bottom)
On that about device screen go to bottom and touch 6 times on the "Build number" (un till it doesn't display any notice)
Then visit again to settings > More and it will display developer options before the about device. Click on developer options and tweak options as you need.
Now on the mac, click on run button in android studio, it will display the connected device.
Resource: http://www.geekygadgetworld.com/3303/enable-developer-option-samsung-galaxy-grand-duos
I spent a night fighting this problem with my Doogee DG350, which runs the Chinese MTK chipset which has issues with USB on OS X. I found the solution was to run ADB in TCP/IP mode and then connect wirelessly:
adb tcpip 5555
adb connect 192.168.1.10:5555
adb devices
it's actually a bonus, cos you can dispense with the USB cable and debug wirelessly. Not looking back
None of these things worked for me. I'm running 4.4.2 on an LG VS450PP, trying to connect to a Mac laptop running OS X 10.10.5. Neither MTP nor PTP worked at all, even after following all the suggestions listed here and elsewhere on SO. I only got the RSA message when I chose the Internet option from the USB settings (and then I chose Ethernet).
After that, it was golden.
The connection via tcpip has a potential to work. However, the port 5555 is probably not available. I know this can work because I have an app on my Android called "Synctunes Wireless" which syncs' my itunes on my desktop wirelessly via tcpip and using port 4444. So I used the ip address and this port showing on this app and I can see this device in my Eclipse. Only thing is that the device type is unknown so the "OK" button is still disabled. So this has potential to work. Just have to find the right port number or maybe something else that is missing.
If anyone still has this problem and looking for a solution, what helped me is to install Smart Switch app. After that my Samsung device finally showed up
So i did some research because the same thing happened to me.
If the simple solution doesn't work you should check if you installed knox when you first launch your phone.
If you did install knox the only way for you to activate usb debugging would be to reset your phone back to factory config in order to deactivate knox (aka not installing it again), apparently you don't have the option to unistall knox on recent phones.
I know it is ridiculous but do make sure your phone's got a SIM card!
To activate the USB debugging on Samsung Galaxy S go to Menu -> Settings -> Applications -> Development -> Check "USB debugging".

Control a desktop application using an android phone

I want to build an application where an android phone would control a desktop application.
I only need to send coordinates from the phone to the desktop when user's finger is on the phone screen.
But I am kinda confused on the networking side if i should use bluetooth, usb, or wifi (intranet).
I did some research on bluetooth, doing bluetooth socket programming on an android phone shouldn't be a problem, but on the desktop side there are only a few free SDK/library. any suggestion on what to use?
If I were to use USB/cable, What API on the android side I need to use?
I am actually more familiar with general socket programming (wifi), but I think it's going to be slow (correct me if Im wrong) so this would be my last option.
PS: I am using Java for the desktop application too
any suggestions on what method to use? or even maybe I should use .net on the desktop side?
Thanks
You might find the open source RemoteDroid app to be useful in creating your app. It may even do everything that you want.
The source code is here. You may need an svn client like TortoiseSVN in order to download it.
Wifi is probably the most supportable.
Bluetooth requires hardware and drivers on the PC side
USB would ordinarily seem like the most sensible if the wire isn't a problem, but the catch is that it requires that the user enable "USB debugging" on the phone, and have either the android SDK or equivalent functionality to the adb forward command installed, plus a compatible USB driver for the phone. If all that were the case, you'd just forward a port from the PC to the phone and have a pc program connect to that port on the loopback interface which will be forwarded to a service running on the phone.
It's possible you could do something piggybacked on the USB tethering capability of more recent releases to get you a network-over-usb that you could use to connect programs on the PC and phone, but you'd need modified PC drivers so that you don't actually push the PC's internet traffic through the phone (unless you mean to tether as well).

Categories

Resources