yashsingh1/xdaforums huggingface dataset:
[General Topics] brenow:
How do I enable/disable 'automatic update' from GPSXtra and from Quick GPS programmatically (C#) ?

This is possible? There are other alternatives?

// Moderator, please, change this thread for windows mobile development section. Thanks in advance.
[HD2 General] x-mann:
http://www.htcmania.com/showthread.php?t=101238

Well, if there is double post about this, admins plz delete this 1.

By the way u can use google translator to translate this page.
[HD2 General] Archer:
It actually says in the second sentence that it gets this information from XDA developers.

http://xdaforums.com/showthread.php?t=637889
[HD2 General] dkb218:
Okay, I have a question...

Why the gosh darn heck would anyone want W95 on their device?:confused:
[HD2 General] samsamuel:
for the best reason there is to do anything ,,,,,,,,, just to see if you can.
[G1 Android Development] Firerat:
don't rely on rwsystem and rosystem scripts, they are often broken, don't have hash bangs and have dos eol

instead use

busybox mount rw,remount /system

I would also point out that you don't need to use recursion ( -r ) this is only required if you wish to delete a directory

having said that you *should* be using recursion

but here

you are unziping to the root of the SD card, and then only deleting the two files

you are expecting

better to unzip into a new directory, and then delete the directory after

( therefore you do not leave anything unexpected behind )

being a script , you should probably check to see tf what you expect exists

with

it looks like you are pulling from the internet, are you checking it in anyway?

the download could be corrupt, it won't unzip and you end up flashing something that is on the root of the sdcard and just happens to have the same name...

it is inviting trouble........... and one day trouble may just turn up
[G1 Android Development] olearyp:
I also don't believe that permission sticks between calls to Runtime.exec(), which means each call is individually responsible for obtaining root permission. Additionally, if one of your calls goes wrong, there's no way to check it, alert the user, and bail out. You might be better off writing a shell script to do this, then calling on that--how important is a UI? Plus everything Firerat said.
[G1 Android Development] lbcoder:
***BINGO!!!!

That definitely will be a problem.

The call to the su command is restricted to the particular shell that it was executed within!

BTW: That program won't be getting on my su whitelist.... looks extremely dangerous!
[G1 Android Development] zezol:
Many thanks guys! It works, but not quite...

I leave the su command at the beginning of the code.

My commands:

runtime.exec("mkdir /sdcard/switch_rh");
runtime.exec("unzip -o /sdcard/rhpack.zip -d /sdcard/switch_rh/");
runtime.exec("su busybox mount rw,remount /system");
runtime.exec("su flash_image boot /sdcard/switch_rh/2.img");
runtime.exec("su cp /sdcard/switch_rh/2.ko /system/lib/modules/wlan.ko");
runtime.exec("su busybox mount ro,remount /system");
runtime.exec("rm -r /sdcard/switch_rh");
runtime.exec("reboot");

Now in the logs returns to me something like this:

03-26 17:23:27.774: WARN/su(743): request rejected (0:0->0:0 /system/bin/sh)
03-26 17:23:27.804: WARN/su(745): request rejected (0:0->0:0 /system/bin/sh)
03-26 17:23:27.814: WARN/su(744): request rejected (0:0->0:0 /system/bin/sh)
03-26 17:23:27.814: WARN/su(746): request rejected (0:0->0:0 /system/bin/sh)

It's strange...
[G1 Android Development] Firerat:
maybe its my fault, slight omission with the mount code

if its a program your not familiar with ,

less it,

if that don't tell you anything, and you have no real reason to not trust it, run it with --help

or man cmd

all of those will tell you that I was a muppet and forgot to type -o

busybox mount -o rw,remount /system

but that doesn't have anything to do with your error

what's so special about this anyway, why wouldn't a simple shell script do?
[G1 Android Development] olearyp:
$ su -c "[I]command[/I]"
[G1 Android Development] zezol:
runtime.exec("su -c busybox mount -o rw,remount /system");
runtime.exec("su -c flash_image boot /sdcard/switch_rh/2.img");
runtime.exec("su -c cp /sdcard/switch_rh/2.ko /system/lib/modules/wlan.ko");
runtime.exec("su -c busybox mount -o ro,remount /system");

Log:

03-26 19:00:21.004: WARN/su(711): request rejected (0:0->0:0 busybox)
03-26 19:00:21.064: WARN/su(713): request rejected (0:0->0:0 cp)
03-26 19:00:21.094: WARN/su(712): request rejected (0:0->0:0 flash_image)
03-26 19:00:21.134: WARN/su(714): request rejected (0:0->0:0 busybox)

:/

Since I am a beginner and I learn programming with Java and Android. Secondly, I want to write a simple app for a friend (and my satisfaction) who does ROM for G1 :)
[G1 Android Development] Firerat:
:)

now tbh , I need to learn this java stuff myself, only done a tiny bit of tweaking so far.

Anyway,

as mentioned above it should be

su -c "command"

at least that is what it would be on a standard shell

I belive something like this would be more suitable for you

runtime.exec("su -c 'command'");

for now I would forget about mounting and just figure out who I am

runtime.exec("whoami");

just to see if it works

then

runtime.exec("IAM=`whoami`;echo $IAM")

runtime.exec("id");
runtime.exec("id -u");
runtime.exec("expr `id -u` + `id -u`");
runtime.exec("su -c 'id'");
runtime.exec("su -c 'id -u'");
runtime.exec("su -c 'expr `id -u` + `id -u`'");

hope it helps
[G1 Android Development] olearyp:
That's actually progress. Note how the correct things are being rejected now. Make sure your SU Permissions blacklists aren't blocking your own program. And Firerat's advice to build up to what you want is also sound.

So the other problem you're going to run into once you get that figured out (sorry I didn't think of this sooner) is that the calls to Runtime.exec() are non-blocking, which means that the code you wrote will end up trying to run every line simultaneously. The quick hack to fix that is to capture the Process that is returned by the call to .exec to a variable (say, "p") then call p.waitFor() after every line.

Unfortunately, you will quickly be met by an FC/Wait dialog if you do this then try to interact with your phone, because your code (presumably) is trying to run in the UI thread.

There are a couple of solutions to this problem that I've used. The original implementation of GUSTO (previous to v0.5) used an AsyncTask to thread out the Runtime.exec() calls; the current implementation uses an IntentServer for better user experience.
[G1 Android Development] MaloventEvil:
Sorry for the bump, but I am a bit confused about this... I am trying the following:

Process p = null;
final Runtime runtime = Runtime.getRuntime();
try {
p = runtime.exec("su -c 'mount -o rw,remount /system'");
p.waitFor();

p = runtime.exec("su -c 'mkdir /system/bin/test'");
p.waitFor();
}
catch (Exception e) {
e.printStackTrace();
}

But nothing happens... Do I HAVE to have busybox installed? am i not allowed to use the built in commands?

I tried running it in the emulator with logcat running but it denied root permissions (no dialog was prompted) and on my rooted evo4g (was prompted for root permissions and allowed it). As a sidenote, is there anything I can use to get logging output from my production phone?

Thanks much in advance!
[G1 Android Development] thesk8mafia:
how did you solve your problem?

I'm trying to execute root commands from an app too but to move files to the /system but I'm getting an "su rejected" error, please help
[G1 Android Development] Firerat:
post source code
[G1 Android Development] billc.cn:
Just to say that DataOutputStream.writeBytes(string) only writes one byte for each char, so if you're dealing with Unicode strings, you'd better use some better class.

Also note that you can check the return code of your command through

echo $?
[G1 Android Development] Firerat:
Meh, we already told the op what they were doing was wrong

thesk8mafia just bumped it with their lame question.
[G1 Android Development] hrk:
You are right, I got a bit "Mr. Teacher" there seeing that the last post from the op was still in a sucky state...

I hope the informations I wrote will be more useful than the "Mr. Teacher" attitude I used. :-)
[G1 Android Development] jimmy06:
Hello,

I'm developing an application (Widgetsoïd on market) who have widgets switcher.

I put a button to reboot phone but now I would like to put options to reboot in recovery and bootloader mode.

My problem is to execute command I use this for reboot :

String command = "su -c reboot";
Process p = Runtime.getRuntime().exec(command);
if(p.waitFor()==127 || p.waitFor()==255){
message.show();
}

I know to reboot into mode i have to add "reboot recovery" or "reboot bootloader" but command doesn't execute.

I try

String command = "su -c reboot recovery";
Process p = Runtime.getRuntime().exec(command);
if(p.waitFor()==127 || p.waitFor()==255){
message.show();
}

or

String command = "su -c 'reboot recovery'";
Process p = Runtime.getRuntime().exec(command);
if(p.waitFor()==127 || p.waitFor()==255){
message.show();
}

But the first make a simple reboot and the second make nothing.

Can you help me please?

Cheers

Jim
[G1 Android Development] jimmy06:
I found a solution

String[] str ={"su","-c","reboot recovery"};
Process p = Runtime.getRuntime().exec(str);
if(p.waitFor()==127 || p.waitFor()==255){
message.show();
}

It's work correctly.

Cheers
[G1 Android Development] vAlmaraz:
I have tried this but it doesn't work for me (it works but app forces close because of an ANR).

I have found a solution that may help other people:

try {
// You previously found out which is the right path for the su binary,
// being it /system/bin/su or /system/xbin/su
Process suProcess = Runtime.getRuntime().exec(suBinaryPath);
DataOutputStream dos = new DataOutputStream(suProcess.getOutputStream());
dos.writeBytes("flash_image boot " + sdcardPath + "2.img\n");
dos.flush();
dos.writeBytes("cp " +sdcardPath + "2.ko /system/lib/modules/wlan.ko\n");
dos.flush();
dos.writeBytes("exit\n");
dos.flush();
[COLOR="Red"]dos.close();[/COLOR]
suProcess.waitFor();
} catch (Exception ex) {
// Please do something, don't let Exceptions be raised and silently trapped.
}
[G1 Android Development] blakegriplingph:
Hope you don't mind if I use this, but I needed a quick and dirty way for me to issue commands progmatically on an app I cobbled up to fix issues with my phone. And don't worry, I do have an idea of what the code does so as not to give the impression that I'm merely pasting yours into my app.
[Touch Pro2, Tilt 2 Themes and Apps] titillo82:
I have found this game on the link below,GLTron, it's from the movie TRON from 1982, sequel is comming up this year.

My brother was able to find a version of the game for his Nokia N900. So I was wondering if anyone knows if there is a version of the game for winmo or if anyone could create a version for it. the game is a freeware version for different platforms.

gltron.org

Thanks!
[Touch Pro2, Tilt 2 Themes and Apps] acidbath5546:
Not that I have ever seen....Sorry.
[Click General] Bikers:
i don't know if it's ok what I'm saying here, but I'll give it a try...

I have internet on my mobile, but mostly I live from open wifi conections.

in my house there is only one conection and it's secured. because i download aplications and stuff when I'm home this makes me want to conect to this wifi. is there a method to do it? if it's the one that involves me asking people, i did some searching and nothing...
[Click General] ThaRabbit:
Connecting to secured wifi is no problem... unless, and i assume this to be the case, it's not your WiFi or you don't have the passkeys?

There are no effective WiFi sniffers / packet analyzers on android to speak of. Those tools have not been ported due to the fact that the drivers created for the wireless chipsets do not support monitor mode. A custom driver would have to be written before porting these tools can have any usefull outcome.
[HD2 General] killergt1:
How can I get this program to run? It opens a window which u cannot close (otherwise it exits the program), then it opens another window that is the actual program (Scott stream) for stocks.

Details aside, I need to know if it would be possible to get this program to run on the HD2. the program uses the latest Java.

Thanks,

Killergt1 (an HD2 newbie)
[Android Software/Hacking General [Developers Only]] electroqp:
Hello

is that I can install a rom on my HTC hero on my samsung galaxy.

I saw that it was possible to exchange htc rom.

Sorry for my English is translated by google translate
[Android Software/Hacking General [Developers Only]] JR_de:
No you can"t, but there is a Galaxy ROM with HTC Sense: http://forum.hdblog.it/showthread.php?t=4267
[HTC Wings] strooja:
I have s710 but I really liked wallpapers and backgrounds at my s730. Could someone, please, upload them and post links?
[Hero CDMA Themes and Apps] ajaholic:
is there anyway you can save attachments in gmail to the SD card through the app. this is driving me mad.
[Hero CDMA Themes and Apps] abcdfv:
Pretty sure you have to Preview it, then save it.
[Hero CDMA Themes and Apps] ajaholic:
when i try open a zip file using preview it just opens up my file manager then crashes..
[Hero CDMA Themes and Apps] Patb8man:
Theres a free app called Blackmoon attach save lite that will do the trick..
[Hero CDMA Themes and Apps] notasimpleway:
My problem mostly is with the mail app. It never downloads the attachments. I always get "attachment is corrupt." But then I fwd it to gmail and open it right up.
[G1 General] Vadimus_ca:
Regardless of ROM used, I always see this line in logcat:

D/GpsLocationProvider( 162): NetworkThread out of wake loop
D/GpsLocationProvider( 162): Requesting time from NTP server north-america.pool.ntp.org
D/SntpClient( 162): request time failed: java.net.SocketTimeoutException: The operation timed out
D/GpsLocationProvider( 162): requestTime failed
D/GpsLocationProvider( 162): NetworkThread wait for 300000ms

north-america.pool.ntp.org host always appears to be dead, so is there any way to change it to something alive? Like pool.ntp.org?

Time sync is quite important as GPS fix delay depends on it.
[G1 General] Jugstah:
As you are in canada, try ca.pool.ntp.org.

For what its worth my time even w/o a sim always set itself over wifi. But i have not checked the logs. Is ntp configurable via the gui somewhere?
[G1 General] happyface_0:
Thanks for pointing this out, I need to change my router's NTP server now.

I'm trying to find where time server hostnames are kept. For now you could do a simple /etc/hosts hack and reroute that hostname to a working NTP server.

EDIT: It's in /system/etc/gps.conf
[G1 General] Vadimus_ca:
grep rules, found it in /system/etc/gps.conf:

NTP_SERVER=[COLOR="Red"]north-america.pool.ntp.org[/COLOR]
XTRA_SERVER_1=http://xtra1.gpsonextra.net/xtra.bin
XTRA_SERVER_2=http://xtra2.gpsonextra.net/xtra.bin
XTRA_SERVER_3=http://xtra3.gpsonextra.net/xtra.bin
SUPL_HOST=supl.google.com
SUPL_PORT=7276
[G1 General] happyface_0:
Yea a bit late for that, but two is better than 1 I guess.

If anyone wants to do the fix easily just do:

mount -o rw,remount -t rootfs /
sed -i 's/north-america.//g' /system/etc/gps.conf

in a terminal or:

adb remount
adb shell sed -i 's/north-america.//g' /system/etc/gps.conf

with adb

Requires a reboot
[G1 General] Vadimus_ca:
Great! I had to pull it out, edit and push it back.

By the way is there any way to use cursor keys in vi either in terminal emulator on the phone, or using adb shell? First does not have keys, second does not follow ANSI emulation...
[G1 General] olearyp:
I know that in a ConnectBot terminal (including local), the trackball maps to the cursor keys, which works fine in vi. Your terminal of choice may vary.
[G1 General] Vadimus_ca:
Thanks, I will try it!
[G1 General] Super Jamie:
That is pretty weird, the hostname "north-america.pool.ntp.org" is not a single server but rather a load-balanced virtual host to many different servers in a pool - currently over 600 servers!

The likelihood of all them being down is probably impossible, I wonder if this is something like your provider restricting certain ports for network security? If you are running DroidWall, NTP works over port 123 so that will need to be open. Did changing to another server fix it?

You can see the list of server pools here http://www.pool.ntp.org/en/, you can use just pool.ntp.org or specify by continent or even country. Here in Australia I use au.pool.ntp.org for all my Linux machines, now I will use it on my phone too :)

Also, Root Explorer paid app includes a text editor, I find that's the easiest way to edit config files on the fly.
[Nexus One Themes and Apps] britoso:
Transparent Music Widget.

Replaces one file in Music.apk.

Needs Root.

Apply with MetaMorph.

Should work with any high density android. Tested on a NexusOne.

Screenshot and .zip attached.

Enjoy!

Updates:

5/9/10 added XML for the new MM
[Nexus One Themes and Apps] frankzua77:
!!

____________________

whoa that was fast! lol :D thanks!
[Nexus One Themes and Apps] frankzua77:
!!

Request: Hey Britoso can you make the calendar, google search, and youtube widget transparents?? :D is it possible?? :D
[Nexus One Themes and Apps] 1wayjonny:
could you make a transparent pack as like the previous post suggested?

great idea!
[Nexus One Themes and Apps] britoso:
Youtube: http://xdaforums.com/showthread.php?p=5982613

Google Search: http://xdaforums.com/showthread.php?p=5982928

Calendar: Did not find the background image in Calendar.apk, suspect the colors are configured in one of the xml layout files...but they are binary encoded :(
[Nexus One Themes and Apps] jz9833:
anyway you can do it for pandora or is it only limited to stock widgets?

a mixzing lite large transparent widget would be badass if was possible
[Nexus One Themes and Apps] britoso:
its def possible, you should ask the developer of the app for it.

Market apps are signed so if I change something and sign it myself the app would work but you wont get market updates.
[Nexus One Themes and Apps] david1171:
Check out CalendarProvider.apk for the calendar widget.
[Nexus One Themes and Apps] khintz1:
How about Power Control?
[Nexus One Themes and Apps] david1171:
http://xdaforums.com/showthread.php?t=651021

@britoso you might want to put all your morphs into a single to save confusion about which ones you have already done, or put links in each threads to the other threads?
[Nexus One Themes and Apps] britoso:
yup,thats it. thanks
[Nexus One Themes and Apps] darx:
Any idea why I can't use this in metamorph? It says the theme control file is missing invalid. The rest of your Morphs work great, any help would be appreciated. I'm on cyans 5.0.6.
[Nexus One Themes and Apps] britoso:
Ill update this shortly to work with the new mm...
[Nexus One Themes and Apps] britoso:
done. check the op.
[Nexus One Themes and Apps] M@zik:
plzz help a newbie.... what do u actually mean by "apply with MetaMorph"

WHAT M I supposed to do ?? does it mean flashing with cwm??

plz helpppppp

looking 4ward to repliesss
[Nexus One Themes and Apps] britoso:
MetaMorph is an app: Market. Open MetaMorph and select the zip file from your sdcard to apply any morph.
[Nexus One Themes and Apps] M@zik:
not working for me

i installed metamorph

and then applied on the zip

then my current music widget went missing and then i rebooted

music widget is back but very same black one , no transparent :(

plz help i am on galaxy ace with CM7.1 RC1
[Nexus One Themes and Apps] britoso:
I've attached a modded Music.apk (Music 2.3.5 com.android.music) .

Copy it to /system/app/ using android commander or your fav tool
[HD2 General] polstein:
I'm trying to remap the volume to d-pad up & down (mostly for book reading).

I'm using the version of AEPlus I just got off the web - and after a reboot the keys still do the normal volume control. I also tried voldpad with the same lack of results.

Anyone able to get the volume keys to remap, or are they hard locked?
[HD2 General] polstein:
Oh - using AEButtonsplus version 2.6.6.2. If possible I'd like to confirm one way or another before I write the developer.
[HD2 General] polstein:
No luck with remapping yet, but I'm trying a solution to pass on in case someone else hits this thread on a search:

http://xdaforums.com/showthread.php?t=466002

Gpad. Turn your accelerometer into a d-pad by tilting it to turn the pages. I'm using the switch option for my reader, which means it will only turn 1 page when you tilt it until you put the unit back into level area (so it won't turn 50 pages when you tilt).

Will mess around and see how well this works!
[HD2 General] aceo07:
I am also interested in getting voldpad working on the US HD2.
[HD2 General] chigrizund:
Doh, didn't see the date of the OP, silly me :-)
[myTouch 3G, Magic Android Development] mizzel16:
Ok so i wanna flash a rom that requires danger spl which isnt a problem. I know to flash the radio first then flash the spl. My question is say after i do this i wanna change to a hero rom which requires a different radio? can i keep the danger spl with the different radio or do i need to change my spl as well?
[HD2 General] hiddengopher:
I got my HD2 today. I was 4th of 8 people to get one at my shop. I LOVE my HD2 and am downloading ps1 games for it right now.

What apps do you like?

How do you improve the UI to your liking?

:D thanks
[Windows Mobile Development and Hacking General] ceesheim:
I want to help the guy's at the rose thread to get started on cooking ROM'S

I am trying to make a working kitchen (wm 6.5 Standard) for them (I don't own a rose ).

but they need a wrapper to , so the question is :

Is there someone that can make a wrapper for the htc rose ?

(rename the .zip to .rar).
[Windows Mobile Development and Hacking General] ceesheim:
is there someone that can point me in the right direction ?
[Legend General] irkan:
Hello

GSM Arena have released a comprhensive review about the legend

Legend Review

have fun :D
[Legend General] gringooo:
GSM Arena reviews are the most detailed and comprehensive I have seen.

Loved this review, as well.
[Legend General] irkan:
yeah ur right, ... I read it all, word by word, although am not interested in Legend (into desire) but just a warm up for the desire review :p

which i dont think will be that different from the Legend :D
[Legend General] vegetaleb:
It just confirming what I said about the great possibility that the Desire will have a way louder speaker than N1 if HTC uses the same one as Legend :cool:

But it's a little deceiving about the direct sunlight, Techradar was quite the opposite saying it's perfectly readable
[Legend General] lambrospower:
this review is the best at the moment (techradars is good too but...)....the sunlight thing for is very subjective as i see it, one sees it this way one sees it the other way!!
[Legend General] irkan:
I really dont see any deal-breakers here, .. I mean, ok the AMOLED does not look so great under direct sun-light, what are you gonna do with the phone under direct sun-light anyways? .. making a call probably, you can easly see the numbers and names. (you should not worry about seeing the numbers looking soooo great)

I cant imagine anyone sitting outside his home and positioning his phone under-direct sun light to see a movie, can you? :P
[Legend General] lambrospower:
yes that's what i am saying irkan...i posted it in another thread too where someone complaint about the sunlight. i don't have a problem with it and as you said i won't be watching a movie while outside under the sun.
[Legend General] gringooo:
I agree. I checked visibility under direct sunlight, and I can see quite enough for doing any basic function. All other things doing on direct sunlight is pointless with any phone.
[Android Apps and Games] mpg187:
I have Android on my HTC Touch Diamond as a dualboot and was wondering if there is an app to open PWI (Note) files I made in Windows Mobile?

50th post :P
[Android Apps and Games] dr_strangetrick:
+1 for me too