Is it possible to create android applications that can communicate with apps running on the computer through USB? Like some sort of reverse "adb forward".
it's possible using the adb interface. I'm not sure about the specifics, but there are apps that do it. One example would be PDAnet.
Related
Is it possible to enable/start bluetooth from command-line within the termux terminal on a non-rooted phone/tablet running Android 8?
Use case: Enable bluetooth and connect to my keyboard when I run termux.
I guess I could use tasker to achieve something similar but last time I used tasker, it has a significant impact on battery life.
Regards
No, this is not currently possible. Someone needs to do some android programming and make termux able to use the android bluetooth API.
See https://github.com/termux/termux-app/issues/235 for an open feature request.
Objective
I'm developing a custom app for internal use on a rooted android mini-pc.
The goal (between others... so...many...others...) is to be able to turn on and off a tv using the serial port embeeded on the tv.
I'm using an FTDI UART RS232 serial usb cable for it.
Status
The application is working right now, using an android library (serial-driver) i can communicate with the tv, but the problem is that the device asks for permissions every install (and sometimes, weirdly, again on the same device), so it needs to be improved.
Issue
Since the device doesn't have mouse or keyboard by default, when this happens someone has to click the buttons, and since the device is normally hidden behind the screen, it can be really annoying.
My two bits
This problem, i feel, can be solved by two methods, but i still haven't been able to make them work.
Since the device is rooted, i might be able to modify an unknown (to me) parameter that allows me to bypass the permission request. For this i have tried to make an intent filter for the usb device, and to rewrite the interface that controlls this behaviour, both without success. Is there a way to make this android version more lenient about permissions?
I use for other reasons SuperSU inside the app, so i can use the full width of the might shell power. Using this i've been trying to send commands manually to the device (/dev/bus/usb/00X/00Y), but this haven't worked. My theory is that it's beacuse of the permissions of the device path, but even doing an unhealthy chmod 777 i cannot have them working.
So, that's my problem right now. I hope someone here can help me.
Additional data
Running: Custom Android 4.4.2 (Cannot be changed)
Needs to be doable solely from within the apk (but it can use shell commands)
We don't have the manufacturer signature to install it as a system app
We can use only one app, so i cannot have another one to move this one to /sys/apps, and i don't know if an app can do that to itself.
using Busybox stty -F /dev/.../ returns "Operation not permitted"
I'm just testing the adb and I'm wondering if this is possible.
I mean, let's say I have adb installed on a aws instance, whatever the Ip it may be.
Then from there, I want to connect to my Android device via adb I don't know if adb connect can do the trick having the external Ip of the device.
From what I've learned, seems like it is possible, but it's kind of confusing.
Also, I see it's possible to connect without having the device rooted.
But most tutorials or examples are based on wifi, I just want to know if there is a workaround or even a command which can make this possible remotely.
Any ideas?
Thanks in advance!
I would try looking into Vysor. The main purpose of this tool is to be able to control an Android device remotely, but it also provides an option to share the adb connection to the device without a root. Its a powerful tool, that as many applications.
I'm thinking to develop a PC desktop program to get application setting from android phone, install/uninstall apk application, sync photos/videos/music and display a web content.
Initial thought is to use .Net to write desktop program and shell ADB tool to do installation and file copy on android phone. However seems like advanced feature of ADB only works on a rooted android phone.
Is there an communication interface between windows and android system? Based on an app called "Android Manager" by Mobile Action, it seems that it can pull out what apps are installed on the phone but seems like this cannot be done by ADB alone without root access.
I would like to do the transfer of information using USB cable. Any thoughts where to research on? Thanks much
If you want to use the USB cable you can only use ADB, but you can use ADB to set up a socket between your pc and the mobile device. Both sides can then connect to this socket and use it to transmit data.
We have made a device which can act as an USB host or slave and processes the data it receives. I want to use the Android phones to send the data to it via USB.
My research leads me to conclude that we cannot use Android devices in USB Host mode without modifying the hardware or OS. Doing so is not an option as this is going to be a commercially deployed device.
However, I couldn't find any information on using the Android phone as a slave. This is already technically possible because it can connect to the PC in a similar configuration. Can we do the same via an application? If so, any information on how to achieve this will be greatly appreciated. I have full access to our device's embedded system, so custom code there should not be a problem.
This is already technically possible
because it can connect to the PC in a
similar configuration.
Only for things baked into the firmware. Your SDK application cannot invent new Linux device drivers, nor does it have any access to the Android device side of the adb connection.
Can we do the same via an application?
Since you have not said what you are trying to do, this is impossible to answer in a definitive fashion.
Say, for example, the "device which can act as an USB host or slave and processes the data it receives" wants screenshots off of the Android device. That is eminently possible via adb, because adb has a protocol for that built in. All you would need to do is have your device connect to the Android device via the adb protocol and request screenshots, no different than does DDMS or hierarchyviewer.
So, I would look at the problem from a different perspective: if you can accomplish it via DDMS, you can do it via your custom device. If you can accomplish it via adb shell commands, you can do it via your custom device. If you cannot accomplish your goals via existing interfaces, though, since you have no way to invent new ones over USB, you will be stuck.
Conceivably, you could plug your custom device into a Bluetooth or WiFi dongle, then use those on Android for communication.