Idea: create a remote control for your android phone.
Why: I like listening music on my phone in a dock station with speakers connected. Now sometimes I want to turn the volume up/down, change the song, etc. So I need to unlock the phone, locate app that is playing music (Music player, internet radio app, etc.). Sometimes I manage to undock the phone or just mess something up and generally this s*cks.
So I would like to control my phone (on a data connection, not wifi) from the laptop (on wifi).
I had investigated couple of approaches and would like to get some recommendations on them:
Use XMPP. This is nice as there a lots of free XMPP services I can use. Two libraries (both based on smack) that I tried work just fine (Flow aSmack port and Beem smack port). I could automatically create new user on device and present some id/password combination that I (user) would enter on a desktop side to link both devices.
Use JXTA. Should be the next real deal but could be an overkill. I would imagine running a rendezvous&relay server somewhere (need to get hosting to work around firewall/NAT) and creating a peer group protected with password. Use device unique id and password (withing group) to link to the desktop application. (A great eBook explaining p2p and JXTA can be downloaded from here).
Use C2DM. Could be the answer, but notification delivery sometimes can take more then couple of seconds to deliver and there would be no feedback mechanism.
So far first solutions looks like a lot easier choice. Create custom extension or just create chat between both endpoints and use that for relaying commands/messages. But I wonder if I would be abusing XMPP system?
JXTA sounds great, but from all the reading I done it is apparent that it is designed for group communication and service sharing and not a solution for connecting two endpoints.
What do you guys think? I welcome all suggestions too.
UPDATE I do not want to remote to a phone and interactively control it. I want to establish a connection (socket connection) between laptop and phone even if both of them are on different networks secured behind firewalls, routers. With this I could define a protocol to issue commands to the phone (lower volume, mute, start app, etc.).
UPDATE 2 I'm giving JXTA a shot. It is a nice solution but lack of documentation is a bit of a downer. Got VPS FreeBSD server to test RDV/relay side of things. I keep updating this question further as it may be helpful for others.
UPDATE 3 Some more reading:
How to make two android devices to communicate through TCP
Connection between two computers without opening ports using a third computer
UPDATE 4
So far I did not have enough time to further continue my project. I did find an interesting project. At the moment project owners are re-writing their library, you can track their progress here.
why do not you try installing VNC server on machine and then use VNC client on laptop to access mobile
Mobile Shell (Mosh) maybe just the tool you are looking for. I have been looking for a good project to use Mosh, your idea seems pretty interesting :)
Related
I have been searching the net for some sort of explantation on how I would get started on coding this but I haven't found anything. I know about ports and streams and basic networking stuff in java but I just can't seem to find any resources describing how this can be translating to android. I looked through the android api (https://developer.android.com/training/connect-devices-wirelessly/) but I actually don't understand any of what is written on there.
Back to the question though. The app would simply do this basic function:
two or more people connected to the same network open the app
when opened , the app automatically scans for all the phones connected to the same network that have this app open
the app would then display the name of each phone with that app open connected to the same network on the screen(in activity main) as a simple array (the name of the phone would just be the bluetooth name a guess)
This might be too complex of a question to answer so If there are any resources such as videos, api, etc. , that describe this process that would be great
NsdManager will fulfill all your requirement. You have to first register the service on the network through NsdManager using IP and port. Then Discover and resolve that service from another end.
https://developer.android.com/reference/android/net/nsd/NsdManager
https://android.googlesource.com/platform/development/+/master/samples/training/NsdChat/src/com/example/android/nsdchat/NsdHelper.java
I have a web bot continuously scanning a web page for a certain string, and when it finds it, I want a notification to be sent to my phone. The web bot is written in Java, so what would be the best way to communicate the information? Is it SMS or perhaps Bluetooth? Thanks!
Edit: A little more information... I have an iPhone 5c and the distance between my phone and computer can be assumed to be short (as in in the same house)
You could have your phone constantly polling the web bot computer to see if it has any new notifications for it, or you could have your phone run a web server (assuming you are on the same network) and let the web bot contact it when it has something to share.
However, I suspect that you may find it easier to simply use one of the common mobile notification services such as:
https://aws.amazon.com/sns/
https://developers.google.com/cloud-messaging/
These have the advantage of working across mobiles, should have good examples and user forum etc, and most importantly are designed to work when you mobile is not actively running an app, so will likely be much more power efficient than a home grow solution.
I am trying to create a low latency method to use an android device as a secondary display for a PC. So far all I have found has been either wireless streaming, or a slow usb connection (i.e. using iDisplay).
However, I found a DSLR camera contoller app (https://play.google.com/store/apps/details?id=com.dslr.dashboard/) that is able to stream a live feed of the camera to an android display via USB. Would it be possible to edit the source code of this application so it can read the video output of PC via USB? If so, how would you go about this? Do you think that this would be a low latency alternative?
Thank you!
Lots of fantasy in your question. Have you ever seen a PC outputting data from one of its USB ports to another device? How are you supposed to do that? With a plain male-to-male USB cable, in case you find one? Sorry but things don't go that way. To transfer data (files, or a network) via USB between two computers you'd need some propietary/specific software. Of course, once you have acomplished that is technically possible to transfer files with the screen content. Buy you'd need to develop a software that would capture the computer screen, compress it in real time, and send it through USB with enough low latency to be usable. That's going to be resource intensive.
A better, easier approach would be, maybe, using some sort of remote desktop or VNC on the Android machine, with the computer acting as a server. At least far more feasible than trying to implement a similar protocol by yourself.
Sorry but what you are trying to achieve is flawed from the beginning.
My question isn't necessarily on how to do this - rather I'd really like to know where to start. I've made a program in Java that keeps track of a dart game. I have a core DartGame class and classes for the different games that inherit it. From there it keeps track of players, who's turn it is, the current score, etc. It works great now what I want to do is make it into an Android app. I have a server program on my computer that would link the running apps. I don't want a global server that can be accessed anywhere because I don't want to spend the money on a VPN server, so the server program would just run on my PC. An example of a similar type of server would be like the one used for AndroMouse which allows you to control the cursor on a PC with an Android device.
What is the best way to make the connection from the device to the PC? I'm not sure if it uses a MAC address or the WIFI from my router, or even Bluetooth is an option. I'm not really familiar with Android but I assume there would be some sort of Server/ServerSocket connection, but that requires an IP address and I'm not sure which one to use. Is it as simple as using the local IP from my router? Like I said I'll learn how to do it on my own, I'd just like to know what I need to learn before I spend a bunch of money on Android books. Thanks in advance.
If your pc and your device are in the same LAN, just create socket to communicate through wifi connection. Otherwise, you should choose bluetooth I think. I think the
If they are not in the same LAN, then it is a little bit difficult. MAC address is meaningless unless in LAN.
AndroMouse also uses bluetooth connection.
i'm doin my project in 8th sem telecomm engineering, and i'm plannin to create a DUPLEX(not confident whether it'd be full or half) communication app using bluetooth and wifi as channels,something more advanced than a simple walkie talkie, and i was wondering if this is possible for a one man army??? also i was wondering if it is possible to do so with android versions 2.2 and above... can i just program the bluetooth settings in app in such a way, that, it doesn't pop up for user permission to accept a voice message from the calling party??
and is there a possibility for creating multiple channels(one for Forward Voice Channel and one for Reverse Voice Channel) using bluetooth or wifi?? here's a list of few knowledge i possess:
JAVA: basics, done some gui in desktops, know some imp classes,only SE6...
WIRELESS COMMUNICATION: learning it this semester, stuff like how base station accepts incoming mobile station request and redirects it to dest, mostly 1g in our portions...
OPERATING SYSTEMS: general, looking forward to learning android and linux os...
C,C++,DSP,and SOME ELECTRONICS...
oh, and iwoul like to implement these well within 7 months duration...
people please ENLIGTHEN me with your wisdom and references to useful websites ASAP...
my THANKS AND WISHES to thee...:)
The first big problem i see is that on using wifi for this, and as i understood it is some sort of (advanced) walkie-talkie app with no rooter inbetween the communicating phones, you have to implement adhoc-wlan on your android device, which is not supported by android, so you will need a rooted device for that, and the implementation of adhoc-wlan on android is definitve possible (have a look at this code: http://code.google.com/p/android-wifi-tether/) but nothing easy (i have done it myself for an university project).
And you asked if you can avoid the permission pop-up for an incoming message, but on an android phone activating your bluetooth or pairing it with an other device will always ask for permission from the user.
I cant help about the multiple channels you were asking for.
As Answer to your big Question: "is it possible for a one man army?" i would say generelly yes, but it depends on how much other stuff you have to do. Since you were writing this is an project for university, i dont know if this is your only project and you can invest a lot of time in it. If so i guess it is possible, but it will be an quite big project and you should be willing to work yourself relativly deep into networking stuff.
On google.Code you can find some projects similar (at least the wifi part) to what you think about to do, take a look at them...