yashsingh1/xdaforums huggingface dataset:
[Touch CDMA General] jnadke:
lat1 / lon1 are last_lat and last_lon.

lat2 / lon2 are location.latitude and location.longitude.

dLon = (lon2 - lon1).

And yes, that is where the atan2 function would go. 360 / (6.282) is still needed to go from radians to degrees.

Also, with that fix, you'd delete this:

if ((location.latitude - last_lat) < 0) {
if ((location.longitude - last_lon) < 0) {
location.bearing += 180.0;
} else {
location.bearing += 90.0;
}
} else if ((location.longitude - last_lon) < 0) {
location.bearing += 270.0;
}
if (location.bearing >= 360.0)
location.bearing -= 360.0;

And add this (in its place):

if (location.bearing < 0)
location.bearing += 360.0;

atan2's output is on the interval (-pi, pi], and a proper compass heading is [0, 360), so you have to add 360 if the bearing is negative to correct it.

Oh, also delete:

else {
location.bearing = 0.0;
}

The proper mode of failure for not being able to calculate bearing (same latitude as last time) should probably be to hold bearing, rather than reset to north.
[Touch CDMA General] Shidell:
Well, you clearly know what you're talking about. :)

I'll have a netbook arriving soon that I plan on installing Ubuntu on and diving into learning more about *nix and Android. Concerning GPS, it'd be a waste of my time to even try and figure this out when you, vilord and srwalter already have such strong grasps on what needs be done.. but perhaps I can contribute to other projects later on.

vilord, srwalter, mssmison, plemen, zenulator and jamezelle (in addition to dzo) all have extremely strong knowledge on this topic and can probably assist you to a much better degree than I can, but if I can be of any help, I'd be more than willing to invest time.
[Touch CDMA General] jnadke:
Eh, you gotta start somewhere. I probably won't get around to making these changes for a while. So unless someone else does....

Take a shot at it, this is probably the best place to learn. You can't really screw up.

I'm still mystified by the seemingly random correction_factor. Scale factors are usually grounded in some physical quantity (like fractions/multiples of pi or 180, or units, or powers of 2). The 180,000 * 1.035631 value doesn't make sense.

Has anyone checked the accuracy of android GPS using GPS Tool vs Windows Mobile using the HTC GPS? Are they identical (down to, say, 1E-6 degrees)?
[Touch CDMA General] Shidell:
I'll give it a shot--we'll see what happens, lol.

Should we fudge the correction_factor to something other than it currently is? We could define it in vogue_gps.c, but I have no idea what to set it to, if it's even a good idea.

Assuming I get the build environment working, I'll input the changes you indicated. Can you elaborate on anything else, like the "smoothing" algorithm you mentioned, that I should try to add as well?
[Touch CDMA General] jnadke:
Nah, the correction_factor can be left as is until there's a better reason to change it. As for the smoothing algorithm, that's a bit trickier. I'll have to think about that one for a bit. The filter is simple, but coming up with the right coefficients is trickier.
[Touch CDMA General] Shidell:
lol, alright--you know better than I. I'll just work on figuring out how to set up a development area easily.

I've got Ubuntu running nicely, and managed to figure out how to install GCC via the terminal (not bad progress for someone who's never touched *nix until tonight.. well I'd think, anyhow.)

Couldn't wrap my head around installing the ARM EABI toolchain/compiler/package. Tried to follow some instructions here (http://www.ailis.de/~k/archives/19-ARM-cross-compiling-howto.html) but didn't make much progress.

I need to determine if I have all the required tools to compile for ARM available (and set up to work with Android correctly), and then I need to figure out what commands (and order to run them in) to build the shared library (.so) file from the source (.mk, .h, .c).

Also, some investigating of libc found that Android uses a modified version called "bionic", and software for Android needs to be compiled with it. The kicker is that I haven't found documentation on bionic yet, as I was hoping to find out if atan2 is supported. Is there an easy way to check?
[Touch CDMA General] bzo:
give this a try:

http://www.androidonhtc.com/get_involved

it's a bit more specific to compiling for android
[Touch CDMA General] Shidell:
I'm trying to build my own toolchain to compile ARM code. I need to configure GCC to do so, and along the way, I think I need to set it up to compile against Android's libc as well.. just haven't found much helpful documentation in how to set this up.

:D Constructing toolchain to compile code for an ARM processor for use with Android is probably not a typical beginner *nix exercise.. lol.
[Touch CDMA General] zenulator:
The best way to compile it is in the android source tree. You should be able to put the code in a directory inside hardware/msm7k inside your source directory. Set up your build environment and do a mm inside the the directory at least that worked for the libaudio.so for donut. I don't know if libgps.so has any dependencies so if it fails you might want to build the whole tree as a dry run and then do the mm. I don't have a build environment set up anymore and don't have the bandwidth to pull the several gigabytes of source needed for a complete android build. But it has all the required arm tool chains included.
[Touch CDMA General] bri3d:
I can confirm that compiling libgps.so the way zenulator says (get an Android tree) works fine and is 100% the best way to do it.

In the process you'll get the ability to develop your very own AOSP-based Android builds with full customization and your own hardware libraries of every sort through a complete toolchain you get via an easy setup process - there really isn't an easier way.

The Android tree when configured as described on the Android Open Source page comes with all of the different versions of GCC you'll need to build a kernel and userland, and they're even prebuilt which will also save you a lot of time building GCC and dealing with finding a version with the correct set of bugs.
[Touch CDMA General] Shidell:
Wow, well that seems a lot more straightforward than trying to compile GCC with an ARM toolset.

Thanks for the patience.

As soon as the netbook arrives, I'll make an earnest attempt at getting a build platform established. Ideally, I'd like to be able to build/port Android myself, as well as work on underlying C code. It's probably going to be at least a few days (and who knows how many questions) before I get that far.

So If anyone's up for compiling the changes I posted, I'd just like to see if they work, and hopefully with jnadke's help (or establishing him with a build platform as well), get GPS working well for not only 1.6, but also 2.1.

Does anyone know if the current libgps.so works with 2.1?
[Touch CDMA General] zenulator:
libgps.so works for 2.1.

Thankfully it can use all the eclair libs.
[Touch CDMA General] roberto188:
Can I use the posted rootfs on my Kaiser with ION Donut 1.6?

Can I use the posted rootfs on my Kaiser with ION Donut 1.6?
[Touch CDMA General] jamezelle:
yessir

[10 char]
[Touch CDMA General] roberto188:
Sorta off topic

I know this is sorta off topic but what exactly is differnet between the vogue and kaiser builds? In other words...aside from the actual rom image (.sqsh file) what other vogue files can i use on the kaiser (rootfs, zimage?) Arent these device dependant. I'm not a devleoper and don't quite understand EXACTLY what each one of these files handles/does. Anyone care to enlighten me?
[Touch CDMA General] zenulator:
vogue/kaiser builds are pretty much the same. when you see kaiser specific rootfs.img zImages and system.sqsh thats just usually wifi related fixes for them. the system.sqsh from a kaiser will usually boot fine using our rootfs.img and zImage.
[Touch CDMA General] srwalter:
The driver reports values in 50'ths of an arcsecond. 60 minutes/degree * 60 seconds/minute * 50 fiftieths/minute = 180,000. The reason the driver reports this is because this is what the hardware reports, and doing division of any kind, but especially floating-point division, is very tricky in the kernel.

As to the 1.035631, I don't know why it is that way, but that's how I have to scale the values from hardware to get accurate values. It's the same value for both latitude and longitude, and it applies equally well in NZ as the US. The GPS hardware is not documented, I had to manually reverse engineer the RPC protocol that it uses.
[Touch CDMA General] xoltrix2000:
That's odd, it's still not doing it for me. I did almost the same exact thing as you did. I installed a new blank data.img, updated rootfs, and plemens no-map version of the sqsh file. I downloaded the maps off the market and still don't get the "Navigate" option, when i run it from the Nav launcher, it says "No route found". I live in Canada as well. It's all odd.
[Touch CDMA General] tatnai:
it is because you live in canada. I'm canadian, but I live in the US. you need to run the hacked version.
[Touch CDMA General] xoltrix2000:
Ahhh, alright, but, how do does one fix the Unnamed road issue on the hack version though?
[Touch CDMA General] Shidell:
I'm happy to announce that after considerable assistance from a nix veteran that I work with, I can present an updated libgps.so library.

I haven't had the opportunity to test this yet; the best I was able to do is get a location in my office and watch Nav for a while. In a positive light, I never received the 180-degree rotation during this test, which seemed to happen very regularly with the previous version--so I'm hopeful that at the very least, that issue may be remedied.

I'll be testing this on the drive home tonight. If you try this library, please let me know your experiences--better, worse, unchanged, etc.

(Note that after replacing your current libgps.so, your phone needs to be restarted to use the new library.)

THANK YOU to srwalter for creating this driver originally, and jnadke for the advice on current changes--also to all of those who have given me advice over the past few pages to get this far.

:)
[Touch CDMA General] polyrhythmic:
Giving this a test now, Shidell, I'll post back with the results.

Edit: Got a lock just fine with GPS and Maps reported the accuracy amount, GPS Test only showed one satellite at first (03) when I got a lock, after launching Maps and checking GPS Test again it showed all satellites. Hasn't done that before but idk that it's important. I'll take it on a jog and see how it does.
[Touch CDMA General] tatnai:
you can't. it is inherent to the fix.

http://xdaforums.com/showthread.php?t=583123
[Touch CDMA General] bzo:
Nice work Shidell.

I gave the GPS a try on my drive home from work. The erratic bearing seems to be fixed. However, for most of my drive, it had me driving sideways (i.e. the bearing was sideways from my actual direction). So perhaps, the new calculation is not quite right yet? Also, the GPS app said it lost the signal about 10 times in about 20 minutes.
[Touch CDMA General] myn:
Anyone got a rootfs that incorporates Shidell's new changes?

I'd like to give this a go.

Thanks
[Touch CDMA General] jnadke:
That's my bad.

Shiddell, use this:

location.bearing = 90 - (atan2(adjLongitude, adjLatitude) * 360 / (6.282));

atan2 will report the bearing on a polar coordinate system, where 0 is actually east, the direction is counter-clockwise.

Subtract the result from 90 to adjust the offset and change the direction.

You could also do:

location.bearing = atan2(adjLatitude, adjLongitude) * 360 / (6.282);

Which is equivalent to the other equation.

You should probably use the 2nd one, because it's more efficient (one less operation).
[Touch CDMA General] bri3d:
@bzo the "lost fix" happens when libgps comes through with an update without all the flags the nav app wants set - my suspicion is that it's when the GPS reports the same position twice and therefore the driver kills the HAS_BEARING flag.

It's probably fixable after the bearing stuff is cleaned up so it points the right direction!
[Touch CDMA General] jnadke:
No, that's another my bad.

I thought the GpsLocation variable was being instantiated as a global variable. Instead it's a local variable. This means after I told Shiddell to set the bearing to hold, it actually sets it to garbage data (i.e. 34856 degrees).

Shiddell:

Also do this:

Just like last_lat and last_lon, add a last_bearing.

Then do:

last_bearing = location.bearing
} else {
// Previous code from srwalter (removed to prevent bearing from resetting to North, this will hold last bearing):
// location.bearing = 0.0;
location.bearing = last_bearing;
}
[Touch CDMA General] bzo:
jnadke, makes sense. It did feel like it was off by +90 degrees most of the time. Looking forward to trying the fix when Shidell gets around to it.

I just checked and found that the numbers were identical.
[Touch CDMA General] bri3d:
There's something more than your garbage data bug going on - although the "lost fix" does occur more frequently with your source it also happens with srwalter's from time to time.

Every time I turn on logging I stop getting it often enough to figure out what's going on though - a Heisenbug!
[Touch CDMA General] Shidell:
I'm working to update my build environment on my netbook right now at home, and once I finish that up, I plan to dig into the GPS library a little further and see what we can clean up. :)
[Touch CDMA General] Shidell:
Word to the wise: Building the Android tree on an Atom-based netbook (and my netbook even has the dual-core Atom 330) took roughly ~5.5 hours, which set me back a bit. Thankfully you only need to do a full-compile once, and then can rebuild singular components.

I've already made the changes to the code, I'll get this finished up in the morning and have it posted during the day tomorrow. :)
[Touch CDMA General] berardi:
we greatly appreciate your work, it's pretty inspirational to see someone learning so quickly and translating it instantly to a practical application.... great work! looking forward to the update
[Touch CDMA General] jnadke:
Note that I changed the fix to:

location.bearing = atan2(adjLatitude, adjLongitude) * 360 / (6.282);

I dropped the negative on adjLongitude, that was wrong.
[Touch CDMA General] Shidell:
Roger that--I'll update the code and get a build out as soon as I have a free moment.

Thanks. :)
[Touch CDMA General] Shidell:
I just built the latest version; a quick step outside seemed to show a return of the erratic swinging, which prompted me to create a new thread where I can post updated builds on the first page as well as details, and hopefully we can recruit more testers/developers to assist in improving functionality quickly.

I'll give this build a shot on the drive home tonight, perhaps it will be less-prone to problems while moving despite it's issues standing still?

Referencing the new thread: http://xdaforums.com/showthread.php?t=616436
[Touch CDMA General] jnadke:
Erratic swinging will be prevalent because you're standing still, and we're using a difference of position to determine direction and velocity. The problem is, GPS has random noise, so your position is always moving in random directions a small amount even if you're standing still :-)

If you move at a substantial speed, it should be pretty accurate.

The last fix would be to have it not update the bearing when the velocity is small (< 1 meter / sec).

In reality, we should be trying to further reverse-engineer and figure out how to turn on velocity and altitude reporting. This would make everything a lot easier :-)
[Android Themes] jonesyruless:
i've read up on this but im still a little confused. lets say i have the ttf fonts downloaded onto my sd card. from there, what commands do i have to put into terminal emulator to replace the default system font? & do i have to rename to droidsans first?
[Android Themes] ArniPL:
cp /sdcard/yourfont.ttf /system/fonts/DroidSans.ttf
cp /sdcard/yourfont.ttf /system/fonts/DroidSans-Bold.ttf
[Android Themes] mgorman:
why dont you just get metamorph and do it that way?
[Android Themes] jonesyruless:
it says "cp: cannot create '/system/fonts/droidsans.ttf': file exists.
[Android Themes] ArniPL:
Try this:

adb remount
adb push yourfont.ttf /system/fonts/DroidSans.ttf
adb push yourfont.ttf /system/fonts/DroidSans-Bold.ttf
[Android Themes] jonesyruless:
wheww after several different attempts i finally did it. i ended up renaming the fonts in my sdcard to the default system font names, then putting this into better terminal emulator.

thanks for your help guys(: helvetica looks amazing on this!
[Android Themes] march83:
just did this, worked very well except for some dodgy characters and some icons with names spreading onto 2 lines - helvetica is a little bit too tall so it cuts off the bottom in places. possibly can be solved with some theming? idk, will get around to it, but thanks :D
[Android Themes] Alphabet Soap:
yeah, i believe it's missing characters in the ttf file. i think chacheinjection did some fiddling to get it working a bit better. maybe pm him.
[Android Themes] cacheinjection:
Yeah i got it working, you need to add a load of extra space characters, i can start a tutorial thread for fixing this font issue if yall want.
[Android Themes] Alphabet Soap:
would appreciate that actually, thanks. it's beginning to bug the hell out of me...
[HD2 Windows Mobile 6.5 Q&A, Help & Troubleshooting] lovebell:
I've just noticed my HD2 back light completely turns off ,and it is frequent.I can only weak up it by turning off and turning on again, I assume therer some problems with the light sensor? The backlight turns off is just like when you are talking on a phone and put your phone close to your ear. Aslo, when I plug it to charge via Ac power(via usb to PC is fine), the drak orange led light is always flashing which is abnormal.

I have tired a clean boot and unplug SIM card, micro sd card, the issue is still here, I guess I have got a hardware problem? I have used it very carefully, how come it has that issue?

Any fellows here have the same issues so far?

Thanks.
[HD2 Windows Mobile 6.5 Q&A, Help & Troubleshooting] puremind:
You can set up the backlighting behaviour as follows:

Go to: Settings tab > Sound & Display > Backlight

Find the entry "Dim Backlight if device is not used for"

Change the value to whichever duration suits you

You can set this up for when the device is unplugged or when it is on external power.
[HD2 Windows Mobile 6.5 Q&A, Help & Troubleshooting] lovebell:
Thanks for the reply, however, it does't solve my problem, the backlight is completely turned off, theres no backlight at all, which mean you can see nothing even under completely dark condition.

Btw, this issue is gone while on charging(PC/AC).
[HD2 Windows Mobile 6.5 Q&A, Help & Troubleshooting] lovebell:
So I am the only one so far has this issue？

After a clean boot(hard reset)it still happened, some times the backlight is even turned off when it's booting up, and I cannot active the backlight by tapping the screen.The only solution is press the power off button twice.

This is really weird...

Someone please help...
[HD2 Windows Mobile 6.5 Q&A, Help & Troubleshooting] lovebell:
After the battery fully charged, the backlight won't turn off until the power drop to 50%, the only solutions I found is keeping the coreplayer running in the background, and the coreplayer will stop "something" to turn the damn backlight off.

I guess it's hopeless to find out what the problem is, as I have used WM phones for many years and first time has such weird problem.

OK,HD2, I am giving up you.
[HD2 Windows Mobile 6.5 Q&A, Help & Troubleshooting] PG101:
The only thing I can think of is an additional program that you may have installed... hmm but after a hard reset it should work.. well i could suggest that you flash the stock ROM over the current one... I mean not HR.. but flash the ROM in active sync mode connected to the PC. Could be that your shipped ROM has some errors.. which ROM are you on? Check the wiki to download the official ROM that match yours.. download and flash over the current one...
[HD2 Windows Mobile 6.5 Q&A, Help & Troubleshooting] Prinzessin Horst:
Try this:

HKCU -> ControlPanel -> BackLight -> BatteryTimeoutUnchecked

HKCU -> ControlPanel -> BackLight -> ACTimeoutUnchecked

or

HKCU -> ControlPanel -> BackLight -> BatteryTimeoutTemp

HKCU -> ControlPanel -> BackLight -> ACTimeoutTemp

Play around with these.

It's not always helpful but sometimes ;)
[HD2 Windows Mobile 6.5 Q&A, Help & Troubleshooting] lovebell:
My current rom is 1.48.832.0,which is a Asian WWE rom, I can only find the Asian 1.48.832.1 ROM, but it said this rom dosen't fit my phone when at 2% progress...

I am enough with it, this issue is only disappeared when battery is full, when battery drops to about 70%, it happens again.

So I can consider this is a hardware issue after charging on a AC power, and the led is flashing during chagring .
[HD2 Windows Mobile 6.5 Q&A, Help & Troubleshooting] lovebell:
When this issue happend at first time, I was attempting to edit the registry, however, nothing helped...
[HD2 Windows Mobile 6.5 Q&A, Help & Troubleshooting] holdup:
I am having a slightly different issue, but it is also related the backlight option. I have set up my phone so that the backlight should automatically turn off if not used for 1 minute (I have ticked this box in settings). Unfortunately, for some reason the box keeps getting automatically unticked, so the backlight remains on even if I am not using the device, unless I press the stand-by button. As you can imagine, this is really affecting the phone's battery life.

I don't have any major registry editor installed, except BSB tweaks (set on Low power mode) and have a stock ROM (WWE 1.66). Anyone have any ideas?
[Hero CDMA General] gu1dry:
I'm setting up this thread to keep extra functions on AOSP 1.6 & the actual development of AOSP 1.6 separate.

Discuss issues with extra functions in this thread & NOT the AOSP 1.6 thread.

________________________________________________

Googlebits:

Flash with this signed update.zip: Multiupload (RS|MU|DF|HF|ZS|4S)​

________________________________________________

Superuser:

Flash with this signed update.zip: Multiupload (RS|MU|DF|HF|ZS|4S)​

________________________________________________

Busybox:

This needs to be installed if you install Superuser.

adb remount
adb shell
busybox --install /system/xbin/
adb reboot

________________________________________________

HTC Keyboard

Download Clicker.apk & HTC_IME.apk from here.

Do the following commands:

adb remount
adb install -r Clicker.apk
adb install -r HTC_IME.apk
adb reboot

Go into Settings>Locale & Text, made sure "Touch Input" is checked

Long press a text box, selected Input Method & selected "Touch Input"

________________________________________________

Thanks:

quietcbelongs for working on AOSP 1.6

gbhil for the two signed update.zips, this really makes it much easier for everyone

cyanogen for the framework-free HTC keyboard
[Hero CDMA General] incogneato:
Great thread.

A couple things to do after you get the Googlebits on:

Move su

#cp /system/xbin/su /system/bin/su
#ls /system/bin/**to verify su copied**
#rm /system/xbin/su

Install busybox symlinks

#busybox --install /system/xbin/

I'm loving this build. As soon as GPS gets working I'm deleting my 1.5 nandroid backup.
[Hero CDMA General] JasonMudd:
Link is broken. :-(
[Hero CDMA General] gu1dry:
Link perfectly fine for me, site is loading a little slow, but it's still there.
[Hero CDMA General] lonerebel:
Thanks for posting googlebits.

Just a FYI

its a bit cleaner if you do the following.

unarchive google bits to androidsdk/tools

change dir to androidsdk/tools

adb remount

adb push system/framework /system/framework

adb push system/etc/permissions /system/etc/permissions

adb push system/app /system/app

adb reboot
[Hero CDMA General] gu1dry:
I prefer to push each file individually but I guess that would work also.
[Hero CDMA General] JasonMudd:
Worked great for me! Thanks!