yashsingh1/xdaforums huggingface dataset:
[Tilt, TyTN II, MDA Vario III Themes and Apps] dzalbo:
newb5000, thanks for the idea..

I will play with it application signing tomorrow and I will post an update here...

So far, I think that it you must be right with your guess as I was already having some bugs and problems with application signing on my device...
[Tilt, TyTN II, MDA Vario III Themes and Apps] acedish:
Works Great

Thanks Newb, Just installed it last night on a Samsung Blackjack WM6 Standard and have it logging to a MS SQL database. I do have 2 questions,

Is it posibble to see all the towers the phone sees or just the one its connected to?

Is the signal strength of the tower (RSSI) available?

Thanks Again,

ACE
[Tilt, TyTN II, MDA Vario III Themes and Apps] newb5000:
Hi acedish. Glad it's working. I did some searching last week regarding reading multiple cells at the same time.

It would be ideal to read more than two cells at once and use the signal quality from each tower to get a much more precise location estimate.

It seems the people that did get this right only got it working on their specific handsets.

I came accross the following methods (I haven't tried these, but did read the comments from different users in the postings):

Sending AT commands through the correct COM port.

Sending device specific commands using RIL_DevSpecific.

Apparently there is a specific chunk of memory on the device which contains info about multiple cells. Not only is this device specific but it can change when you upgrade your radio version, so this method is completely out.

I did not save the links, but in short, the method which the app uses seems to be the most device independent way of obtaining cell tower info - the shortfall is that you can only get information about one cell.

In order to read multiple cells at once, the code for doing this would potentially have to different for each device. The method of obtaining multiple cells from a device may or may not be freely available on the internet.

We'll probably need to go this route eventually as the app progresses.

I will do some more searching regarding this issue (and I encourage any other developers to do the same).

Regarding signal strength - I was surprised that RIL_GetCellToweInfo did not give me my signal strength for the current cell, as indicated in one of my previous posts (it was just 0). There definitely must be another way using TAPI or another RIL function though - I'll need to experiment. The thing that worries me about signal strength is that if we are to use it for approximating the current location, we must assume that a cell's coverage zone is circular, that the GPS co-ordinates of the cell are in the center of this circle, and that your phone has perfect line of sight to the cell. If we do make these assumptions, then it should not be that hard to map signal strength to distance from cell, but remember, Person A might be standing close to a tower and may get a weaker signal than a Person B standing further away from the same tower.

Edit: Yes, here it is: PhoneSignalStrength

dzalbo: Any luck with RIL_GetCellTowerInfo?
[Tilt, TyTN II, MDA Vario III Themes and Apps] dzalbo:
newb5000, yeah, thanks a lot!

I have managed to deal with the applicationg signing and now it seems to be working good!

I am planning to use this data in combination with Google cells data.. even though it's not quite official... Hope, they won't shut it down :)
[Tilt, TyTN II, MDA Vario III Themes and Apps] dzalbo:
that's me again over here..

i actually made the how RIL routine work on my HP Windows CE device..

But still have all the stupid messed data on Samsung WM5

I was quite sure that the problem is in signing. So, I signed the application with Sample Privileged Developer certificate (from the SDK)..

but the data is still the same it used to be.. looks like signing is not the actual problem.. what do you think?
[Tilt, TyTN II, MDA Vario III Themes and Apps] newb5000:
We need to see the error code that you get in lpData when dwCode == 3. Edit: lpData, not cbData.

What is the value of:

Marshal.ReadIntPtr(lpData).ToInt32()

and what happens when, for dwCode == 3, when you execute the following line?

Marshal.ThrowExceptionForHR(Marshal.ReadIntPtr(lpData).ToInt32())

Regarding you having signed your test app, it depends on what certificates are installed on your device.

Your device has a Privileged Certificate Store, and a Normal (or Unprivileged) Certificate Store.

If the certificate that you signed the app with is not present in either of these two stores, then it's almost like not having it signed (depending on device configuration, of course).

Mobile2Market is Microsoft's solution to allowing your apps to run on most, if not all, devices, since most devices have the Privileged Mobile2Market certificate in their Privileged Certificate Store, and all devices should have the Unprivileged Mobile2Market certificate in their Unprivileged Certificate Store. Just Google it and you'll see what it's about. I did actually email them asking what the process is on obtaining a Mobile2Market Unprivileged Certificate, but they referred me to VeriSign or Geotrust. On VeriSign's site I saw a figure of $350, with annual fees, which is what discouraged me from pursuing this further, since this app is free software.

The above is the ideal way to go, but there are other ways, like for example, adding the certificate that you signed the app with to one of the stores on your device. I haven't tried this myself and don't have any links, but the procedure is available via Google. This, however, is not what I would want users to go through in order to use the app, because it doesn't make for a good user experience. But for testing purposes I'd recommend it.

Also, from what I read, most WM5 Standard devices are set to two-tier mode, whereas the Pocket PCs are set to one tier.

In one tier mode, you can basically run anything (and you may be prompted when trying to run an unsigned app). Two tier mode is more restrictive.

There are probably ways to change this, but again, more configuration required from the user.

Did you know that OEMs and / or operators have the choice to completely lock down your device so that THEY need to sign any apps that you might want to install? :D I don't think any OEM would want to do this, but it's still interesting.

Most of what I typed here is from this page.
[Tilt, TyTN II, MDA Vario III Themes and Apps] edwardfrench:
Use without a server

I'm interested in using the utility to log cellid then post-process, what I don't think I have access to is a server that can collect all those http get requests and log them for me nicely (I'm sure this is trivial for lots of people!). I thought I had a perfect solution for me- google spreadsheets has a handy "form" tool which converts simple lists on spreadsheets into web forms. However this only seems to accept HTTP post requests. Any ideas how I could fix this gap?
[Tilt, TyTN II, MDA Vario III Themes and Apps] iso|ated:
cell info

Hi there,

has anybody managed to get a list of cells with strength?

If yes any ideas pm(saulius@myeweb.com) or here.

Another question, if a device provides such info (some kind of program), is there a way i could read the same data?
[Tilt, TyTN II, MDA Vario III Themes and Apps] AJenbo:
Hi, for some reason i can't get the normal builds of this app to work, they just get the spinning wheel going in to infinity.

cellidupdater_0.2_smartphones.CAB

did load but last update is Never :(

I'm using wm6.1 CF3.5 on HTC Universal and get the same result on 3G and GSM networks.
[Tilt, TyTN II, MDA Vario III Themes and Apps] newb5000:
@edwardfrench: Do you need to do post-processing on the cell info in real-time? If not, then the next update to the app will be that it keeps a copy of all unique cells visited on the phone and then this data can be synchronized with another desktop app. I can easily add an "Export to Excel" feature on the desktop app. I was supposed to release the next version some time back, but the synchronization part was much more difficult than I anticipated (plus there were other factors prohibiting me from working on the app).

@iso|lated: what do you mean by strength of the cells? if you mean accuracy radius, then this data is available via the (unofficial) Google API - typically it's 5000 meters. I added code to query the Google API to the desktop portion of the app, but I'm still wondering if it's a good idea because if many users start querying the API, Google might change / remove it. I'm going to leave it in for now.

Without making a firm commitment, I can say that the update should be ready by Sunday this week.
[Tilt, TyTN II, MDA Vario III Themes and Apps] newb5000:
@AJenbo: When you launch the app, you see a spinning wheel before the main screen opens, then this spinning wheel disappears when the app is loaded. Then, the Updater Status should read "Not Started". Once you configure the app and press Start, you should see another spinning wheel for a second, afterwhich the Updater Status should read "Started" and the spinning wheel should disappear.

I presume the spinning wheel that you see is after you press Start and it never goes away? What does the Updater Status say after you press Start and wait for a second?

One thing you can check is in \\Program Files\CellID Updater or \\Storage Card\Program Files\CellID Updater (depending on where you installed the app), there is a file called cidlog.txt. If it does not exist, then the service has not logged any errors, but if it does, the contents can give us a clue to what went wrong.
[Tilt, TyTN II, MDA Vario III Themes and Apps] astromex:
I wouldnt worry its hardly a big secret. Google have blogged it themselves even.

http://googlemobile.blogspot.com/2008/06/google-enables-location-aware.html
[Tilt, TyTN II, MDA Vario III Themes and Apps] LPChris:
My only question to newb, if you won't give out the source, can you at least outline how you got it running as a service? I've never developed anything serious for WM before and i'm not sure if it's a simple task or not.
[Tilt, TyTN II, MDA Vario III Themes and Apps] dzalbo:
http://msdn.microsoft.com/en-us/netframework/bb693461.aspx

http://msdn.microsoft.com/en-us/library/ms913956.aspx
[Tilt, TyTN II, MDA Vario III Themes and Apps] newb5000:
I don't use CeRunAppAtTime or CeRunAppAtEvent, although I've been considering CeRunAppAtTime for some time to wake the device to send out web requests (have it as a configurable option).

To write a proper service for Windows Mobile (I researched this extensively), you need to write it in Native Code. You cannot write a service using the .NET Compact Framework. Then, you need to sign the service and add some registry values - I don't have a code signing certificate either. So that option was out - I wanted to use .NET CF.

Writing it as a normal console application was also not an option, because you would lose the messaging functionality that Windows Forms apps provide - i.e. there is no WndProc. I wanted to send windows messages to and from the service / configuration utility to receive Last Update Time & Last Error from the service, indicate to the service that configuration has changed, and so on. There are other ways for inter-process communication, like WCF (which requires .NET CF 3.5), but I wanted to stick to .NET CF 2.0 since most users have this installed.

Lastly, proper services get loaded by services.dll (I forget if this was the exact dll), which is not subject to the memory management of Windows Mobile. The service for the app had to be able to survive the memory management of Windows Mobile, but could not get loaded as a service since it was not a native dll. Don't have any links on hand about this, but if you do a quick Google search, you'll see that there are certain threshold values where Windows Mobile starts gracefully closing or killing apps (but not services or drivers) when the device starts to run out of memory.

The solution? Pavel Bansky wrote an excellent article on these issues. I used his code as the basis. Only problem for me was that his code only had one way communication from the configuration utility to the service, but not visa-versa. See this post (and related links) on how to hook window messages, which is what I used to enable service to config utility communication.

All you need after that is to ensure that a shortcut to the service gets created in \Windows\Startup when the CAB is installed.

So to summarize, it might seem like a daunting task at first, but after you start to understand the concepts, it's not hard.
[Tilt, TyTN II, MDA Vario III Themes and Apps] newb5000:
Guys, I've been losing sleep over a new feature that I've been working during the past few days. All I'm going to say is that I'm really amazed, as a developer, that this can be achieved.

I'm not going to give away what it is yet, but all I can say is WOW. This new API that I'm playing with is simply amazing. Still need to add to it to make it useful, but I'm very happy with what I've achieved so far :D

Edit: Ok, I couldn't resist. I blurred out all sensitive information, but left the pushpins unblurred.
[Tilt, TyTN II, MDA Vario III Themes and Apps] khaytsus:
:o

More accurate positioning? :D
[Tilt, TyTN II, MDA Vario III Themes and Apps] LPChris:
Hey newb, I've set up my solution like the guy in the blog post you sent did, however when I deploy the app and hit the button to start the service it throws a general exception on the proc.Start(). Did you run into this at all?
[Tilt, TyTN II, MDA Vario III Themes and Apps] newb5000:
@khaytsus: Not yet, no. I will be revisiting triangulation after I finish off what I'm working on and try to overcome the limitation that only one cell can be read at a time.

What I've achieved so far is synching the logged cells from device to desktop and looking up their co-ordinates via the Google web service using a desktop app that I wrote. This app then plots all cells as pushpins in Microsoft Virtual Earth.

Then, the idea with Areas is that one can create a rectangle which encapsulates a few cells, for example, one can create an area called "Work", which consists of four cells, and another called "Home" with three cells.

The idea with Events is that when the device detects that you are in the "Work" area, one or more actions can be performed, like switching your phone to silent. When the device detects that you are "Home", it can possibly switch on your Bluetooth connection, sync with your desktop, then switch off the connection. That is the goal, but it's far from complete.

@LPChris: It worked first time for me. Just make sure that the service executable and config executable are in the same folder and that you use Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().GetName().CodeBase), "ServiceExe.exe") as the file path when you start the process.
[Tilt, TyTN II, MDA Vario III Themes and Apps] andyb2000:
Hi folks,

Firstly, thanks for this handy little app, I'm gonna use this to talk to my home automation (at present I use bluetooth which is less than accurate).

But, is it setup to not operate when the device goes into standby, and can this be changed?

At present it happily sends location information up to my server when its on, but as soon as I put it into standby, or it times out and goes into standby itself, the app stops.

Can anyone advise?
[Tilt, TyTN II, MDA Vario III Themes and Apps] newb5000:
It's not setup to stop when the device goes into standby, rather the OS stops the app and the OS resumes the app when the phone goes out of standby.

Apart from preventing the phone from going into standby, there is another option: CeRunAppAtTime, which will schedule an app to run at a certain time.

One must be aware of what the consequences of this are:

Your device will constantly wake up every X seconds or minutes to send out an update (it will drain battery quicker)

There is a way to instruct the OS to not turn on the screen when this happens (to be confirmed)

I hope that there is a way to tell the OS to go back to sleep once the web update is done. If not, that means that if the update interval for the web updates is more frequent than the timeout value of your device to go to sleep, then your device will never go to sleep.

What have you got the update interval for web updates set to, out of curiosity?

I'll implement it and it will be configurable, of course, so those who prefer to send out updates only when their device is on and not automatically wake the device, can chose to do so.

It will be interesting to see how much this affects battery.
[Tilt, TyTN II, MDA Vario III Themes and Apps] andyb2000:
Ahh, I see.

I didn't realise it was a function of the OS that couldn't be prevented.

Interestingly I've got the timer on default of 30 second uploads, and the device does indeed still go back into standby, so it doesn't look like the application keeps the device on which should help some people out.

I'm interested if the device can be woken up without the screen, since this should keep the consumption pretty low. I'm trying to think what other apps I use that may have this sort of behaviour, one that I thought about was kaisernotify which is constantly running as its setting the LEDs to do what I want them to, I'm wondering how that keeps polling/updating the LEDs depending on the device state.

Not the ideal solution I was after unfortunately, as I'd like to not have the device waking up (wake-up without screen would be a compromise that would be ok).

All in all a nice little app this, which makes me wish I'd stuck to VB/.net/coding just to knock together little things like this.
[Tilt, TyTN II, MDA Vario III Themes and Apps] newb5000:
CeRunAppAtEvent also exists, so the app that you mention might use this, or some other method.

CeRunAppAtEvent - launch an app when some event occurs, eg. the phone rings. Edit: Appologies, that is not quite true about the phone ringing part. I mixed up Microsoft.WindowsMobile.Status with CeRunAppAtEvent

CeRunAppAtTime - launch an app at a specified time. the app can then schedule itself to run again at the next interval.

There is one more alternative that I came across, but I need to dig up the link again. Apparently (I have not tested this), the device can also notify an app when the current cell changes, but only as of Windows Mobile 6. That function only returns Cellid / Lac though, not Mnc / Mcc, although that shouldn't be a problem.

In any case, I'll get back to you over the weekend once I've researched and tried the various approaches :)
[Tilt, TyTN II, MDA Vario III Themes and Apps] andyb2000:
Cool, really appreciate your work on this as I'm sure others do :-)

I'll watch this space!
[Tilt, TyTN II, MDA Vario III Themes and Apps] khaytsus:
Aha, gotcha.. phoneAlarm does this, one of the first things I purchased coming from a Treo and being spoiled by ProfileCare there, automatic profile switching based on time, meetings, etc... phoneAlarm will also switch profiles based on location or "leaving location", as you're talking about above. However, phoneAlarm is about $30 so I can see this being very useful for some folks. :)
[Tilt, TyTN II, MDA Vario III Themes and Apps] AJenbo:
I aited for 45 minuts and never got to the main screen part, i didnt install it, i just manualy extracted the files and i don't see a cidlog.txt :(
[Tilt, TyTN II, MDA Vario III Themes and Apps] newb5000:
You really should install it via the CAB file. In the next update, there are going to be registry settings which are created by the CAB file. It will be a really tedious process for you if you try to extract the files and do everything manually.

Have you tried installing it via the CAB file? Did you encounter the same problem?

@andyb2000: I have some good news and bad news.

I managed to get the test app running even when the device is suspended (I manually suspended my device, and checked whether a certain counter was incremented while the device was asleep). The test app doesn't use a data connection, so I didn't test whether the data connection worked when the cell tower info was retrieved (I didn't have enough time to test it). The screen did not turn on while the test app was running - which is good (it's a more complicated process, which I'll explain in detail in another post).

The problem is that the device never goes to sleep using the new method. Only if you manually suspend your device does it go to sleep, but no automatic sleep - big problem.

The method I used (for any developers out there) is CeSetUserNotificationEx with named events, since CeRunAppAtTime and CeRunAppAtEvent are obsolete.

Maybe it's possible using a hybrid timer, i.e. use a regular timer when the device is awake, and use CeSetUserNotificationEx when the device is asleep. I'll carry on researching this, but it will take some time...
[Tilt, TyTN II, MDA Vario III Themes and Apps] newb5000:
I decided to share the code of the Timer that I was creating based on CeSetUserNotificationEx and named events. It is by no means complete, since the timer interval cannot be changed after the object is constructed, plus the device does not go to sleep with this timer (probably because the system idle timeout value is greater than the timer interval).

I'll work on it some more this week.
[Tilt, TyTN II, MDA Vario III Themes and Apps] dzalbo:
thanks for that!

That's definitely a great help!
[Tilt, TyTN II, MDA Vario III Themes and Apps] topTwat:
Java & GSM Cell Info

Hi

This site provides some useful info on java to do this. Maybe of interest to some people:

http://forum.openhandsetdevelopers.com/google-maps-with-my-location-my-location-t19.html

Brgds
[Tilt, TyTN II, MDA Vario III Themes and Apps] topTwat:
php4

Has anyone founda php4 compatible version of http://www.witracks.com.br/gmaps.txt

im having problems with this, and have tried replacing file_get_contents with the below code, with no luck. Any Ideas?

===============================================

$host = "www.google.com";

$path = "/glm/mmap";

$fp = fsockopen($host, 80);

fputs($fp, "POST $path HTTP/1.1\r\n");

fputs($fp, "Host: $host\r\n");

fputs($fp, "Content-type: application/binary\r\n");

fputs($fp, "Content-length: " . strlen($data) . "\r\n");

fputs($fp, "Connection: close\r\n\r\n");

fputs($fp, $data);

while (!feof($fp)) {

$str .= fread($fp,128);

}

fclose($fp);
[Tilt, TyTN II, MDA Vario III Themes and Apps] newb5000:
@andyb2000: I finally managed to get the app to run even with the screen off. Took a totally different approach. The downside is that your device will not go into sleep mode when the app is running (which is pretty much always :)), but will rather go into "Unattended" mode (WM5 and later).

It's the same method that push email uses, so if you have push email enabled, you shouldn't see a notable difference in battery life. If you do not have any apps which request that your device go into Unattended mode instead of Standby mode, then you will see a difference in battery life. How much, I don't know - we'll have to see through testing.

I need to clean up the code a bit first and allow Unattended mode to be enabled/disabled dynamically (depending on the configuration). I'll post the code for the developers on how to do this, plus an update to the app as soon as I'm done.

The desktop portion is almost complete as well.

I'll probably need to start a new thread so that all updates can be in the first post.
[Tilt, TyTN II, MDA Vario III Themes and Apps] andyb2000:
wow!

You have been busy, I'm really impressed with how you've been working and learning on this project, and that sounds like you've hit upon exactly the solution I was hoping for.

My device must already be in this unattended mode, so that sounds fine, and yep happy to test and report back for power usage, etc, sounds good!

I'll look forward to more updates, if you want it tested before posting or anything else just drop me a note. I'll also PM you as want to see if there is anything I can help you out with after all your efforts :-)
[Tilt, TyTN II, MDA Vario III Themes and Apps] dzalbo:
newb5000, great job!

Thanks for your efforts :)
[Tilt, TyTN II, MDA Vario III Themes and Apps] w000ter:
Wow excellent work newb5000! Looking forward to your app! :D