[Developement] Computer App to Control Phone

Search This thread

tubaking182

Senior Member
Mar 28, 2008
1,081
10
i know we have a few applications that allow us to use our phone's screen and keyboard to control our computer, and while it is cool, it's just not something that i have a use for currently. i was wondering if there were any apps that you know of that allow me to have a window on my comp that is my home screen on my phone and control things on the phone from the comp. i hate when i am working on my themes and i get 100 texts and i have to go from using the comp it using the phone and back and forth. WM had several apps like that and i loved them when i was running windows but now i run linux(ubuntu 8.10) and i would love to be able to type texts and run apps on my phone while using the computer keyboard.

i have looked through the market and can't seem to find anything on there and i was hoping someone could point me to one elsewhere or if i missed one on the market. thanks in advance
 

Attachments

  • keyevent.txt
    2 KB · Views: 56
  • Andcontrol.txt
    9.9 KB · Views: 64
Last edited:

mannyb

Senior Member
Dec 31, 2008
654
3
It would definitely be great to be able to type text messages and whatnot using the computer's keyboard and screen instead of that tiny little G1 keyboard.
 

tubaking182

Senior Member
Mar 28, 2008
1,081
10
or if there are some commands i can run from adb shell that would work too, all i have been able to figure out how to do is play an mp3 on the phone by typing the command. cool but not what i would like.
 

tubaking182

Senior Member
Mar 28, 2008
1,081
10
alright, for those that care i have figured out how to start an app on the phone by using the adb shell commands, and i can even start to compose a text if i do it correctly

to start the messaging app you need to type in the adb shell(or android terminal but the point is to be able to do it from the comp

adb shell
am start -a android.intent.action.MAIN -n com.android.mms/com.android.mms.ui.ConversationList

the above line brings up the conversation list to allow you to choose a list, but i have yet to figure out how to atually pick a convo from that page

to bring up the compose message to start a new text type in the following

am start -a android.intent.action.MAIN -n com.android.mms/com.android.mms.ui.ComposeMessageActivity

from there i can input the number to send the message to but not what i want the text to say,

input text <string> #that inputs a single word and no more after the word text

so if i were to type
'input text hello android' my phone would act as if i had just typed hello, this also works on the home screen to search your contacts. i am working on in[utting more than one word and also choosing your conversation from the comp
 

tubaking182

Senior Member
Mar 28, 2008
1,081
10
progress

i know i can start any app by knowing the commands for it now and typing it in. but for right now my main concern is getting a multi word string to appear in the text box. if i can get that then i just need to figure out how to attach "input keyevent 66" to it as well so it runs cleanly. key 66 is the enter key and i figured out several others along the way but i will list them later. i pulled the input file from the /system/bin directory and maybe someone else should have a look at it and figure out how to acheive multi word texts without placing "_" between all the words, cause right now that's where i'm at. i'm attaching the file for the guru's to take a look at. obviously it isn't saved as a .txt file on the phone but that's how i uploaded it to here.

CALLING THE ANDROID GURU'S TAKE A LOOK AT THIS
 
Last edited:

juangil

Senior Member
Jan 29, 2009
1,511
111
PhOeNiX ArIzOnA
just wanna drop this lines here, there is an app from motorola MPT Motorola Phone tools, and it does all that you want and more, the phone can be connected to the pc via USB or Bluetooth... you can send receive msg, phone calls, see and edit contacts, drop images, ringtones browse the files etc
 

kp126

Senior Member
Jul 27, 2008
82
0
just wanna drop this lines here, there is an app from motorola MPT Motorola Phone tools, and it does all that you want and more, the phone can be connected to the pc via USB or Bluetooth... you can send receive msg, phone calls, see and edit contacts, drop images, ringtones browse the files etc

Im not sure if you know that your posting in a forum dedicated to the G1/android but MPT supports, as the name would suggest, motorola phones only.

:)
 

tubaking182

Senior Member
Mar 28, 2008
1,081
10
just wanna drop this lines here, there is an app from motorola MPT Motorola Phone tools, and it does all that you want and more, the phone can be connected to the pc via USB or Bluetooth... you can send receive msg, phone calls, see and edit contacts, drop images, ringtones browse the files etc
does said program work with the G1? i can't imagine moto being nice and making a program that works for everyone else's phone
 

tubaking182

Senior Member
Mar 28, 2008
1,081
10
i know there's several out there for different phones, but nothing for android. hell i'd be satisfied if i could just have the emulator read from my phone and let me control it that way. right now i don't like what i have to do to send a text

input text hello
input keyevent 62
input text android
input keyevent 66

that is a whole lot of typing for a simple text that says "hello android" and then sends it
 
Last edited:

tubaking182

Senior Member
Mar 28, 2008
1,081
10
would it be possible to write a program that takes what you type and breaks it into one word or one letter segments and runs the proper keyevent for each charecter there?

from what i remember of my programming in java and visual basic from years ago is that it would basically be set to read an input and use a case method to say if $input=="hello" then adb shell input text hello. it would be easier i would assume to just break it down into words and place "adb keyevent 62" between each word to input the spaces, and at the end of the line of input you would have to have the code "input keyevent 66"

i have the keyevent mapped out for each button and such on the phone if anyone is interested. i will see what i can come up with on my own though for now
 

q426669

Senior Member
Sep 25, 2007
216
29
Chicago
Hope!

I would <3 who ever release's this in some form or another =)

I could really use an application that lets me use my phone from my computer. Preferably it'd show the desktop of the phone, and allow remote access to all the features.

I don't know if it's possible, but it sounds like some of you are progressing, so I hope for the best.

:D
 

tubaking182

Senior Member
Mar 28, 2008
1,081
10
that is the goal, but right now i think i want to just get a java script written by the end of the week next week that reads the key i press on the computer and inputs it into the phone. so i have a lot of relearning to do since i haven't written javascript in 4 years and even then it was just simple stuff to be run in a console. if someone wants to take whatever i get done and run with it to make a FREE APP then by all means. if i find my work in a paid app then you better hope the US gov't can't find you cause i'll be at your door ready to kick your ass.

i'm not sure how one would go about coding the computer to display the phone desktop, but however it gets done i would prefer it to be written in java so all users of linux, mac, and windows can use it.
 

tubaking182

Senior Member
Mar 28, 2008
1,081
10
alright i have found a program that allows me to display the phone screen on the computer using java *hooray* but it does not switch to landscape when the phone does, and i can't control the phone from the app. it was written so that people could do presentations with the phone instead of using the emulator. the gist of it is described here

http://groups.google.com/group/cw-android/browse_thread/thread/d2dbcabee6bcba1a

i have already emailed the developer asking politely to see the code and for permission to try and run with it to make the ideal app. at this point the only thing i could come up with would be to make a javascript that had a case for each key on the keyboard and when a key is pressed it sends the corresponding command(adb shell input keyevent ##) to the phone. this would work fine to use the arrow keys to control the phone, and i am not sure how to code the mouse into it yet. i will be waiting for a response from the dev hopefully he will give his permission and blessing for us to use the app.
 

nicksen782

Member
Jan 28, 2009
23
3
Tubaking182,

Perhaps I could offer some help. Brad Fitz has written a program that injects keys into the Linux input layer. Perhaps the source code to his project can help you. It appears to contain a key code map. Here is the link to his code:

http://github.com/bradfitz/android-misc/blob/master/type.pl

Also, here is a link to his live journal entry regarding his program.

http://brad.livejournal.com/2400054.html

All of this would be wonderful to have with my G1. I wish all involved the best of luck!
 
Last edited:

tubaking182

Senior Member
Mar 28, 2008
1,081
10
the developer of the program i posted gives his blessing but he claims what we are trying to do is impossible without certain firmware. he claims that android does not support remote control. i have already proven it can be done though but you have to use keyvalues instead of the mouse. i don't know much java, but i know i need a case switch that executes adb shell input keyevent when i press a key on the computer. if someone wants to tell me the proper syntax and java command to run a run a command then awesome i can write this up *hopfully* and start testing it.

would it work if i typed it as
int key = evt.getKeyCode();
switch (key){
case 65: run.exec(adb shell input keyevent 29);
break;

what would be the proper way to execute the adb command
 

brianb7590

Retired Forum Mod / Retired Recognized Developer
Nov 28, 2007
433
1
Sandy Springs, Georgia
the developer of the program i posted gives his blessing but he claims what we are trying to do is impossible without certain firmware. he claims that android does not support remote control. i have already proven it can be done though but you have to use keyvalues instead of the mouse. i don't know much java, but i know i need a case switch that executes adb shell input keyevent when i press a key on the computer. if someone wants to tell me the proper syntax and java command to run a run a command then awesome i can write this up *hopfully* and start testing it.

would it work if i typed it as
int key = evt.getKeyCode();
switch (key){
case 65: run.exec(adb shell input keyevent 29);
break;

what would be the proper way to execute the adb command

I've been doing Java for about 4 or 5 years now, nothing to fancy, but anyway,


Code:
int key = evt.getKeyCode();
switch (key)
{
case 65: 
Runtime.getRuntime().exec("adb shell input keyevent 29"); // I dont know if this is what you "run" variable is referring to. and you would need quotes around your command as it takes a String parameter.
break;