[Developement] Computer App to Control Phone

Search This thread

Billthe4th

Member
Apr 23, 2009
24
9
Bristol
OK, I had a little play around with your input method today and I really don't think it will work for controlling the phone realistically.

I made this small program which takes a number and a message (enclosed in quotes) from the command line and will send the keys to the phone to send the message. the adb input method is so slow and clumsy that it can take minutes to send a normal length txt.

The best way to make this kind of application would definitely be to make some sort of backend to run on the phone (like a VNC server as someone already suggested) and have the program on the PC communicate with that. This method has the advantage of not needing adb installed and possibly not even needing the usb cable...

The attached java app is actually quite fun, but really not practical for sending SMS!
 

Attachments

  • SendSMS.txt
    1.5 KB · Views: 24

giantcrazy

Senior Member
Sep 29, 2007
219
4
I'll give this one a bump - here's an app that I'd pay a few bucks for. I'm at a PC all day long, and being able to control my phone from my PC would be a Godsend.
 

Fnorder

Senior Member
Nov 8, 2008
153
327
Lake Vostok
I've been trying to get to the same goal through a different route and have a small perl webserver running on my g1. so far i can view / kill processes, browse the filesystems, and read SMS. Sending is another matter...I gave up on using input due to reliability

I've investigated the IPC system ( /dev/binder and /system/bin/service ) and there are a lot of things that can be done there (clipboard manipulation), however documentation is non-existant...from what I can tell sending an sms without gui input isn't possible, but I may be wrong.

Ideally I'd like to use Dynaloader in perl to make use of the c / c++ framewrk libraries, but have hit a snag with free time and reading the garbled functions in the libs.

On a related note, is it even possible to make a java app to automatically send an sms? If so, that could solve both our problems.
 
Last edited:

Billthe4th

Member
Apr 23, 2009
24
9
Bristol
I've been trying to get to the same goal through a different route and have a small perl webserver running on my g1. so far i can view / kill processes, browse the filesystems, and read SMS. Sending is another matter...I gave up on using input due to reliability

So your method would use a web browser on the computer to control the phone? I think someone just put an app on the market which does a similar thing:

http://www.cyrket.com/package/org.l6n.remand

unfortunately I can't try it until I get on wifi at home, but it sounds promising!

On a related note, is it even possible to make a java app to automatically send an sms? If so, that could solve both our problems.

Do you mean a Java app to run on the PC or the phone? Both are possible - see my previous post for a Java app to run on the PC to send SMS through adb.
 

smeyerhuky

Senior Member
Jan 26, 2009
115
11
So your method would use a web browser on the computer to control the phone? I think someone just put an app on the market which does a similar thing:

http://www.cyrket.com/package/org.l6n.remand

unfortunately I can't try it until I get on wifi at home, but it sounds promising!



Do you mean a Java app to run on the PC or the phone? Both are possible - see my previous post for a Java app to run on the PC to send SMS through adb.

Giving this a bump too... Even if this idea doesn't end up working over adb...
It would be a great way to root the magic after downgrading. due to the fact that it would need a way to enter in the commands on the terminal once in rc29... (if they can get a lower build to work on the magic)
check out the other , maybe you have some ideas...
http://xdaforums.com/showthread.php?p=3741507#post3741507
 

maxdamage2122

Senior Member
Nov 16, 2007
721
205
Theres a new app on the market called RemoteAndroid which allows you to control your android device through a web interface. Any one try it yet?

http://www.cyrket.com/asset/6187296318006995989

Edit: I'm a little slow and apparently can't read a couple posts up sorry.

Update: I just downloaded the app and in the about information it states, "Currently it only supports the ability to view your location, and to enable and disable GPS, but more is planned in the future."
 
Last edited:

Fnorder

Senior Member
Nov 8, 2008
153
327
Lake Vostok
So your method would use a web browser on the computer to control the phone? I think someone just put an app on the market which does a similar thing:

http://www.cyrket.com/package/org.l6n.remand

unfortunately I can't try it until I get on wifi at home, but it sounds promising!
Tried it, and it has several things going against it: lack of funtionality,
and its a Java(dalvik) app, which means slower/more resource intensive...and not easily extended. True, I'm biased toward perl, however using a scripting language would literally allow one to add complex functionality using a web form served by the daemon itself - if the core performs parse checks and enforces namespaces.

Do you mean a Java app to run on the PC or the phone? Both are possible - see my previous post for a Java app to run on the PC to send SMS through adb.
I meanta java/dalvik app on the phone, either to act as a helper spawned by the main app, or as a reference for sending sms without a dalvik app, adb, or bin/input.

I just found an automatic sms plugin for locale, so it's possible. No source, though.

As is now I can just load a firefox bookmark when I get home, no app or cables required - the phone autoconnects to wifi.
 

Fnorder

Senior Member
Nov 8, 2008
153
327
Lake Vostok
Here's another way to send that still relies on the fake-keyboard method, except it _doesn't_ 'type' the number or the message, it passes them as parameters. Unfortunately it still brings up the compose window, and requires 'enter' 'back' to send. I'm posting it as a shell script.

Code:
#!/system/bin/sh
base=/system
export CLASSPATH=$base/framework/am.jar
$base/bin/app_process $base/bin com.android.commands.am.Am start -a android.intent.action.SENDTO -n com.android.mms/.ui.ComposeMessageActivity -d smsto:$1 -e sms_body "$2";
sleep 2;
input keyevent 66;
input keyevent 4;
Usage:

./spewsms.sh 5551212 "I wish the NDK was out"

This should be faster, but will still pop things up in your face (making it bad for automation) and will probably die if the system is busy enough that 'enter' 'back' are sent before the compose window finishes rendering.

I'm starting to think writing a small dalvik app that has "android.permission.SEND_SMS" and publishes an open intent with 2 arguments (to, message) would be the quickest way to dispense with spawning windows and using input. I'm terrible at java, though :p
 
Last edited:

nicksen782

Member
Jan 28, 2009
23
3
@fnorder
I would download an app like you described. Maybe even pay a bit for a version with WiFi where the user would like join the local WiFi network and communicate with the application over IP.

BUMP again! :)
 

ccunningham83

Senior Member
Feb 13, 2009
234
1
Dallas
Just bringing it back from the dead....

Just wanted to see if anybody has made any progress on this. Came across it searching for something else. Sounds interesting.
 

Fnorder

Senior Member
Nov 8, 2008
153
327
Lake Vostok
Necrobump of doom!

I wrote a dalvik app to send an sms, using intent arguments, then exit. The commandline app for displaying threads and replying is fully functional so I'll be adding sms functionality to my http daemon.

As is it depends on debian's perl, I'll try to port DBI and DBD::SQLite to this port of perl to bionic: http://code.google.com/p/android-scripting/ (I'm not using the ASE API because it requires a java daemon and is very unfriendly to starting via commandline).

The sms sender app needs to be fixed a bit too, if anyone has advice it would be welcomed;
* It currently pops up onto the screen, which I can't seem to disable.
* It also needs to return some sort of value that perl can grok: I can't depend on traditional unix return codes it seems, so unless there's a better idea (that doesn't involve resource sucking java daemons) I'll probably have it spit out the result to a named pipe.
* Since I just created something that any monkey can use to "while : ; do /system/bin/am start -a android.intent.action.MAIN -n to.fnord.smsintent/.SMS -d 911 -e msg 'HAY IM WATCHING GAY PORNO'; done" I'll need to check the uid of the ppid. Is this possible?

Yeah, not a java coder. This was painful.