[Developement] Computer App to Control Phone - G1 Apps and Games

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

That would be cool. A VNC Server has already been ported to iPhone, so it's probably not too difficult for someone who knows what they're doing (i.e, not me =P)

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.

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.

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

Cool! nice progress. Maybe other Android intents can be used...

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

Cool. Once you figure out a bunch of commands, I could try making a user interface for it as a project...

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

juangil said:
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
Click to expand...
Click to collapse
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.

juangil said:
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
Click to expand...
Click to collapse
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

kp126 said:
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.
Click to expand...
Click to collapse
yeah I know, my bad.. just wanted to put an example of an app (that of course is only for motorola) for any1 wanting to do something like it

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

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

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.

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.

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.

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!

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

tubaking182 said:
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
Click to expand...
Click to collapse
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;

Related

Andriod version of "My Mobiler"

Is anyone going to made a "My Mobiler" type of application for the G1?
It was very nice to have it with my Wing.
i loved it on my Wing too. i miss it!
Please report this thread to Koush
As he already have Screenshot Application Relaying it to any IP Socket can make a Video Streaming of Onscreen on G1 then only Catching Mouse and Keyboard Events from PC to G1 is require and mapped and channels to Device can be done to Make such Applications
Bump!
Did anyone ever find an app that does anything remotely like this? I'd love to have this capability, since I'm near a desktop pretty much all day and could benefit greatly by responding to messages through a PC based console.
hetaldp said:
Please report this thread to Koush
As he already have Screenshot Application Relaying it to any IP Socket can make a Video Streaming of Onscreen on G1 then only Catching Mouse and Keyboard Events from PC to G1 is require and mapped and channels to Device can be done to Make such Applications
Click to expand...
Click to collapse
That sounds cool. Where can I find it?
Robb_in_hou said:
Is anyone going to make a "My Mobiler" type of application for the G1?
Click to expand...
Click to collapse
Someone, please do it! I used MyMobiler constantly on my previous WinMo phone (T-Mobile MDA). I would pay to have its equivalent for the Android T-Mobile G1. I haven't rooted my G1 (yet) but would absolutely do it if it was required for running a MyMobiler-like app.
Just think of it:
- Type text messages using your keyboard.
- View your mobile screen on your desktop.
- Control your mobile by using desktop keyboard and mouse.
- Copy/Cut/Paste text between mobile and desktop.
- Capture mobile screen.
- Drag and drop files to your mobile.
Reference: MyMobiler
i looked in to this a little for a project i am working on (Droid Explorer). I found that /dev/input/event1 is the touch events, /dev/input/event2 is the trackball events, /dev/input/event3 is the keyboard and buttons, i cant figure out what /dev/input/event0 and /dev/input/event4 are for.
I tried writing to the file with events that were "recorded" but was unable to write to it. That is as far as I got when I was looking in to it, I put it on the back burner for now.
This would definitely be awesome to get going
Hmm, im not a dev or anything but wouldn't it be somewhat easy to redirect the emulator in the SDK to use the phone instead of the files in the SDK?
camalot said:
i looked in to this a little for a project i am working on (Droid Explorer). I found that /dev/input/event1 is the touch events, /dev/input/event2 is the trackball events, /dev/input/event3 is the keyboard and buttons, i cant figure out what /dev/input/event0 and /dev/input/event4 are for.
I tried writing to the file with events that were "recorded" but was unable to write to it. That is as far as I got when I was looking in to it, I put it on the back burner for now.
Click to expand...
Click to collapse
i dont know if this can help u.
here is a VNC Server for android.
http://code.google.com/p/android-vnc-server/
it works realy slow so its not for daily use (and after a time of use, the android turns into a reboot), but i think in the sorcecode you can find something that can help u
Hey guys there is one now!
[Tool] Android Screencast (open-source)
http://forum.xda-developers.com/showthread.php?t=557717
Go search for mymobiler at code.google.com and vote for it.
I want something like this too and I can't root my phone...
Does the VNC Viewer work over USB? (On Windows Mobile it make a RNDIS connection over USB so I could use TCP/IP programs like Web/FTP/VNC Servers...)
MyMobiler for Android is good solution
For those who have used MyMobiler on WM, I just read on there website that MyMobiler now supports Android! I tested it and it works on my Inspire
http://mymobiler.com/ it is also listed in this froum http://forum.xda-developers.com/showthread.php?t=1230349
Direct Link http://mymobiler.com/?p=42

Need help writing an app.

I'm writing an app and I haven't used Java since high school so it is a bit rusty.
I created a Dialog box using AlertDialog.Builder and this prompts for input by the user. However, the program keeps going while this is open. How do I make it so that the application pauses while this dialogue box is open? I can't figure it out. When I included a Thread.sleep() function the application didn't seem to do anything.
Anybody have an idea?
more of a bump than anything, but what about a while class, while the input box it up then app sleep. i haven't really touched java since highschool so i don't remember much either, i am trying to get back in just so i can write a simple app to run the most commonly used scripts, similar to droid sans tweak tools but with more scripts. hopefully i gave you some idea of what to do
I got around the issue by using an XML type interface instead of a dialogue box. Thanks anyway
Right now I'm trying to edit wpa_supplicant.conf through my program. I copy it to the SDcard so that I have a backup, but I'm unable to actually edit the file thats on the sdcard. I'm able to create it if its not there with the input I want, but I'm not able to edit the exiting file. Anyone have any suggestions?

Better Terminal Emulator Magic

Just showed up in the market. Awesome works the 1.5 soft keyboard. Has its quirks but does have some good uses, an update was put out this morning to fix the enter key problem.
great find! it's so hard to sort through the **** apps these days. can't wait until we get a well needed market update.
Just to let people know they have a message saying it doesn't work on some modified Roms. I'm on 6.0h and it didnt work for me. it went into a force close loop even when i wasnt using it.
Its a step in the right direction, but its not all there quite yet. VERY HELPFUL though
1) There is a problem getting the <enter> key working. I find that I need to roll around the scroll button a bit before the enter key will work after starting or switching users.
** another way to deal with this is to use a different shell. For some reason, using full bash instead of sh works. There are other (great) advantages to this (more on that later).
2) You can't see what you're typing when in landscape mode, which is the only way that the VK is actually practical -- keys are too small to use effectively in portrait.
3) If you use a colored shell, the colors screw up when switching to/from the vk. Must be something to do with how he's buffering and redrawing the console.
On using bash instead of sh...
Advantages:
1) color
2) BASH HISTORY
3) scroll wheel = arrow keys
4) lots more -- http://en.wikipedia.org/wiki/Bash
How:
copy bash into some executable part of the filesystem
create a bashrc file anywhere at all in the filesystem.
put in your bashrc the following:
Code:
PS1="[\w]\\$ "
HISTFILE=/some/path/file/with/write/permissions
** this is of course a regular shell script, so add whatever startup code you like in there, like a custom PATH, etc.
IN the "better terminal emulator" program, menu --> preferences --> command line and set it to "/path/to/bash --rcfile /path/to/bashrc"
And of course, running the following:
Code:
su -c "/path/to/bash --rcfile /path/to/bashrc"
will give you root with bash and the same setup as your regular user, including a shared history file (note that the history file is only updated when bash EXITS and so it is current as of the moment you initially LAUNCHED the terminal app.
Note: I like to write that su -c line into a wrapper I call "subash" that I place in the path.
bash is attached for convenience, its a .tar.gz file with an extra extension to confuse the newbs (and trick the forum filter into allowing it).
@lbcoder
Thanks Great tip!
@lbcoder
Thanks Great tip!
using bash as default shell
Id love to use bash, its the shell im used to and since Im not that good at *nix having bash would help, 1 cyanogen rom had ash(i think) and then none of the scripts floating around worked and so they needed to be edited(something that sounds a bit tedious)
Id also like a decent prompt, maybe color ls and all those bells and whistles, I think this could be well received with all the bugs worked out and maybe a script that would make any scripts found on the device into a format that bash needs...
the biggest is the lack of history, I have used a good variety of linux and unix shells and droids is the first without cmd history, a prompt with 'pwd' and tab auto complete...
cant we just get a REAL shell, is that so wrong?
bhang
Job Control
lbcoder said:
On using bash instead of sh...
Advantages:
1) color
2) BASH HISTORY
3) scroll wheel = arrow keys
4) lots more ...
Click to expand...
Click to collapse
Very nice and very useful. Thanks for providing this!
One feature lost in this build of bash: Job Control (^Z, jobs, fg, bg, and %number commands to manipulate jobs). Hitting Ctrl-Z suspends the bash shell and all its child processes.
The existing sh shell supports job control. This build of bash does not.
I'm going to have to learn how to set up a cross-compilation environment. Another project to add to the list...

Can You Backup Wifi Settings?

I like to whipe periodically for that fresh g1 feel and smoothness, only reason I hate doing it is that I have to manually punch in my WEP code for the wifi over and over again. It's an annoyance I would love to get rid of. I've tried a few backup apps, none do it though. Anyone know of a specific app that does, or a way I can do it through term/adb? Any way?
I'm sure there is a way to pull the wifi settings data from the system somehow but I've actually found a gscript which I edited a little that goes through and calls the settings screen, turns on wifi, clicks on the topmost network available (assuming youre near the one you want to connect) and enters the WEP key as defined in the gscript code.
You may be able to find it in the 'useful gscipt' thread that was around on xda but if not, I can post mine (edited of course) as soon as my g1 gets done flashing the latest CM rom. :]
EDIT: Here you go put this in gscript or make an empty txt document, paste the following, edit the bold type to reflect your WEP key, save as setupwifi.sh file and run through terminal "sh setupwifi.sh"
***Requires root / 'su' *** either way you run it.
setupwifi.sh said:
am start -a android.intent.action.MAIN -n com.android.settings/com.android.settings.Settings
sleep 1
input keyevent 20
input keyevent 23
sleep 1
input keyevent 23
input keyevent 20
input keyevent 23
input keyevent 20
input keyevent 20
input keyevent 23
sleep 1
input text CHANGE THIS TO WHATEVER YOUR WEP KEY IS
input keyevent 20
input keyevent 20
input keyevent 21
input keyevent 23
input keyevent 3
Click to expand...
Click to collapse
Just make sure your wifi is turned off for the purpose of this script, since first thing it does is go to settings, clicks wireles, turns on wifi. If you had the wifi on and ran this script, it'll turn off and script will sort of go haywire. No damage but just it wont do what its inteded to do.
It's actually fun to watch your phone do things on it's own and press keys and all that. If you want more details on what each of the keyevent's do, just find the GScript thread and its all in there.
Hello! Sorry for bringing this thread back up. But, before anyone gets angry at me, I'm sorry in advance... I did use the search (trust me, I'm in love with it) and didn't have any luck finding anything other than this.
Anyways, just had a small question: let's say I don't know the wep key because my admin at work put it in for me (they wont share it) but I don't want to ask him every time I flash a rom for it again and again. So I was wondering if the script below would make my device pull the inputted wep key from the device and memorize it after every flash or does it only work if the wep key is inserted?
Is there maybe an app that can just backup data (including wifi wep keys)? or another script that shows you the currently inputted wep key on my device that my admin types in it?
When I had my blackberry the desktop manager backup system would save the wifi wepkeys, don't know why Google wont synchronize settings, data, apps, and wep keys but I guess to each it's own.
I have a T-mobile USA G1
Thank you.
prash said:
I'm sure there is a way to pull the wifi settings data from the system somehow but I've actually found a gscript which I edited a little that goes through and calls the settings screen, turns on wifi, clicks on the topmost network available (assuming youre near the one you want to connect) and enters the WEP key as defined in the gscript code.
You may be able to find it in the 'useful gscipt' thread that was around on xda but if not, I can post mine (edited of course) as soon as my g1 gets done flashing the latest CM rom. :]
EDIT: Here you go put this in gscript or make an empty txt document, paste the following, edit the bold type to reflect your WEP key, save as setupwifi.sh file and run through terminal "sh setupwifi.sh"
***Requires root / 'su' *** either way you run it.
Just make sure your wifi is turned off for the purpose of this script, since first thing it does is go to settings, clicks wireles, turns on wifi. If you had the wifi on and ran this script, it'll turn off and script will sort of go haywire. No damage but just it wont do what its inteded to do.
It's actually fun to watch your phone do things on it's own and press keys and all that. If you want more details on what each of the keyevent's do, just find the GScript thread and its all in there.
Click to expand...
Click to collapse
Wifi settings are located here:
Code:
/data/misc/wifi/wpa_supplicant.conf
Copy the .conf file to a safe place before you wipe and install a new ROM and then push it back using ADB or place it on your sdcard and push it back using terminal.
With this method, there is no way to see what the key is, but then again, you don't have to because once you push the file back, all your data is remembered.
DirectMatrix said:
Wifi settings are located here:
Code:
/data/misc/wifi/wpa_supplicant.conf
Copy the .conf file to a safe place before you wipe and install a new ROM and then push it back using ADB or place it on your sdcard and push it back using terminal.
With this method, there is no way to see what the key is, but then again, you don't have to because once you push the file back, all your data is remembered.
Click to expand...
Click to collapse
Just open wpa_supplicant.conf with notepad on PC and whoops your wep key is there.
Write it on paper and make tatoo of it on your leg
Edit:
Solution(s) witouth PC
Or open it with TxTPad Lite (free on market) directly on phone and read it
Upload wpa_supplicant.conf to dropbox with droidbox free

General question to scripting coupled to key sequence ...

Hi All,
I am trying to learn how a script could be started in Better Terminal Emulator Pro by hitting a key sequence:
Let's assume pressing the ball key of my G1 and the key '1' simultaneously should run / invoke a script which contains a "netcat" command sequence to a telnet server. The telnet server is an empedded system controlling several I/O's (relais) in my home, e.g. to open my automatic garage door controlled by the embedded system.
This works already really nice with the nc command of busybox typed in from a command line in Better Terminal Pro.
But now I would like to set up a several different scripts - each for a different port in the embedded system to communicate to over Internet connection.
Any expert around who knows how to bind/link/invoke a script to/from a key sequence hit ?
Any help is pretty much appreciated.
Best regards
Not really an answer to your question (cuz I have no idea about the keybinding thing) but...
If you read this thread http://forum.xda-developers.com/showthread.php?t=538830&highlight=system+binaries it will help you set up a /usr/bin linked to /system/sd/bin for you to put your scripts in. This will. Allow you to easily invoke any script you write. Personally I put my home connection script here and in gscript so I can execute it via command line or graphically.
Hi dumfuq,
very good hint. Definitely some sophisticated stuff for a Linux newbie like me, but I think, this could be part of the solution ...!
Regards

Categories

Resources