How to determine current CPU Speed? - Hero CDMA Q&A, Help & Troubleshooting

Hey there,
I'm wondering if my CPU is ramping up and stepping down appropriately. Is there an ADB command that can be ran at any time to see what the CPU speed is set to? I tried dumpsys but it wrapped my screen so fast I couldn't find anything. basically it took a dump on me literally. Should have expected that.
I'd like it to be in ADB as that way I can check when the screen is off and keep from interacting with the screen as I'm sure that would ramp it up to full speed. Thanks!!
****EDIT*****
Found what I was looking for from an ADB standpoint, although I would still like to know how to do it from DDMS also, as that tool is my new friend.
1. start a shell session (adb shell),
2. then run "cat /proc/cpuinfo" to get the BogoMIPS.
And then your good friend the up arrow to save some typing

Go into tools directory and just run ddms, not adb. Should open up a convenient window. Lotsa goodies in there.

i am interested in this as well, or maybe even an app that shows what the current clock is, like on windows mobile i used homescreen ++ to show in the system tray what the cpu was doing.
but then again, i used to watch that and obsess over it so maybe that's a bad idea

HeroMeng said:
Go into tools directory and just run ddms, not adb. Should open up a convenient window. Lotsa goodies in there.
Click to expand...
Click to collapse
Wow, what a wealth of cool info!
However, I'm still enough of a noob to this particular tool that I can't find the CPU speed. Can you steer me in the right direction HeroMeng or others? Thanks!!
****EDIT*****
Found what I was looking for from an ADB standpoint, although I would still like to know how to do it from DDMS also, as that tool is my new friend.
1. start a shell session (adb shell),
2. then run "cat /proc/cpuinfo" to get the BogoMIPS.
And then your good friend the up arrow to save some typing

awesome tip!

Related

[Developement] Computer App to Control Phone

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;

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...

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

Bluetooth Keyboard HID fix - HELP!

Hi I found this over at http://i-miss-erin.blogspot.com/2009/09/connect-bluetooth-keyboard-in-android.html and needed some help as to how to input the following code.
I have CM 5.0.4.1 with all the right things in the xbin folder. I have GScript and the Terminal Emulator (which I notice doesn't accept numbers!?!).
Is there a way of setting it up in GScript somehow so there is a simple shortcut I could place on my homescreen to make sure it runs easily if this doesn't set it up permanently?
Thanks in advance!! Paul.
# hciconfig
hci0: Type: UART
BD Address: 00:22:A5:B8:AD:65 ACL MTU: 1021:4 SCO MTU: 180:4
UP RUNNING PSCAN
RX bytes:8672 acl:98 sco:0 events:285 errors:0
TX bytes:3336 acl:102 sco:0 commands:89 errors:0
# hcitool dev
Devices:
hci0 00:22:A5:B8:AD:65
# hcitool scan
Scanning ...
00:1D:4F:A7:9A:49 Apple Wireless Keyboard
00:22:43:C6:5B:B9 daydreamer-0
00:18:C5:42:18:78 Erin-Nokia N73
# hidd --connect 00:1D:4F:A7:9A:49
# hcitool con
Connections:
< ACL 00:1D:4F:A7:9A:49 handle 1 state 1 lm MASTER
Here's my thread on the topic
http://forum.xda-developers.com/showthread.php?t=629416
TheMathMan said:
...and the Terminal Emulator (which I notice doesn't accept numbers!?!).
Click to expand...
Click to collapse
That's a limitation of the basic Terminal Emulator with soft keyboards. Get a real terminal emulator--I use a ConnectBot local session, and it's also a great SSH client, but Better Terminal for Magic is also popular. I don't know if there's an N1-specific version of the latter.
Silent Mobius - is the only thing I need to do the hidd connect bit?
Where would I run that from? Do I need to be in the xbin folder or will it "just work" from anywhere?
PS...
I can get all the hciconfig and hcitool scripts to run fine but when I try running the hidd bit it says hidd "not found" despite it being in /system/xbin
Ideas?
OK... finally got hidd recognised by deleting the .bin extension.
Now the problem is I get this error:
Can't open HIDP control socket: Operation not permitted
Anyone?
You need root access. su
I have root access.
I have set GScript to run it as root.
I also tried in Terminal running it as su.
Neither worked. Do I need to change permissions on anything or what? I'm lost now!!!
hidd needs to be executable, owned by root (I prefer it to be suid, but that's just me) Read through the thread in Accessories, it's pretty much all there.
Also, if you don't know that "file not found" means "the file isn't there" you probably aren't ready to be messing with standalone daemons. This is _very_ raw hack, expect problems that you need to be able to debug.
E.G. If you'd looked up what each command did, you'd know that only the hidd line is needed, if a command has the filename xxx.bin then running xxx is not going to execute it, etc etc
If you are trying to portray an all-knowing condescending show off then you do it well.
I'm well aware of what it means when it says file not found. I had moved hidd into the correct folder. Nowhere had it said to delete the .bin extension.
I imagine people come here to experiment and try new things and learn about Android and hacking and the programming side. This takes time and practice and patience.
Your comments are just rude and unhelpful I'm afraid. If you don't want to be constructive, don't comment at all.
TheMathMan said:
If you are trying to portray an all-knowing condescending show off then you do it well.
I'm well aware of what it means when it says file not found. I had moved hidd into the correct folder. Nowhere had it said to delete the .bin extension.
I imagine people come here to experiment and try new things and learn about Android and hacking and the programming side. This takes time and practice and patience.
Your comments are just rude and unhelpful I'm afraid. If you don't want to be constructive, don't comment at all.
Click to expand...
Click to collapse
I agree completely, everyone is a begginer at one point and its not like you can do anything a nandroid restore can't fix.
Hey I was the one that posted the thread explaining what I'd done so that anyone else who hadn't seen the wonderful explanation by Miss Erin could see what could be achieved.
Please remember that this is a developers' board. It is not unfair to expect people to do a little research rather than clamour for an expansive blow by blow. A simple Google for hidd, hcitool and hciscan would have told you a lot.
Pointing out that failing to make the connection between a commands' name and the execution of that command may indicate that you have some pretty basic stuff yet to learn isn't rude nor unfair.
And posting error messages expecting others to correct you without any indication of the will to research doesn't look good, neither does all caps "HELP" nor gratuitous exclamation points!!!
TheMathMan said:
If you are trying to portray an all-knowing condescending show off then you do it well.
I'm well aware of what it means when it says file not found. I had moved hidd into the correct folder. Nowhere had it said to delete the .bin extension.
I imagine people come here to experiment and try new things and learn about Android and hacking and the programming side. This takes time and practice and patience.
Your comments are just rude and unhelpful I'm afraid. If you don't want to be constructive, don't comment at all.
Click to expand...
Click to collapse
Apparently, others disagree but I don't think his comments were rude. I think he was trying to help you prevent getting in over your head. If you don't understand enough to call a binary that you just copied to your phone I would back up and read some basic Linux/Unix books.
I am also a noob to Android also but not to Linux/Unix. Seriously, though as people who come and read this and understand what's going on I think they'll agree he wasn't being rude. We're just trying to make sure you know how to swim before you go and jump in the deep end.
Something else that needs to be said is that everything here is bleeding edge stuff. You really need to understand what you're doing and not just blindly typing commands. Otherwise I think you're going to be well on your way to a brick.
Moved to Q&A

Help with ADB Commands

Hi, I backup my phone every couple weeks. I normally backup my phone by adb pull to my HDD on my PC. Not really crazy, but i guess im doing it so often im using more space on the HDD then i would like.
Each backup goes to a brand new separate folder. So thats a bunch of folders with many Gb of data and most of it is repeated information. I however have a bunch of new files in each new backup. Some previous backups cant be deleted because ive actually wiped my phone and information on those specific backups arnt in the newer backups.
What i want is a way to sync the /sdcard/ on my N6 to a folder on my F:\shamu_backup. By sync i mean it pulls new files that arnt in the F:\shamu_backup. That way i dont have to have repeated information in my backups. It can get tedious trying to find all the changes i've done and delete all the files i dont need from the previous backups.
Adb has a sync, but try as i might, i cant seem to get it to work.
adb sync /sdcard/ F:\shamu_backup
no go
adb sync /sdcard/
no go
adb sync F:\shamu_backup /sdcard/
no go
adb sync /sdcard/ -p F:/shamu_backup
no go
Anyway, i could go on but i guess my tries are fruitless. Maybe this command isnt even for what i want, so if their is something better then please let me know. Today i just made a backup to a separate folder because im done googling it for now, but id appreciate some help for the future.
It looks like it's host -> device
Code:
" adb sync [ <directory> ] - copy host->device only if changed\n"
" (-l means list but don't copy)\n"
" (see 'adb help all')\
lol, im not going to knock you for just repeating the documentation verbatim, however it would be awesome if you could give me some additional information that would actually help me. The first thing i did when i found out about the command was read that. I then did like 10min of googling. Some sites talk about it but its exactly like the documentation states. I haven't actually learned anything about the command from this thread....
It's not the documentation, it's the source code. There can't be more info than that.
https://android.googlesource.com/platform/system/core/+/android-6.0.1_r11/adb/
Just out of curiosity, was this page one of the locations you found in your ten minutes of searching? On XDA, we also have a search engine, and when used it sometimes comes up with marvelous things, like this tutorial. If you didn't try the search engine on the site, perhaps you should have, as the tutorial happened to also be featured on the XDA Portal (i.e. the XDA front page).
Unfortunately, I'm not sure you'll be able to get more information than this.
Ok, i would like to walk through one slowly. I would like to say thank you to both of you. You guys rock. It is frustrating, and i think my tone should have been better.
Moving on, I would like to say that by additional information i mean i would just love for someone to literally write out the command for me that actually works. I know this might sound insane but i cant actually get it to work. Ive done testing sessions on several occasions trying to get it to work and it just doesn't want to. Im clearly missing it, whatever im suppose to do it has gone straight over my head.
That guide is great that you posted but says nothing about the adb sync that im trying to do. No i did not explicitly search xda, i used google for several sites which did include several xda threads. I guess in response to:
"Just out of curiosity, was this page one of the locations you found in your ten minutes of searching? On XDA, we also have a search engine, and when used it sometimes comes up with marvelous things, like this tutorial. If you didn't try the search engine on the site, perhaps you should have, as the tutorial happened to also be featured on the XDA Portal (i.e. the XDA front page)."
I guess im just really stupid here, and im not being sarcastic. I have no clue where in that page where it talks about "adb sync" . I guess im asking you to treat me lower then you did above, and just show me? The location that i want to sync from my phone to pc is "/sdcard/" and the spot on my pc is "f:\shamu_backup".
and to show you guys im trying and not being lazy, (i really want your help...) i shall show you more of my guesses.
adb sync f:\shamu_backup /sdcard/
no dice
Looking at your tutorial, maybe your trying to say i was suppose to use shell... No dice:
adb shell sync f:\shamu_backup /sdcard/
no dice
maybe im suppose to put it in brackets?
adb sync [f:\shamu_backup /sdcard/]
no dice
adb sync [/sdcard/ f:shamu_backup]
no dice
Anywho, i would be really thankful if you guys could just write exactly what i need to write so as to not create any more confusion. I clearly have no idea how to use this command.
It's host to device, and not vice versa. It is used to push more files to the device, but only those that are missing or changed.

Categories

Resources