Related
Hi,
I need to use the C++ version of this. The code should gather information and show this in a notification.
The notification works but I want to receive the choice the user made in the html form.
I know I need to use the hwsink, a message map, and some events but cannot find info (book, example, etc.) how.
Could some one finish this code so I can test what has been chosen. If NOT, please give me an C++ example from which I can learn/copy. I have been searching on google for days now
Thx, for your help
BTW:
I started with this http://www.krvarma.com/?p=146 downloaded code but was a bit to complicated. In it is all I need but i would like it to be in 1 cpp file.
I'm offering 2 beers if you have the solution
Code:
#include "stdafx.h"
#include <stdlib.h>
#include "resource.h"
// {4E8A9888-D15C-4395-9C9A-B4B572F20081}
static const GUID NOTIFICATION_GUID =
{ 0x4e8a9888, 0xd15c, 0x4395, { 0x9c, 0x9a, 0xb4, 0xb5, 0x72, 0xf2, 0x0, 0x81 } };
int _tmain(int argc, _TCHAR* argv[])
{
SHNOTIFICATIONDATA stcNtData = {0};
stcNtData.cbStruct = sizeof(stcNtData);
stcNtData.dwID = 1;
stcNtData.npPriority = SHNP_INFORM;
stcNtData.csDuration = 15;
// stcNtData.hicon = LoadIcon((HINSTANCE)GetModuleHandle(NULL), MAKEINTRESOURCE(IDI_ICON2));
stcNtData.clsid = NOTIFICATION_GUID;
//What todo here... stcNtData.hwndSink = hWnd;
stcNtData.grfFlags = SHNF_SILENT | SHNF_TITLETIME | SHNF_CRITICAL | SHNF_FORCEMESSAGE;
stcNtData.pszTitle = L"ReRemind";
//stcNtData.pszHTML = TEXT("<html><body>This is a sample application to show the SHNotificationAdd API")
// TEXT("<p><b>This line should be bold</b>.<br><i>This one should be italics.</i><br>")
// TEXT("This is a line with a <a href='cmd:10000'>link</a></p>")
// TEXT("<p>This is a line with <input type='button' name='cmd:10001' value='Click'></p><br><br><br><br>");
stcNtData.pszHTML = TEXT("<form method='get' action='TestBubble://Test'>")
TEXT("<table width=100% cellspacing=0 cellpadding=0>")
TEXT("<tr><td colspan=2>")
TEXT("<b>Choose a fruit:</b><p>")
TEXT("<input type='radio' value='0' id='Apples' checked name='Fruit'><label for='Apples'>Apples</label><br>")
TEXT("<input type='radio' value='1' id='Oranges' name='Fruit'><label for='Oranges'>Oranges</label></p></td><td>")
TEXT("<input type='submit' value='Submit' name='Submit'>")
TEXT("</td></tr><tr><td width=42>")
TEXT("<a href='cmd:12288'>Settings</a></td></tr></table></form><br><br><br><br>");
SHNotificationAdd(&stcNtData);
Sleep(15000);
SHNotificationRemove(&NOTIFICATION_GUID, 1);
return 0;
}
I'm offering beers now. No need to finish it, just give me some hints
Hi,
as I understand your article (http://www.krvarma.com/?p=146)
you need to create window, then assign it's HWND
to SHNOTIFICATIONDATA member HWND hwndSink;
then "The system will send WM_COMMAND with wParam set to 1000 to the hwndSink window." so - you need to handle WM_COMMAND in your window and check wParam - if it is equal to your parameter, then this message means "system sends you user choice from your html".
serfer222 said:
Hi,
as I understand your article (http://www.krvarma.com/?p=146)
you need to create window, then assign it's HWND
to SHNOTIFICATIONDATA member HWND hwndSink;
then "The system will send WM_COMMAND with wParam set to 1000 to the hwndSink window." so - you need to handle WM_COMMAND in your window and check wParam - if it is equal to your parameter, then this message means "system sends you user choice from your html".
Click to expand...
Click to collapse
Exactly as i understand it.
So I tried copying code from that article into my code but got stuck with really not understandable compiler errors. I think I need to find a good book explaining this message map.
The first thing I do not understand is that I only want to show the notification bubble (is working). If I create a windows handle (how?) will this overwrite the current screen (this is something I do not want).
window can be invisible.
I'm Win32 programmer, and I don't know exactly about WinCE.
If you are using VisualC++, I think you should use MFC, it's very easy to create window and then create message handler for this window.
search google for some
"WinCE c++ tutorial" and you will find how to create window and setup message loop. (add "Hello world" phrase to your search - this is usually used as very first example)
for example: http://www.codeproject.com/KB/mobile/ltwtdlg.aspx
serfer222 said:
window can be invisible.
I'm Win32 programmer, and I don't know exactly about WinCE.
If you are using VisualC++, I think you should use MFC, it's very easy to create window and then create message handler for this window.
search google for some
"WinCE c++ tutorial" and you will find how to create window and setup message loop. (add "Hello world" phrase to your search - this is usually used as very first example)
for example: http://www.codeproject.com/KB/mobile/ltwtdlg.aspx
Click to expand...
Click to collapse
Can you switch between MFC, ATL, etc. ? I know they are some kind of libraries but thought "don't look at it, there too much to learn/understand anyway ".
I've search but somehow you think there is the solution and then you learn the hard way, it's very old code. Will search further offcourse and I am reading a chapter on classes and if I can find; messages.
it's already very easy to handle messages without any MFC overload. Just check the uMsg parameter in your DefWindowProc. If you create a new Win32 project in Visual C++ wizard then you see what it's looking like. This is mandatory knowledge. Usually first thing you learn after Hello World. If you didn't know about message processing in Windows/Wince then it's the same like sitting in a car and don't know how to turn the keys.
Do you know how to open dsm file in textbox???
RAMMANN said:
it's already very easy to handle messages without any MFC overload. Just check the uMsg parameter in your DefWindowProc. If you create a new Win32 project in Visual C++ wizard then you see what it's looking like. This is mandatory knowledge. Usually first thing you learn after Hello World. If you didn't know about message processing in Windows/Wince then it's the same like sitting in a car and don't know how to turn the keys.
Click to expand...
Click to collapse
Thats how I feel exactly. It's strange. I read quickly thru 3 books about C++ and no mention of these messages. C#/Basic are easier to understand because of all the examples.
Found these:
- http://www.youtube.com/watch?v=kWVGqV2Yklw
- http://www.youtube.com/watch?v=cbe6yxBHEiU
The video does explain that the linked example doesn't look so different. What a lot of source code Ms creates for you..
If created a WIN32 smart device project and DefWindowsProc is only called when to pass the message to other programs. I need the windows handle for the notification and NOT display the window.
But again it's a bit to much for me at this moment. I haven't got a solution yet..Could somebody help me with not displaying this window. I would still like to use the windows handle to make sure I get the callbakcs to the WM_COMMAND.
Yes - I think you only need at end of WinMain before SHNotificationRemove
to add:
Code:
while (GetMessage(&msg, NULL, 0, 0))
{
if (!TranslateAccelerator(msg.hwnd, hacc, &msg))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
Then a new function:
Code:
/* Redefine generic HANDLE_WM_ACTIVATE macro for Pocket PC */
#undef HANDLE_WM_ACTIVATE
#define HANDLE_WM_ACTIVATE(hwnd,wParam,lParam,fn) \
(SHHandleWMActivate((hwnd), (wParam), (lParam), &g_sai, 0), /*return*/ 0L)
/* Redefine generic HANDLE_WM_SETTINGCHANGE macro for Pocket PC */
#undef HANDLE_WM_SETTINGCHANGE
#define HANDLE_WM_SETTINGCHANGE(hwnd,wParam,lParam,fn) \
(SHHandleWMSettingChange((hwnd), (wParam), (lParam), &g_sai), /*return*/ 0L)
static LRESULT CALLBACK MainWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
switch (msg)
{
HANDLE_MSG(hwnd, WM_CREATE, Main_OnCreate);
HANDLE_MSG(hwnd, WM_ACTIVATE, /* SHHandleWMActivate()*/ 0);
HANDLE_MSG(hwnd, WM_SETTINGCHANGE, /* SHHandleWMSettingChange() */ 0);
HANDLE_MSG(hwnd, WM_PAINT, Main_OnPaint);
HANDLE_MSG(hwnd, WM_COMMAND, Main_OnCommand);
HANDLE_MSG(hwnd, WM_DESTROY, Main_OnDestroy);
[B]// Remark: Here you can add more messages - also for what user has chosen.[/B]
default:
return DefWindowProc(hwnd, msg, wParam, lParam);
}
}
and then the message handlers like this:
Code:
static BOOL Main_OnCreate(HWND hwnd, CREATESTRUCT *pcs)
{
SHMENUBARINFO mbi;
memset(&mbi, 0, sizeof(mbi));
mbi.cbSize = sizeof(mbi);
mbi.hwndParent = hwnd;
mbi.nToolBarId = IDR_MNU_MAIN;
mbi.hInstRes = g_hInstance;
if (!SHCreateMenuBar(&mbi)) /* create the menu bar */
return FALSE;
g_hwndMB = mbi.hwndMB;
return TRUE;
}
But your Compiler should already make such a project by default and you can simple add the code fom _tmain to WinMain, which you've posted above.
Greetz
Micha
Thank you, yesterday I debugged and and debugged trying to understand how this works but the debugger doesn't stop always in all source code.
If f.i. you click on the screen I expected this to be an event, but the debugger didn't stop at all. Is there a command to always stop when a line of code is processed? Now it only stops when I have set a break point. I want to see every line processed...
I will try to implement your suggestions. For a newby it still looks difficult I hope someday I will look back to this and say "wow, that was so easy".
ajhvdb said:
Thank you, yesterday I debugged and and debugged trying to understand how this works but the debugger doesn't stop always in all source code.
If f.i. you click on the screen I expected this to be an event, but the debugger didn't stop at all. Is there a command to always stop when a line of code is processed? Now it only stops when I have set a break point. I want to see every line processed...
I will try to implement your suggestions. For a newby it still looks difficult I hope someday I will look back to this and say "wow, that was so easy".
Click to expand...
Click to collapse
Well, actually that's the reason why breakpoints exist. To stop the debugger and allow you look at the running code..... or what else did you think??
RAMMANN said:
Well, actually that's the reason why breakpoints exist. To stop the debugger and allow you look at the running code..... or what else did you think??
Click to expand...
Click to collapse
I want to say "stop and show at the current code line".
For example you start your program, goto the appropiate window, type in some data and NOW before you click on SAVE. You say to your debugger "catch this/coming event".
Debugger would stop if you'd handle this event and set break point to 1st command of this function.
then yo can go step by step through each line of code.
and hey: it's not soo easy,which I posted.But your Compiler (vs2008 or PellesC or whatever) would make this automatically for you and you only have to copy your part of code into WinMain of this automatic processed code.
The "Managers" then can help you also to add eventhandlers automatically.
you only have to set Breakpoints to the automatic processed Event-Handle-Function - them you can see,if this event is triggered like you want it.
You only think from the wrong direction
Ok, I learned a lot.
(The VS2008 debugger has bugs. If I set a breakpoint on line 100, and start debug, line 109 has the breakpoint. It looks like only the original code can be debugged)
I did start a new project and used the tips from above. I can catch a click on a link ahref field in the notification bubble.
I have disabled the screen so only the bubble is shown
Now I need to catch the menu button and more important the data in the html form (input type radio) in the notification bubble. For this I need to convert the param to a structure...!
I also need to extend the "while getmessage" loop with a timer. If 15 seconds have passed, I need to step out of the loop and quit automatically.
A lot of searching again.
BTW.
Thx all for helping me. Not really one tip did it, you all guided me a bit. If you think your tip helped me a lot then send me a PM with your paypal code. You can also send me your address/or your businessaddress. I will send you a small present/surprise related to my country (Holland).
in Germany we have a good cheese, too and the sense of a community like this great one,is for helping each other-especially beneath developers.
And it's always a question of finding out,how to manage something new
All the best for your further development.
Micha
Attached is the code of my subproject. I will update it if those last points are done. Hope it helps others.
If someone has a link or example code for those points. (or improvements of my code) please let me know.
Hi guys
I've just started working with Silvermoon. When testing the demo app (as well as my own app) on my HD2, it works fine for 6 times, but when I start the app for the 7th time, it crashes without any message.
Has anyone else had this problem? Any ideas?
Any help would be appreciated!
Thanks, Rob
I don't have these problems on my HD. It looks like some resources are not cleaned up at application exit. Do you call 'Screen.Close();' when exiting the application?
edit:
As you're using an HD2 you don't have the libGLES_cm.dll and I assume you have copied the one of the demo. This is a software implementation and could also be the reason of running out of memory. The OpenGLES 1.x dll on GLES2 devices is called something like libGLESv1.dll. To use OpenGLES in a managed application/library the methods have to be imported from the dll and the dll name has to be defined at compile time. So, take a look at the silvermoon sources and if you find dllimport(...) using libGLES_cm.dll you'll have to replace this dll name with libGLESv1.dll (look up the correct name in your /windows directory) and rebuild framework.
(had to do that in my OpenGL test app for gles2 devices)
edit2:
Had a quick look into the silvermoon sources and for gles2 devices it has to be recompiled after changing the dll names:
in Silvermoon\OpenGL\Native\
egl.cs: change const string LibGlesDllName = "libgles_cm.dll"; to ... = "libEGL.dll"
gl.cs: change const string LibGlesDllName = "libgles_cm.dll"; to ... = "libGLESv1.dll"
(the egl dll could also be changed to "libGLESv1.dll" just in case this doesn't work)
You'll need VS2008 to compile the solution.
Hello heliosdev,
Thank you very much for your reply, I really appreciate it!!! I am calling Screen.Close() in my app and have the same problem in Silvermoon demo, so this shouldn't be the issue...
My HD2 has the following files in Windows directory:
libEGL.dll
libEGL_org.dll
libGLES_CL.dll
libGLES_CM.dll
libGLESv1_CM.dll
libGLESv2.dll
I recompiled OpenGl.dll in VS2008 with the folowing combinations & results:
libGLES_CM.dll in gl.cs & libEGL.dll in egl.cs -> app not starting at all.
libGLES_CM.dll in gl.cs & egl.cs -> app crashes at 7th start
libGLESv1_CM.dll in gl.cs & egl.cs -> app not starting at all.
libGLESv1_CM.dll in gl.cs & libEGL.dll in egl.cs -> app crashes at 7th start
Any further ideas?
I think the last version (v1 and egl) should be used on gles2 devices instead of the software renderer.
Now it's getting difficult.
Maybe try to disable Manila (Sense) restart device and test your app.
If it still fails:
Try to start another opengles app several times. (try my opengl test app (snapdragon version))
edit:
something else to try (yes, I'm getting out of ideas...)
Before Screen.Close() you could call gl.DeleteTextures() with for example an array of 100 uints starting at 1.
Disabling "HTC Sense" allows for one extra launch of the app, meaning it crashes at the 8th start attempt. Exactly the same problems using your TestOpenGL.
The only difference is, that when trying to launch my app for the 7th/8th time, the busy cursor appears shortly on the screen, as if it were starting up, but then just disappears and nothing more happens. When I launch TestOpenGL, the busy cursor appears and freezes, then nothing more happens.
ok, so it looks like resources are not cleaned up.
Try the glDeleteTextures suggestion. (even though this is called)
btw: Are you using a stock rom? Have you installed any 3d drivers (like chainfire's patch found in the sticky thread in the forum)?
Nope, unfortunately gl.DeleteTextures(1, 100) just before Screen.Close() is not helping either...
I'm using Xannys Pandora ROM which has GLTweaks integrated. However, taking into consideration the posts from codeplex, where several people are having the exact same problem on different phones (tg01, hd2), can it really be a ROM problem?
BTW: Thank you so much for taking the time to try and help!!!!
I struggle with the same issue in my own app (here) using silvermoon (7th start fails using HW renderers).
heliosdev Test app runs fine and can start numerous times without problems (gave up after 20 starts), also tried "coin toss" (here) without problems running multiple times.
Running on Miri's 6.5.x v8 without any enhancements installed.
Ok, I've created a small test app, which simply loads a form containing a Silvermoon window control, with a ChromeButton on it. On clicking the button, I call Screen.Close() to exit the app.
Testing on the Emulator works fine, but on my HD2 the 7th attempt to launch the app results in the following error: "Error on glGenTexture.". I have traced this Error to Line 37 in "Texture.cs" of the OpenGL source:
Code:
public Texture()
: base()
{
this.Name = gl.GenTexture();
[b]if (this.Name == 0) throw new OpenGlException("Error on glGenTexture.");[/b]
}
I added a line in Texture.cs to output the gl.GenTexture() uint value. On the first 6 start attempts it returns the values 1 and 2, but on the 7th it returns 0, which obviously is what causes the error.
Digging further, the GenTexture() method (which is returning 0) comes from pInvoking glGenTextures() in libgles_cm.dll.
Sadly, this is where my programming skills end... I really hope we can find a solution to this issue! It would hurt, having to give up on Silvermoon.
Looks like 'out of memory'. Call the following method before and after the GenTexture call (1285 is out of memory error).
Code:
private void CheckErrorGL(string info)
{
uint err = gl.GetError();
if (err != gl.GL_NO_ERROR)
{
MessageBox.Show(err.ToString(), "GL " + info);
}
}
Doesn't seem to be OutOfMemory... gl.GetError() is returning 0.
The exception is thrown without any glerror message box?
Run cleanRAM before calling it for the 7th time.
Correct, it's not throwing a glerror! Although, VS2008 is not showing me GL_NO_ERROR option on gl. But an if I remove the if-clause from your code (if (err != gl.GL_NO_ERROR)), the messagebox always returns 0.
Just ran a level 3 purge with cleanRAM... problem remains
The error definitions are in the namespace Silvermoon.OpenGL.Native (gl/egl)
And what does egl.GetError() return? (EGL_SUCCESS is 12288)
Code:
private void CheckErrorEGL(string info)
{
int err = egl.GetError();
if (err != egl.EGL_SUCCESS)
{
MessageBox.Show(err.ToString(), "EGL " + info);
}
}
the error definitions are surrrounded by a
#region obsolete
#if false
...
#endif
Change the false to true to access them.
get a EGL 12294 before calling gl.GenTexture()
seems to be a EGL_BAD_CONTEXT
Before calling gl.GenTexture() I'm also getting error code 12294 (EGL_BAD_CONTEXT) and afterwards 12288 (EGL_SUCCESS).
(Had a typo in my code, therefore I got the wrong result previously...)
I have the same problem with my tiny graphics engine. I think its the same problem because the egl.cs and its setup are nearly identical. So here's what I've found out:
- Its only about Egl, not about OpenGl, so forget deleteTextures etc (I've written a little test, that simply creates a display, context and surface and destorys them, no Gl calls and the same bug)
- create context creates a "Gl_Bad_Alloc" error
- everything that is allocated by egl is also destroyed
I think its also not a bug in the driver, because there is for example that ogles 2 game electopia or something like that, and this game is not affected!
I found a solution!!! I don't know about Silvermoon, but it works with my tigre engine. I can't explain it, I have no idea, and itse not the best solution, but it seems to work. Just DO NOT destroy the display, DO NOT delete context and DO NOT delete the surface. Any one have a idea why it is like that?
Phippu said:
I found a solution!!! I don't know about Silvermoon, but it works with my tigre engine. I can't explain it, I have no idea, and itse not the best solution, but it seems to work. Just DO NOT destroy the display, DO NOT delete context and DO NOT delete the surface. Any one have a idea why it is like that?
Click to expand...
Click to collapse
Amazing! That did the trick with silvermoon too. Great find, thanks!
No idea why that works though.
Sometimes it seems to be better leaving a mess instead of cleaning everything up properly
I've been working on fixing the GPS data validity bug (where positions are reported at a lat/long of approximately 0,0 prior to lock)
Attached is a version of libhardware_legacy.so that should do the following:
Improve debugging of GPS operation (change printf()s in the main GPS library file to Android logging macros)
Fix/workaround the 0,0 bug (I say workaround because I have yet to identify the root cause of the issue - however it is "fixed" from the point of view of an end user
A few "under the hood" cleanups/fixes
Things that are NOT implemented/fixed in this library:
XTRA (driver/library support for QuickGPS data loading)
Obtaining satellite status prior to GPS lock on Rhodiums (behavior on non-Rhodium unknown, but this should not change actual behavior at all except for the false 0,0 fixes)
Any methods for improved lock speed - all this does is prevent you from appearing south of Africa prior to lock
To test this fix (Intended for FRX05, may work with other 2.2.2 based builds that are derived from xdandroid FRX05):
Unzip the attached zip file
Place libhardware_legacy.so somewhere on your SD card. For organization, I use bindfiles/system/lib/libhardware_legacy.so
Open conf/froyo.user.conf in your favorite text editor
Within the custom_shells{} section of froyo.user.conf, add:
mount --bind /sdcard/bindfiles/system/lib/libhardware_legacy.so /system/lib/libhardware_legacy.so
Restart, and at this point:
1) 0,0 false locks should go away
2) You'll see lots of new GPS debugging info in ADB logcats
Edit: For testing, I usually use the "GPS Status and Toolbox" app from the market, since Google Maps does not show sat status.
With the stock GPS libraries, GPS Status and Toolbox will immediately report a 0,0 fix on startup
With this library, you should see that funky "wait for it circle" in the lower status area until you are locked. As mentioned above - you will not see satellite signal strength reports prior to lock
I was just looking at setting up the kernel build environment myself the other day.
The main useful reference I found was this:
http://forum.ppcgeeks.com/tp2-andro...modules-tinboot-nand-boot-more-beginners.html
However, that one's a bit of a firehose, too, since it deals with a lot of stuff specific to NAND.
In short clone these two repositories into the same directory:
Code:
git clone git://android.git.kernel.org/platform/prebuilt.git
git clone git://gitorious.org/linux-on-qualcomm-s-msm/linux-msm.git
The first is the vanilla kernel, and the second is the XDAndroid kernel modifications. You'll need the first to compile.
From that guide, compile:
Code:
cd android
mkdir modules
cd linux-msm
make clean
make ARCH=arm htc_msm_android_defconfig
make ARCH=arm CROSS_COMPILE=~/android/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin/arm-eabi- INSTALL_MOD_PATH=~/android/modules zImage modules modules_install
Follow that guide for putting together the modules for wifi and the location of your compiled files.
Thanks! I will take a look at that, although I get the impression from reading through things that that GPS handling is at a layer somewhere above the kernel but below where we start having to deal with Java. I just can't quite figure out where since I have never done any Android development before.
I am probably going to poke at the kernel at some point though to try and fix the LED behaviors. It is clear from the "sleep of death fix" test kernels that there is knowledge of how to change these behaviors - at the very least I want to make it turn things *off* when in deep powersave. (Seems nonsensical to me to indicate that the device is in a deep power save mode by turning on a bright power-burning LED, although maybe the LED consumption is negligible even when the device is asleep.)
Entropy512 said:
Thanks! I will take a look at that, although I get the impression from reading through things that that GPS handling is at a layer somewhere above the kernel but below where we start having to deal with Java. I just can't quite figure out where since I have never done any Android development before.
I am probably going to poke at the kernel at some point though to try and fix the LED behaviors. It is clear from the "sleep of death fix" test kernels that there is knowledge of how to change these behaviors - at the very least I want to make it turn things *off* when in deep powersave. (Seems nonsensical to me to indicate that the device is in a deep power save mode by turning on a bright power-burning LED, although maybe the LED consumption is negligible even when the device is asleep.)
Click to expand...
Click to collapse
Whoops, didn't read carefully enough at where you'd narrowed the problem down to. I haven't gotten around to setting up an environment for the system build yet, sorry I couldn't be more of a help!
Yup, http://gitorious.org/xdandroid/hardware_libhardware_legacy/blobs/master/gps/gps_msm7k.c is my first target. There may also be issues in gps-rpc.c
http://xdandroid.com/wiki/Getting_the_Source goes thru how to build the system image. It starts with getting the source and cascades all the way thru building a system image.
I'm setup to build it as well, and I've always wondered how we could fix this problem... Love to see it squashed!
Thanks! I'll start working on that, although probably not until after the weekend is over at this point.
The ghetto approach as an interim fix would be to not set GPS_LOCATION_HAS_LAT_LONG if both are exactly zero - This is not the right way to do it, but the chances of it affecting anyone before a proper validity condition is identified are slim. (Even if you ARE near lat/long of 0/0, there will be enough noise in the GPS solution that you'll almost never actually be blanked).
Probably should assume that all of the other validity flags should not be set if we don't have a position fix. (Assumption: The MSM7k GPS does not take inputs from the magnetometer or accelerometer, if the Rhodium even has a magnetometer, didn't think it did.)
Of course, I haven't quite figured out how GPS_LOCATION_HAS_LAT_LONG and such roll up to higher levels. There's some odd interactions in terms of when SV status becomes available, for example.
Entropy512 said:
Thanks! I'll start working on that, although probably not until after the weekend is over at this point.
The ghetto approach as an interim fix would be to not set GPS_LOCATION_HAS_LAT_LONG if both are exactly zero - This is not the right way to do it, but the chances of it affecting anyone before a proper validity condition is identified are slim. (Even if you ARE near lat/long of 0/0, there will be enough noise in the GPS solution that you'll almost never actually be blanked).
Probably should assume that all of the other validity flags should not be set if we don't have a position fix. (Assumption: The MSM7k GPS does not take inputs from the magnetometer or accelerometer, if the Rhodium even has a magnetometer, didn't think it did.)
Of course, I haven't quite figured out how GPS_LOCATION_HAS_LAT_LONG and such roll up to higher levels. There's some odd interactions in terms of when SV status becomes available, for example.
Click to expand...
Click to collapse
Yup, definitely no magnetometer in the Rhodium.
Good luck with this, it'll be a nice little fix if you can get GPS to stop reporting locks before it has one.
Source downloaded, have a build going. (First an unchanged one...)
I'm working on a Froyo tree for the moment, since I think in the Gingerbread alphas GPS is simply "not working", although the degree of "not working" was not defined. Once I'm more familiar with the GPS handling code I might take a look at how it works for Gingerbread.
A few notes about the Froyo repo in its current state:
The URL for Google Apps that device/xdandroid/msm/unzip-files.sh is outdated. cyanogen-mirror.local.host.name does not exist any more. android.local.host.name does but doesn't have the HDPI Froyo apps. I forget which mirror I used - the list is in the CyanogenMod wiki if you search for gapps
The froyo build scripts direct you to http://source.android.com/download - URL no longer exists, it is http://source.android.com/source/download.html now
The process for installing Sun Java 5 on Ubuntu 10.10 is in the URL above - you need it to do a froyo build.
Also, the wiki instructions are missing lib32readline5-dev as an Ubuntu package that needs to be installed (it's in the source.android.com docs tho) - I'll try to update the wiki later.
Entropy512, glad to see someone is interested in looking at the GPS code. I helped phh with it in the last go around to get the RPC messaging part working working, but nothing has been done since.
The NMEA parsing stuff you see in the current gps lib is unused, all the data comes from RPC. Before getting the data directly from RPC was working, we took advantage of the fact that NMEA is output to smd27 and parsed that string data. In any case, once the GPS is brought up, that NMEA data is still viewable by catting /dev/smd27.
If you want to check out other similar code, look at the vogue gps code. I think it supposed to work pretty well, and the RPC behind it is similar. Theirs is a bit different in that they split the gps processing across the kernel and userland, where ours is all userland.
Ultimately, this stuff needs a bit of a rewrite, because the libhardware_legacy interface to GPS that the current lib is written to, is gone for Gingerbread. If we could just get the RPC stubs generated, we might be able to plug into the reference Qualcomm implementation and take advantage of that well sorted code. Check out the cyanogenmod libhardware gps to see what that looks like.
Thanks for the additional pointers bzo.
I'm at the stage where I managed to build the froyo tree, but have not yet had a chance to test the built system ext2 image. That's a goal for tomorrow.
OK, dumb question - Since I'm now trying to understand that RPC code - Where do all those printfs in gps-rpc.c print to?
edit: Never mind, figured it out - it's buried in the logcat... Was trying to go back in time using Android System Info, but adb logcat lets me view it as it happens.
edit 2: Nope, those are D() statements in gps_msm7k.c - don't know where the printf()s in gps-rpc.c are going - nowhere? Should these be D() statements???
those printfs were from when that code was a console test application. Not surprising that they wouldn't show up by default in the logcat. I'm sure there is some way to make them show up. Dunno off hand, but some googling on android debug logging and redirection of stdout and such may dig up that info.
bzo said:
those printfs were from when that code was a console test application. Not surprising that they wouldn't show up by default in the logcat. I'm sure there is some way to make them show up. Dunno off hand, but some googling on android debug logging and redirection of stdout and such may dig up that info.
Click to expand...
Click to collapse
Ah. That makes sense why they aren't D() statements like in gps_msm7k.c
I tried changing as many of the printf()s to D() macros as I could, I'll test it tonight.
Edit: Had a chance to test it this morning. No output from any of the printf()s that I changed to D()s. Either I did something wrong, or none of those code paths are hit in a no-signal/low-signal situation prior to lock. Doing a make clean followed by a rebuild to make sure.
Those debug statements don't display by default. You'll have to change some compile and/or android settings to have them show up.
btw, if you're not already doing this, building just the gps lib and doing a mount --bind with just the lib in your startup.txt is a big timesaver, as opposed to updating the entire build
bzo said:
Those debug statements don't display by default. You'll have to change some compile and/or android settings to have them show up.
btw, if you're not already doing this, building just the gps lib and doing a mount --bind with just the lib in your startup.txt is a big timesaver, as opposed to updating the entire build
Click to expand...
Click to collapse
Hmm, got any pointers in this regard? They are working for gps_msm7k.c, but not my changes to gps-rpc.c - these are built by the same Makefile and components of the same library as far as I can tell. Is there a log tag filter somewhere?
Thanks for the mount --bind tip - will try that on my next build attempt.
if you copied over the same #define for D(...) from gps_msm7k.c, it seems like it should work the same in the other file. I haven't looked that much into android logging though.
For some reason my copy-and-pasted #defines for D() were failing.
Using LOGD() directly works.
I'm adding another set of LOGD()s now - It appears that something is calling update_gps_location() with bogus data.
BINGO! - It appears we are receiving PDSM_PD_EVENT_HEIGHT and PDSM_PD_EVENT_VELOCITY events prior to a position fix. No clue why - but even though GPS_LOCATION_HAS_LAT_LONG is not set, apps assume lat/long is valid when an update_gps_position() callback occurs.
Going to make it so we only do the update_gps_location() callback when GPS_LOCATION_HAS_LAT_LONG is set. Also going to try and figure out the right situations where we can call update_gps_svstatus() - right now it is only done when we get a PDSM_PD_EVENT_POS.
bzo said:
btw, if you're not already doing this, building just the gps lib and doing a mount --bind with just the lib in your startup.txt is a big timesaver, as opposed to updating the entire build
Click to expand...
Click to collapse
This is a good suggestion, but the bind mount statement would go in the froyo.user.conf, not the startup.txt .
arrrghhh said:
This is a good suggestion, but the bind mount statement would go in the froyo.user.conf, not the startup.txt .
Click to expand...
Click to collapse
yea, yea, that's what I meant , thanks for the correction
I'm just copying and pasting from Xenova from this thread: http://forum.xda-developers.com/showthread.php?t=1239713
I'm just making another post on this subforum because I myself have searched everywhere on the Gnex forums and found NOTHING. After this guy's fix, it was so good, I took the effort to make this to spread it to you guys too! This fix made me cry out of happiness.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
THE FIX
Requirements:
Rooted Device
File Manager: e.g. Root Explorer
1. Searching for NTP server information
Go to http://www.pool.ntp.org/en/
At the right side of webpage, there is "Active Servers". Go in and look for the setting of your 1)region and 2)country
For example, one's region is Europe then you write down the NTP server for that: 0.europe.pool.ntp.org; 1.europe.pool.ntp.org; 2.europe.pool.ntp.org; 3.europe.pool.ntp.org
Then the servers for your country from the list down there and click the link(Example: Switzerland — ch.pool.ntp.org; 0.ch.pool.ntp.org; 1.ch.pool.ntp.org; 2.ch.pool.ntp.org; 3.ch.pool.ntp.org
The "Italic" words are the information you need to jot down for later use
3. Modify the gps.conf file (Most Crucial Stage)
Copy the codes in grey box (in first post) to a notepad, then change the extension name from .txt to .conf then copy to your phone
Use file manager to copy to this location: /etc/gps.conf and replace the original gps.conf
Open and Edit the gps.conf using rootexplorer or others file managers
Change the COUNTRY and REGION in following lines with the info you got from the website just now. Keep other values unchange unless you know what it is. Example of REGION such as NorthAmerica, Asia, Africa, Europe.
Your new gps.conf should look as below:
Code:
NTP_SERVER=0.COUNTRY.pool.ntp.org
NTP_SERVER=1.COUNTRY.pool.ntp.org
NTP_SERVER=2.COUNTRY.pool.ntp.org
NTP_SERVER=3.COUNTRY.pool.ntp.org
NTP_SERVER=0.REGION.pool.ntp.org
NTP_SERVER=1.REGION.pool.ntp.org
NTP_SERVER=2.REGION.pool.ntp.org
NTP_SERVER=3.REGION.pool.ntp.org
NTP_SERVER=COUNTRY.pool.ntp.org <-This is changed from the top line to here. It may works better if we put it here.
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
# DEBUG LEVELS: 0 - none, 1 - Error, 2 - Warning, 3 - Info
# 4 - Debug, 5 - Verbose
DEBUG_LEVEL =0
# Intermediate position report, 1=enable, 0=disable
INTERMEDIATE_POS=0
# Accuracy threshold for intermediate positions
# less accurate positions are ignored, 0 for passing all positions
ACCURACY_THRES=0
# Report supl ref location as position, 1=enable, 0=disable
REPORT_POSITION_USE_SUPL_REFLOC=1
# Wiper (wifi positioning), 1=enable, 0=disable
ENABLE_WIPER=1
################################
##### AGPS server settings #####
################################
# FOR SUPL SUPPORT, set the following
SUPL_HOST=supl.google.com
SUPL_PORT=7276
SUPL_NO_SECURE_PORT=3425
SUPL_SECURE_PORT=7275
SUPL_TLS_HOST=FQDN
SUPL_TLS_CERT=/etc/SuplRootCert
# FOR C2K PDE SUPPORT, set the following
C2K_HOST=c2k.pde.com
C2K_PORT=1234
CURRENT_CARRIER=common
DEFAULT_AGPS_ENABLE=TRUE
DEFAULT_SSL_ENABLE=FALSE
# TRUE for "User Plane", FALSE for "Control Plane"
DEFAULT_USER_PLANE=TRUE
Make sure the permission of the file is rw-r--r--
MY EXAMPLE FOR CANADIAN GPS FIX:
Code:
[COLOR="Red"]NTP_SERVER=0.north-america.pool.ntp.org
NTP_SERVER=1.north-america.pool.ntp.org
NTP_SERVER=2.north-america.pool.ntp.org
NTP_SERVER=3.north-america.pool.ntp.org
NTP_SERVER=0.ca.pool.ntp.org
NTP_SERVER=1.ca.pool.ntp.org
NTP_SERVER=2.ca.pool.ntp.org
NTP_SERVER=3.ca.pool.ntp.org
NTP_SERVER=ca.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
# DEBUG LEVELS: 0 - none, 1 - Error, 2 - Warning, 3 - Info
# 4 - Debug, 5 - Verbose
DEBUG_LEVEL =0
# Intermediate position report, 1=enable, 0=disable
INTERMEDIATE_POS=0
# Accuracy threshold for intermediate positions
# less accurate positions are ignored, 0 for passing all positions
ACCURACY_THRES=0
# Report supl ref location as position, 1=enable, 0=disable
REPORT_POSITION_USE_SUPL_REFLOC=1
# Wiper (wifi positioning), 1=enable, 0=disable
ENABLE_WIPER=1
################################
##### AGPS server settings #####
################################
# FOR SUPL SUPPORT, set the following
SUPL_HOST=supl.google.com
SUPL_PORT=7276
SUPL_NO_SECURE_PORT=3425
SUPL_SECURE_PORT=7275
SUPL_TLS_HOST=FQDN
SUPL_TLS_CERT=/etc/SuplRootCert
# FOR C2K PDE SUPPORT, set the following
C2K_HOST=c2k.pde.com
C2K_PORT=1234
CURRENT_CARRIER=common
DEFAULT_AGPS_ENABLE=TRUE
DEFAULT_SSL_ENABLE=FALSE
# TRUE for "User Plane", FALSE for "Control Plane"
DEFAULT_USER_PLANE=TRUE
4. Reboot
Go setting, turn on your "use GPS satelites" and "Integrate Google Navigation"
Restart the device (normal restart)[/B]
5. Use GPS status and Toolbox
Tool available in market for free, please donate so developers are encouraged for better release in the future[/B]
Open app> tools> manage A-GPS state>Reset
Open app> tools> manage A-GPS state>Download
Optional restart device (not compulsory)
Use GPS status to start fixing satelites
Your satelite fixing speed should VERY FAST now
After get a successul GPS Lock, open your GPS applications and use like normal (e.g. Copilot, Sygic, or TomTom)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
END OF GUIDE
Above all else, THANK XENOVA! You can thank me all you want, I don't care. But PLEASE go to Xenova's thread and thank him too!
Thanks for the tip !
JB
Awesome, definitely going to try this.
Sent from my Paranoid GNex
I opened my GPS.conf as text to check, and this is all that's listed...is this the same for others?
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Sent from my Galaxy Nexus using Tapatalk 2
Duce HD2 said:
I opened my GPS.conf as text to check, and this is all that's listed...is this the same for others?
Sent from my Galaxy Nexus using Tapatalk 2
Click to expand...
Click to collapse
yeah this is a default gps.conf
I tried this and now keep getting: "Unfortunately, the process com.google.process.gapps has stopped".
I double checked the my gps.conf file and it seems I did everything as mentioned... any ideas?
Seriously, I know you are new here but read my posts right above bud. The person who took this information from another post of mine neglects to realize a lot of stuff does not work in this gps.conf file he supplied. They wanted to be a hero stealing research and post references and post it here like it was a solution. First of all, it comes from another phone not a Nexus. Secondly, I posted it just to sort of show people an example of how complicated a gps.conf could be and what I weeded out to get it working on my Nexus. Here is my gps.conf for you so you can see the lines that I stripped out of it that I know work. Of course you will have to update it to reflect your country. Hope it helps you.
I may have a few other lines to add but I want to give it another day or so and go over my results before I pass it on to others. When I am done my testing I will put up a new post for people. For now this should do you fine. Just update the servers, follow the same order.
gps.conf
NTP_SERVER=0.ca.pool.ntp.org
NTP_SERVER=1.ca.pool.ntp.org
NTP_SERVER=2.ca.pool.ntp.org
NTP_SERVER=3.ca.pool.ntp.org
NTP_SERVER=ca.pool.ntp.org
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
# DEBUG LEVELS:
# 0 - none, 1 - Error,
# 2 - Warning, 3 - Info
# 4 - Debug, 5 - Verbose
DEBUG_LEVEL =0
ACCURACY_THRES=5
INTERMEDIATE_POS=0
ENABLE_WIPER=1
SUPL_HOST=supl.google.com
SUPL_PORT=7276
REPORT_POSITION_USE_SUPL_REFLOC=1
Flukester69 said:
Seriously, I know you are new here but read my posts right above bud. The person who took this information from another post of mine neglects to realize a lot of stuff does not work in this gps.conf file he supplied. They wanted to be a hero stealing research and post references and post it here like it was a solution. First of all, it comes from another phone not a Nexus. Secondly, I posted it just to sort of show people an example of how complicated a gps.conf could be and what I weeded out to get it working on my Nexus. Here is my gps.conf for you so you can see the lines that I stripped out of it that I know work. Of course you will have to update it to reflect your country. Hope it helps you.
I may have a few other lines to add but I want to give it another day or so and go over my results before I pass it on to others. When I am done my testing I will put up a new post for people. For now this should do you fine. Just update the servers, follow the same order.
gps.conf
NTP_SERVER=0.ca.pool.ntp.org
NTP_SERVER=1.ca.pool.ntp.org
NTP_SERVER=2.ca.pool.ntp.org
NTP_SERVER=3.ca.pool.ntp.org
NTP_SERVER=ca.pool.ntp.org
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
# DEBUG LEVELS:
# 0 - none, 1 - Error,
# 2 - Warning, 3 - Info
# 4 - Debug, 5 - Verbose
DEBUG_LEVEL =0
ACCURACY_THRES=5
INTERMEDIATE_POS=0
ENABLE_WIPER=1
SUPL_HOST=supl.google.com
SUPL_PORT=7276
REPORT_POSITION_USE_SUPL_REFLOC=1
Click to expand...
Click to collapse
Dude. Don't get so butthurt.
I have:
-linked the original thread
-requested people to go to the original thread to thank the OP
-thanked the OP myself in ALL CAPS, as in "THANKS XENOVA!"
-stated I have copied and pasted it from original thread, IN MY VERY FIRST SENTENCE OF THE THREAD
How did I "want to be a hero stealing research and post references and post it here like it was a solution."?
Grow up. The only service I did was to copy and paste it into our forums, so when someone searches GPS fix on our forums, which I had, they would find it. I doubt many people would go to the actual Android Dev forums and search there for a Gnex GPS fix. I have also stated my contributions as such on the 2nd line of text in my OP.
EDIT: Never mind sir. Didn't realize you're from Ottawa. Everything makes sense now.
Duce HD2 said:
I opened my GPS.conf as text to check, and this is all that's listed...is this the same for others?
Sent from my Galaxy Nexus using Tapatalk 2
Click to expand...
Click to collapse
Yea, thats the default. You gotta paste the more detailed GPS.conf over it.
Flukester69 said:
Seriously, I know you are new here but read my posts right above bud. The person who took this information from another post of mine neglects to realize a lot of stuff does not work in this gps.conf file he supplied. They wanted to be a hero stealing research and post references and post it here like it was a solution. First of all, it comes from another phone not a Nexus. Secondly, I posted it just to sort of show people an example of how complicated a gps.conf could be and what I weeded out to get it working on my Nexus. Here is my gps.conf for you so you can see the lines that I stripped out of it that I know work. Of course you will have to update it to reflect your country. Hope it helps you.
I may have a few other lines to add but I want to give it another day or so and go over my results before I pass it on to others. When I am done my testing I will put up a new post for people. For now this should do you fine. Just update the servers, follow the same order.
gps.conf
NTP_SERVER=0.ca.pool.ntp.org
NTP_SERVER=1.ca.pool.ntp.org
NTP_SERVER=2.ca.pool.ntp.org
NTP_SERVER=3.ca.pool.ntp.org
NTP_SERVER=ca.pool.ntp.org
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
# DEBUG LEVELS:
# 0 - none, 1 - Error,
# 2 - Warning, 3 - Info
# 4 - Debug, 5 - Verbose
DEBUG_LEVEL =0
ACCURACY_THRES=5
INTERMEDIATE_POS=0
ENABLE_WIPER=1
SUPL_HOST=supl.google.com
SUPL_PORT=7276
REPORT_POSITION_USE_SUPL_REFLOC=1
Click to expand...
Click to collapse
Thank you Flukester... I will be checking this out and I would love to hear back after you do more testing.
fredboy said:
Thank you Flukester... I will be checking this out and I would love to hear back after you do more testing.
Click to expand...
Click to collapse
I plan to make a post on it by end of weekend but I am sure my config would be good for anyone given you put the right servers. I had people message me in Germany and parts of USA claiming similar results as mine.
Brought to you from my Galaxy Nexus using Tapatalk.
I should throw some infractions around for so much disrespect of others but instead will be placing user notes for other mods to see if some attitudes don't change!
The linked post clearly states it was tested on an HTC phone AND a Samsung and should work on othersl. Of course there may be some erroneous code in that respect but does not mean it will damage anything. Flukester69 not sure what your problem is with this. If it works or not users will report it. It is not your place to tear down somebody simply trying to help others. No one here gets paid for anything and your disrespect and flaming is not appropriate on XDA.
If I have to come back here there WILL be infractions.
Thread cleaned
FNM
kennyglass123 said:
I should throw some infractions around for so much disrespect of others but instead will be placing user notes for other mods to see if some attitudes don't change!
The linked post clearly states it was tested on an HTC phone AND a Samsung and should work on othersl. Of course there may be some erroneous code in that respect but does not mean it will damage anything. Flukester69 not sure what your problem is with this. If it works or not users will report it. It is not your place to tear down somebody simply trying to help others. No one here gets paid for anything and your disrespect and flaming is not appropriate on XDA.
If I have to come back here there WILL be infractions.
Thread cleaned
FNM
Click to expand...
Click to collapse
I'll send you a pm to explain. sorry.
I don't care to post in this thread as it serves no purpose other than duplication and distraction. There are existing threads where with plenty of information already.
Flukester69 said:
Seriously, I know you are new here but read my posts right above bud. The person who took this information from another post of mine neglects to realize a lot of stuff does not work in this gps.conf file he supplied. They wanted to be a hero stealing research and post references and post it here like it was a solution. First of all, it comes from another phone not a Nexus. Secondly, I posted it just to sort of show people an example of how complicated a gps.conf could be and what I weeded out to get it working on my Nexus. Here is my gps.conf for you so you can see the lines that I stripped out of it that I know work. Of course you will have to update it to reflect your country. Hope it helps you.
I may have a few other lines to add but I want to give it another day or so and go over my results before I pass it on to others. When I am done my testing I will put up a new post for people. For now this should do you fine. Just update the servers, follow the same order.
gps.conf
NTP_SERVER=0.ca.pool.ntp.org
NTP_SERVER=1.ca.pool.ntp.org
NTP_SERVER=2.ca.pool.ntp.org
NTP_SERVER=3.ca.pool.ntp.org
NTP_SERVER=ca.pool.ntp.org
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
# DEBUG LEVELS:
# 0 - none, 1 - Error,
# 2 - Warning, 3 - Info
# 4 - Debug, 5 - Verbose
DEBUG_LEVEL =0
ACCURACY_THRES=5
INTERMEDIATE_POS=0
ENABLE_WIPER=1
SUPL_HOST=supl.google.com
SUPL_PORT=7276
REPORT_POSITION_USE_SUPL_REFLOC=1
Click to expand...
Click to collapse
where would you be posting it. so i could look out for it.
There has been a flashable .zip for US users for months now posted on Rootzwiki. Mitch's Optimal GPS Settings.
Here is a link to the original thread
http://rootzwiki.com/topic/21453-optimal-gps-settings-for-galaxy-nexus/
All credit to Mitch. I attached a link to the flashable .zip file in this post. No need to edit anything, it just works.
Funny. I tried mitch's before and I don't seem to remember it working for me...
I know these GPS Fixes but I want to know one thing:
I live in Finland but I'm Estonian so I'm not always in Finland.. So can it be edited like adding 2 country names and 2 region names (different region and country), does it mess something up or not?
I don't usually use any "GPS fixes" because in Estonia I can receive the GPS signal in 3 minutes at day, at night something in 6 minutes, but in Finland I have have to wait almost 15 minutes to get GPS signal so then I have to put 3G on to receive the GPS signal faster..
LexusBrian400 said:
There has been a flashable .zip for US users for months now posted on Rootzwiki. Mitch's Optimal GPS Settings.
Here is a link to the original thread
http://rootzwiki.com/topic/21453-optimal-gps-settings-for-galaxy-nexus/
All credit to Mitch. I attached a link to the flashable .zip file in this post. No need to edit anything, it just works.
Click to expand...
Click to collapse
Mitch settings didn't worked for me, I tried several times.
I have read all the posts till now but noone reporting if this works or not... Feedback please !
Edit: You don't have to change this value through gps.conf. I thing it is quicker and easier to do it through fasterGps
To Flukester :
Are you sure about these values ? :
ACCURACY_THRES=5
INTERMEDIATE_POS=0
On mine (i took some frome here, yours and Mitch's) i have "Accuracy_thres=3000" and "Intermediate_pos=1".
JB
I have an AT&T Samsung Galaxy S3 with two problems at hand.
First of all, my GPS does not lock onto any sattelites at all. I've come to realize that this is related to an incorrect configuration file. As far as I know, a # at the beginning of a statement means that that statement is a remark, and not actual code. Thus, it's ignored.
If you look at my gps.conf file below, you will notice that many of the lines contain a # at the beginning. I have a general idea of which should remain. However, I'd like to know all those of which should/can be removed. If someone could just rewrite it removing all the # which should not be included, that would be awesome!
Code:
#Test
NTP_SERVER=time.gpsonextra.net
#Asia
# NTP_SERVER=asia.pool.ntp.org
#Europe
# NTP_SERVER=europe.pool.ntp.org
#North America
# NTP_SERVER=north-america.pool.ntp.org
XTRA_SERVER_1=http://xtra1.gpsonextra.net/xtra2.bin
XTRA_SERVER_2=http://xtra2.gpsonextra.net/xtra2.bin
XTRA_SERVER_3=http://xtra3.gpsonextra.net/xtra2.bin
# DEBUG LEVELS: 0 - none, 1 - Error, 2 - Warning, 3 - Info
# 4 - Debug, 5 - Verbose
DEBUG_LEVEL = 4
# Intermediate position report, 1=enable, 0=disable
INTERMEDIATE_POS=0
# supl version 1.0
SUPL_VER=0x10000
# Error Estimate
# _SET = 1
# _CLEAR = 0
ERR_ESTIMATE=0
# GPS Capabilities bit mask
# SCHEDULING = 1
# MSB = 2
# MSA = 4
# ULP = 0x20
# ON_DEMAND_TIME = 0x10 // yunu.lee
# default = MSA | MSB | SCHEDULING | ULP
CAPABILITIES=0x16
# Accuracy threshold for intermediate positions
# less accurate positions are ignored, 0 for passing all positions
# ACCURACY_THRES=5000
################################
##### AGPS server settings #####
################################
# FOR SUPL SUPPORT, set the following
# SUPL_HOST=supl.google.com
# SUPL_PORT=7276
# FOR C2K PDE SUPPORT, set the following
# C2K_HOST=c2k.pde.com or IP
# C2K_PORT=1234
################################
# Sensor Settings
################################
# Needs to be set explicitly based on sensor
# There is no default value.
GYRO_BIAS_RANDOM_WALK=0.00001
SENSOR_ACCEL_BATCHES_PER_SEC=3
SENSOR_ACCEL_SAMPLES_PER_BATCH=5
SENSOR_GYRO_BATCHES_PER_SEC=3
SENSOR_GYRO_SAMPLES_PER_BATCH=5
# Sensor Control Mode (0=AUTO, 1=FORCE_ON)
SENSOR_CONTROL_MODE=0
# Enable or Disable Sensors for GPS use (0=Enable, 1=Disable)
SENSOR_USAGE=0
# Choose GSIFF sensor provider (1=DSPS, 2=Android NDK)
SENSOR_PROVIDER=2
################################
# Indoor Positioning Settings
################################
# 0: QUIPC disabled, 1: QUIPC enabled, 2: forced QUIPC only
QUIPC_ENABLED = 0
################################
# EXTRA SETTINGS
################################
My second problem has to do with the power_profile.xml file. It was noted that certain S3s had a problem with an incorrect value in the power_profile.xml file, which resulted in Cell Standby topping the list for battery drainage. I have taken a look at that file on my S3, and noticed that I am affected by that incorrect value (34 instead of 3.4).
The problem is that the fixed XML file available for download seems slightly different to the one currently in my S3, in more ways than just that value. I'd like to know whether it's safe to make the switch. Or, does anyone have a fixed power_profile.xml which they wish to share with me, that definitely works on the AT&T S3?
I'm sorry if this has been posted before, but I wasn't able to find anything completely answering my questions. Thanks in advance for the help, and it's much appreciated!
My second problem has to do with the power_profile.xml file.
Click to expand...
Click to collapse
You probably downloaded the XML file like I initially did...and for the same reason...I did NOT want to replace it. But this much smaller flashable CWM fix only changes the VALUE in question...not the whole XML file....as far as I can tell. It has worked for my on my i747m for months. Do a CWM backup first!
themadproducer said:
You probably downloaded the XML file like I initially did...and for the same reason...I did NOT want to replace it. But this much smaller flashable CWM fix only changes the VALUE in question...not the whole XML file....as far as I can tell. It has worked for my on my i747m for months. Do a CWM backup first!
Click to expand...
Click to collapse
Actually, that is the same fix I downloaded. I extracted it just to take a look at it first before doing anything, and noticed that inside, it had a power_profile.xml slightly different to the one currently in my phone. So, I'm not sure whether to flash this or not. Or alternatively, is there any way which I can simply edit this file myself? I've tried several XML editors, but they all show weird symbols throughout, when I open that XML file. Though I can clearly see the value that I need to change, but I don't want to end up saving the file from a program that can't properly read it, ending up with a corrupt file flashed to my phone. Unless, that is how the file actually looks.
Sorry for all the noobish questions, but I have only had my S3 and been on Android for a couple of months now. Was on iOS before, and did a lot of tinkering on that side of the smartphone world.
.Xanadu. said:
Actually, that is the same fix I downloaded. I extracted it just to take a look at it first before doing anything, and noticed that inside, it had a power_profile.xml slightly different to the one currently in my phone. So, I'm not sure whether to flash this or not. Or alternatively, is there any way which I can simply edit this file myself? I've tried several XML editors, but they all show weird symbols throughout, when I open that XML file. Though I can clearly see the value that I need to change, but I don't want to end up saving the file from a program that can't properly read it, ending up with a corrupt file flashed to my phone. Unless, that is how the file actually looks.
Sorry for all the noobish questions, but I have only had my S3 and been on Android for a couple of months now. Was on iOS before, and did a lot of tinkering on that side of the smartphone world.
Click to expand...
Click to collapse
Ok, i will compare tomorrow...and let you know.
themadproducer said:
Ok, i will compare tomorrow...and let you know.
Click to expand...
Click to collapse
Thanks mucho! Much appreciated.
If you could also send me/share your gps.conf file so I can compare it with mine, that would be great! As I believe in addition to many lines being set as a remark, there are several lines also missing within there, such as for AGPS.
.Xanadu. said:
Thanks mucho! Much appreciated.
If you could also send me/share your gps.conf file so I can compare it with mine, that would be great! As I believe in addition to many lines being set as a remark, there are several lines also missing within there, such as for AGPS.
Click to expand...
Click to collapse
For starters, here is my gps.conf file.
There is only one area with slight differences but they are commented out with the # sign so it's irrelevant.
I have the i747m Rogers and you have AT&T. They should be pretty close with most core OS contents...as is this file.
I am assuming you are on Stock ICS? (not JB or custom)
Humor me...download Ulysse Gizmos 1.6.2 and use this to try to lock into sats. Test from outside OR inside but touching a window.
Stay tuned for XML.
PS...Xanadu....name from Rush by any chance?
UPDATE: Upload your stock power_profile.xml file (upload it) and I will check it against mine.
I just compared the FIXED one for the i9300....with my Stock i747m version and the only change is the value 34 to 3.4.
That's why it worked perfectly for me and probably will be EXACTLY the same for you.
Well that's interesting. Our gps.conf files are exactly the same. So, what could be the problem? I'm baffled.
Maybe I should also throw in that I'm using an unlocked AT&T Samsung Galaxy S III outside of the states. I'm in the Caribbean to be exact, if that makes any difference. (?)
I'll also try that app which you mentioned and report back.
As for my power_profile.xml, it's included below for comparison. Thanks!
.Xanadu. said:
Well that's interesting. Our gps.conf files are exactly the same. So, what could be the problem? I'm baffled.
Maybe I should also throw in that I'm using an unlocked AT&T Samsung Galaxy S III outside of the states. I'm in the Caribbean to be exact, if that makes any difference. (?)
I'll also try that app which you mentioned and report back.
As for my power_profile.xml, it's included below for comparison. Thanks!
Click to expand...
Click to collapse
Yes your location could be a huge reason.
You probably need to modify gps.conf for where you are.
When I was running my HD2, I had to do that to optimize the GPS,
but in your case...it's probably even more important.
Look around for an XDA page that focuses on the GPS ZONES for your area.
Start HERE. You may just want to extract certain elements and place them into your gps.conf file as needed.
UPDATE: your power_profile.xml is identical to mine. So go ahead and flash the CWM standby fix. ALWAYS do a CWM backup first!!!
themadproducer said:
Yes your location could be a huge reason.
You probably need to modify gps.conf for where you are.
When I was running my HD2, I had to do that to optimize the GPS,
but in your case...it's probably even more important.
Look around for an XDA page that focuses on the GPS ZONES for your area.
Start HERE. You may just want to extract certain elements and place them into your gps.conf file as needed.
UPDATE: your power_profile.xml is identical to mine. So go ahead and flash the CWM standby fix. ALWAYS do a CWM backup first!!!
Click to expand...
Click to collapse
Thanks for the help! I'll have a look at adding in the GPS zones for my area. I'll also go ahead with flashing the power_profile.xml and report back on how it went.
http://forum.xda-developers.com/showpost.php?p=40207546&postcount=67
Download this files and place it in /system/etc .... permission it to rw r r
then delete all files in /data/gps folder
restart and use gpstest to see results. try it with data on on first try to fix the satellite faster.
popcorn1122 said:
http://forum.xda-developers.com/showpost.php?p=40207546&postcount=67
Download this files and place it in /system/etc .... permission it to rw r r
then delete all files in /data/gps folder
restart and use gpstest to see results. try it with data on on first try to fix the satellite faster.
Click to expand...
Click to collapse
How do I set the permissions? I tried copying and it gave me error saying cannot copy system file. I tried setting the permissions using Root Explorer but didnt work
Use file manager from the google play and go to settings and then slect mount root.
u need to have root before doing this