I currently have a Nexus One that I have communicating with Linux using the Android USB Open Accessory library. I have built a Linux application that I am able to send commands to an Android client application to perform tasks.
The problem I have is whenever the activity changes on the Nexus device I lose connection to the device. For example, if I send a dial command to Android from Linux the phone will call the Android dialer and make the call. After coming back from the call though, my Android application acts as if the USB cable is disconnected and I am no longer able to send it commands from Linux. I experience the same issue if, while in the Android application, I press the home button and then relaunch the client application.
Any ideas?
On the Nexus device have the Open Accessory connection run in a service.
That way the connection won't be killed when the activity is destroyed.
Related
I created a service on an Adroid TV and I'm currently trying to discover that service from another device using mDSN Service Discovery protocol. When I put the Discovery app on a 2nd device, it was able to detect the service on the 1st TV just fine. But if I put the Discovery app on an android emulator, it can't detect my service on the TV. From all the research I've done, it seems like each Android Emulator is in its own private network and can't really talk to any other devices. I'm not sure how to make this work and I found something that seems like a solution at this link Set IP Address for Android Emulator, except it didn't work on my machine. My emulator didn't have 2 ethernet interfaces like the example, after the bridging is done, I also lost Internet connection on my host machine. I'm at a loss of what to do. Is this even feasible to get my emulator to detect service on an actual device? If it is, then what am I doing wrong?
Using adb forward to make a port on the emulator accessible from the host
see more on James' Blog
I've got my rooted Android 4.4 device USB-plugged into my Windows laptop, and I can develop fine when they're on the same wifi network. As soon as I turn Wifi off on the tablet, it can't receive updates.
I don't need hot reloading, I just want to be able to update this app once or twice without a network.
Don't say adb reverse, 'cause it only works on Android 5+.
Android port forwarding can connect via USB, i have used in kit kat
http://www.codeproject.com/Articles/191930/Android-Usb-Port-Forwarding
If you have good internet connection, you can use ngrok and expose the port number 8081.
I started to investigate how to send via Wifi some commands to control an android device (Nexus 7 - rooted). So I created an UDP Server app in Android that simulates some buttons through KeyEvent class (for the moment I'm trying to send UDP messages from PC via Wifi to test).
The problem is that it only works within the app, if I open Google Music and I simulate increase volume the app close due to INJECT_EVENTS Permissions.
So at this point I need some ideas to proceed with this project and these are my different options:
Continue with Wifi communication and try to create a service able to skip system permission to simulate all Android buttons I want.
Try BT communication - maybe there is a way to communicate directly to the OS instead through an app.
Try USB communication - I know that through adb shell commands you can simulate all the buttons but...Is it possible to send adb commands from an arduino? Should it be only through USB or could it be via Wifi?
I'm avoiding Tasker/Autoshare solution as it's very slow for what I need.
I have a Huawei Ascend G700 smartphone. I connect it successfully every time with my laptop via Bluetooth. I have an android application of my own which sends data to a server running on PC via Bluetooth. Whenever I launch my application on my smartphone and try to connect it to the server (already up and running) via Bluetooth, it does not connect.
When I connect my smartphone with laptop via Bluetooth, the laptop automatically starts receiving the phone calls and I can answer them from there.
I tried but was unable to stop this thing from happening. What I suspect is that because Bluetooth channel is already engaged by that call receiving process! that is why my application cannot connect to the server running on PC. Is my suspicion correct? If it is, please help me in solving it.
I am using Android Studio for development.
I have a remote Android-powered device which I access using ADB over TCPIP. This device has a firewall so I need to enable specific ports for my need during development. I have enabled port 5555 so that ADB is able to connect there, but I don't find information which port is the Screen Capture using. At the moment when I press the button in Android Studio to get Screen Capture from the device, it opens a progress bar and never stops "loading".
I stop it by disconnecting ADB from command line.
I cannot connect over USB to this device so I don't know if it has even a restriction for providing capture (I read there is such restriction for some phones).