LG KS20 & CellIDs - Windows Mobile Software Development

I've been trying for quite a long time to make my LG KS20 show me the CellID of the tower it is currently connected to. There are so many applications around the net that claim to do that, but unfortunately all of them just return 0 as current CID. I tried making my own application using the RIL's RIL_GetCellTowerInfo but I also always get 0. I tried signing my app with a temporary certificate, and adding that certificate to the phone but I still get 0. I tried different mobile operators and the result is always the same... And yet, Google Maps can identify my location without a problem so it is doable! Does anybody have any idea how to do that? Please, help, I'm getting very desperate here

I tried to get the cellId for a long time, but I think that's there's something blocking it in the RIL, that's why we always get 0 from RIL_GetCellTowerInfo.
As for GMaps, it never found my position automatically using celltowerid. Are you sure your position detection is not based on ip address ?
If I remember well, there are multiple ways to get celltowerid : 2 of these ways are rilnotifycallback and rilresultcallback.
I found a software( can't remember its name sorry, but if you're trying to get cellid I bet you know it) that could test each mode (perhaps 5/6 different methods) to try to get cellId. I remember that the 2nd one (was it result or the notify callback?) kind of worked. You have to :
- launch the (notify or callback) test mode -> return value is 0 .
- Then disable phone driver (easiest way is to go to airplane mode), -> the cellId, displays erratic values (000000 or fffff or whatever there is in memory at this place)
- Then enable phone driver (by going back to normal mode) -> the cellId display is right for a few seconds (it matched the values returned by another phone I had) but isn't updated after that.
Don't know if it helps you, but that's as far as I went concerning cellid.

Thanks for the info. Well, I tried manually writing C# code for RIL. Of course GetCellTowerInfo didn't work so I tried with DevSpecific. I bruteforced all the possible commands of the type {i, 0, 0, 0} but none of them seemed to work. Almost all of them gave an error "not implemented" or a basic error. Only {16, 0, 0, 0} returns an array of 20 bytes, but no combination of those gives the LAC (which I have via MiCard) so there's no CellID as well (as far as I know it would usually return the LAC combined with CellID). So it's a dead-end. The only thing I could not get up and running was querying the GSM modem directly through a COM port. I found that the RIL COM port should be 1, but no matter which command I send it remains silent. I disabled all the security in my device (it was in tier one mode before that) and signed all my applications with a personal certificate, which I added to the trusted certificates on my KS20. That didn't help as well. I think it's simply not implemented in the firmware of the radio.
And about Google Maps, well I found out that I actually used it via WiFi when I tried. Firstly I thoght it got the CellID because my laptop was running on the same WiFi, but "My Location" via maps.google.com just showed an error, while it was correct on my cell phone, but when I tried it elswhere and via 3G today, it showed me an error "Your location is not available now".
To wrap it up, as Google haven't come up with idea how to get CellID, probably I won't be able as well. But the topic still remains open (and if I come across new ideas, I'll definately try them). So if somebody has any other idea, I would really appreciate if he would share it.

i develop a geo location application my windows mobile phone is htc fuze with windows mobile 6.5
I want only to show me, Longitude and Latitude but i can't
I build this kowor.com/version/Kataskopos.apk
this link contain tha source but maybe it's not correct
Does anyone have any idea ?

I coulndn't succeed in getting the Cell ID to LG KS20 so I migrated to Android.
Anyway, to show the longitude and latitude you need GPS. If you don't have one, you could use Cell ID but it will give you a big error (typically around 1.5 km) and you still need to send the Cell ID to a database online which will convert it to geo coordinates (databases like Open Cell ID).
Good luck!

Related

QuickGPS?

Are there any applications for Android that work similarly to QuickGPS (downloads a small data file which allows you to lock onto a GPS satellite much faster)?
Had a look around and can't find anything.
Any help would be appreciated!
I haven't used the GPS very much yet, however, when I did use it, I got a fix quite quickly, so I personaly do not require a sort of quickGPS.
Essentially the phone does this already. However instead of downloading the file once and for all it might contact a server using your data connection to update it whenever you launch a GPS-application.
See https : // secure.wikimedia.org/wikipedia/en/wiki/Assisted_GPS

[Alpha 0.2 Released!] Facebook Location - Update Facebook status with your location!

First I want to say a huge thanks to 'Avalon-99' and 'deedee' for testing my previous builds
Its Here!!
Well after some awesome testing over the past few days. Its came to the time to release the first actual release of FBLoc!!
What is FBLoc?
FBLoc is a small app that allows you to update your Facebook status with your current location, Either by CellID or more accurate GPS!
CellID: Gets your status based on the Cell Tower you are currently connected to, then querying its location and some info from your phone reverse-geolocate the co-ordinates returned by the program to an approximate address...
GPS: The same as CellID but instead of using the co-ordinates from a Cell Tower it uses the GPS co-ordinates and then returns the address at that location...
Download it now!!
Thanks,
-David
Copyright © 2011 David Bell / DavidTiger All Rights Reserved.
All Source Code, Compiled exe and DLL files are the copyrighted works of David Bell/DavidTiger.
You may use/redistribute any included samples or files, leaving credits where due.
You also may NOT attempt to dissasemble or reverse engineer any compiled distributables (exe/dll).
You will need to manually authorize my facebook app with your facebook account (to allow status updates from the mobile app)
1) Login to Facebook.
2) Click this link - CLICK ME!
3) Allow the facebook app
4) Click where it says "Click Here to get your access_token!"
5) Copy the access token without "access_token="
6) Create a text file called "key" should be of type .txt
6.1) in the txt file place your access token you copied
7) Copy the txt file into the FBLoc folder in program files on your phone
8) Run the app
9) Enjoy
10) Report any errors that you face!
Cheers, Dave
Sort of works for me.
Location is technically close enough, see screen cap, "A" is the found location, red circle actual. Program says "County Londonderry, BT52 2HU" which is wrong.
Not a biggie for postcode but location should be Coleraine.
I think it depends on how close the Cell Towers are to you at the time. And how accurate the database I'm currently querying is...
I'm adding some debug options, so when I'm out next week to my familys 100 miles away I can test its accuracy along the way
For me on the map its about the still some distance from my actual location..but I'm still getting the correct town and start of postcode (KA18 1)
(see my attached image)
EDIT: I have noticed (for me) that removing some points after the decimal on the co-ordinates gets it a lot more accurate!
See the 1st attached image for these coords: 55.4550,-4.2679
But then look at the 2nd image for these coords: 55.45,-4.26
Using only 2 places after the decimal brings my location to just a few hundred metres from my precise location
3rd Image: Shows latest build, showing approx street name and county, Which for only using CellID and no GPS what so ever then I think its pretty accurate...
I have attached to this post the latest build for anyone who can test it with the new coords settings, see how accurate it is for them!
Thanks, Dave
Hi, I tested it in Germany on my HD2.
I could find my Location. I'm living on the country and it found a Location 5 km from me.
I Click on Update Status and got the message Status Updated.
But on Facebook, nothing happend.
Location much better, now gives town correctly.
For some weird reason, and I am assuming its pure CellID swithcing if I move the phone 2" across the room, the address returned changes from no 2 to no 77.
Not updating my FB though.
Yea same for me, I'm sitting 3ft from a window and if the phone is on my left (close to the window) its one location.. if its on my right then it changes location by a few hundred metres...
@avalon: I'm not sure how good this may be outside the UK/Ireland...
For the facebook problem:
See my attached images of the steps I take to get the access_token
1) Allow the facebook app to access your data etc..
2) Click to continue to ur token
3) Your token
4) Then (for now) you have to manually create a text file called settings with your access code in there..
(ahh wait, just noticed!)
You only copy the actual code, leaving out "access_token="
so for me my code starts with "1943" because "access_token=1943"
Hope that fixes the facebook updating problem
I deleted access_token= and now it works fine
It works in Germany, but I live on the country and the cells are very large.
So it couldn't be very exact.
Sent using RapidRead!
Quick update & Test build!
Now includes GPS for those who want a more accurate location!
Let me know what you all think of the current progress...
Any ideas/suggestions post them up and I'll be happy to implement them..
Still to come:
Internal Authorization for Facebook (75% Done)
Ideas/Suggestions:
(Show location on google maps, via internal browser)
Cheers, Dave
Use CellID works good.
On Use GPS, I got after a while the message "An Error Has Occured".
I don't know, which error, maybe I have no GPS Fix?
Could you inlarge the buttons "Use GPS" and "Use CellID"
Hey, I have resized the buttons
Change Log (FBLoc4.rar):
Added Satellite info - see how many satellites are in view and how many are locked-on
Changed all error messages to slightly more meaningful errors, So you know what part is having an error.
Preview Images:
003: Shows my Cell ID Location.
004: Shows my GPS Location.
If you show both results on google maps, it shows you CellID can be pretty accurate
Click for >> Google Map Showing Both Points
Red = CellID
Blue = GPS
Let me know how this one works for you
-Dave
I have Satellite Count 7/8
LAT=50,27039801
I couldn't see LON, it's to wide.
Error message: " Error Getting GPS Location"
With CELLID, I found my Location.
Okay thanks, I know where the error is coming from. Just hard to say why its doing it.
You are getting a gps fix so its not a coordinate problem :/
I'll add add a few debug messages to find the exact line/position it errors.
Try this version...
I added some messagebox's so I can pinpoint where the error occurs... As its working for me I can't replicate the problem...
(Just a thought.. Are you connected to the internet, WiFi or 3G,GPRS etc??)
You need the internet connected to be able to convert the coordinates into a location
If your are connected then the error comes from somewhere else...
Hi,
i have an internet connection.
Here are my last messages:
- Waiting for Response
- Got Reponse
- Splitting Location Array
- Putting Array into variables
- Error Getting GPS Location
Doing some UK travelling later this week, I will try and run screen caps to check the CellID and GPS locations, see how close they are.
Ahh thanks, I now know where the error is coming from.. Now I just need to fix it
Try this ver, added more messages around the area where the error occurs.
Working messages should be:
"DEBUG: Var 1"
"DEBUG: Var 2"
"DEBUG: Var 3"
then 3 msgbox with the 3 location variables
And if all goes well then should say: "DEBUG: Return Found Location"
-----
Thanks, deedee
I'll be doing the same this weekend on a trip to my family.. a good 100 miles or so, and then a few trips to town aswell.. which is another 10-20 miles.
I'll have a good idea of accuracy hopefully by then end of it. Just now at my house the difference between GPS and CellID is about 410 ft apart
Hi,
the messages:
-DEBUG: Var 1
-DEBUG: Var 2
-DEBUG: Var 3
-DEBUG: 0
-DEBUG: 0
-Error Getting GPS Location
-DEBUG: finish
Okay, The problem lies in the splitting of the list it receives after getting the location..
WAIT lol.. I just remembered from previous apps I've made and then confirmed it..
Because your coordinates the separator is , instead of the expected decimal .
Which then is causing the error
Simple fix: Just check if the coords have , then replace it with . then it should be fixed!
EDIT: Test the attached build, please
Yes, you find it, my separator is ","
You are to fast, will test it
It works quick and fine.
Now I got "Error Update Status" on Facebook, if I tap on "Update Status"

How to debug device or carrier bugs?

Hi,
I am experiencing a serious problem. I recently released an updated on my app "Funny Jokes" from modern creation. The update is meant to enhance the user experience by adding a few new cool features. However, since the update, there are a small number of users experiencing "Initialization Failure" when starting the app. According to my code, this error only happens when the internet connection is spotty. However, the users report that they have perfect good 3g or wifi. I have no idea what causes this error since it works perfectly fine on my own phone, the simulator and a few friends who have installed my app. However, since angry customers tend to leave reviews, the reviews since the update have been mostly negative. Its really hurting my app. Is there any way that Microsoft can help me debug this problem? since I don't have all the devices on all different carriers? I really don't know what to do at the moment.
Also can some of the developers help me on this problem? I am here attaching the xap file, will you please let me know if the app works on your phone and if it doesn't, can you please let me know what device you use, your carrier, and country. Thanks very much.
Works fine for me (Samsung Focus, HTC Surround, both ATT), no errors at all. BTW, you may check proper handling of advertising control (try-catch, check if null etc.)
P.S. As for your app design: you definitely should add an option to change text size! Default font is too small...
Also, button or item "Instant joke" (randomly selected but of course not repeated!) will be great.
Hi, sensboston,
Thanks for your help and suggestions. I will implement the two suggestions in the following updates. Are you from Boston area? Really appreciate your input. I am really bothered by some users not able to open the app correctly. I really want to help them, but don't know how.
Hi,
Looking at your code I think your real question is "Why is my Azure odata connection / query failing for some users"?
Do you know if it is *always* failing for those users - i.e. every single time - or does it occasionally happen?
If it's *always* failing for certain users:
- It may not be a connection error that your code is detecting, perhaps the error could also be a problem with the query you're issuing. I notice you dynamically build it in the LoadMessages() method (on the string.format line) using App.LastMessageID; is it possible that certain values will cause an invalid query? Is it possible for them to become corrupt, *or null*, etc. for some users? Write some code in to check they are valid values before using them (and use defaults if they are null or invalid) - i.e. just before the string.format line. A null won't cause string.format to fall over, but it will mess up your query.
- I see you are storing LastMessageID in IsolatedStorage on the phone - this makes me wonder if the settings from a previous version of the app are confusing the current version, or if it's become corrupt some other way. Remember that issuing an update to an app does not reset the application's settings (e.g. IsolatedStorage) back to defaults. E.g. Is there a scenario where for certain users since the update their App.LastMessageID has become null or set to an invalid value? It's an easy one to miss because the emulator always starts 'fresh', and when you ask friends to test it's usually just on the latest version (they might not have installed it over a previous version). Again, check your values before the string.format line for nulls or validity.
If it's occasionally failing:
- Your code isn't handling the fact well enough that Internet connections can drop at *any* moment - even for a micro-second - and users won't necessarily notice that (and tell you their signal was fine). Code always needs to handle that kind of eventuality any time you make a connection to a web service (such as Azure). At the moment you are just outputting a message box message and then just letting the app do nothing else which will frustrate users - you could instead have a screen with a 'retry' button, and maybe even something that will send/email you an error report if it keeps happening (you could include the error's message and inner exception etc.).
- It may be that Azure is returning an occasional error - even the best databases get occasional temporary errors for a variety of reasons (too many users, internal connection error,...). You need to detect and handle that in the same way as internet connection errors.
I don't think it's to do with carriers or phone type unless they are blocking access to the azure url / ports you are using - that sounds pretty unlikely as Azure is such a well known service, especially on WP7.
Just as a final thing (maybe not important) your code's logic doesn't handle the scenario of 'no error is returned but at the same time 0 messages are returned' and same for 0 categories (perhaps this isn't possible).
Hope that helps, and best of luck fixing it.
Ian
otherworld said:
Hi,
Looking at your code I think your real question is "Why is my Azure odata connection / query failing for some users"?
Do you know if it is *always* failing for those users - i.e. every single time - or does it occasionally happen?
If it's *always* failing for certain users:
- It may not be a connection error that your code is detecting in the completed event - perhaps the error could also be a problem with the query you're issuing. I notice you dynamically build it (on the string.format line) using App.LastMessageID; is it possible that certain values will cause an invalid query? Is it possible for them to become corrupt, *or null*, etc. for some users? Write some code in to check they are valid values before using them (and use defaults if they are null or invalid) - i.e. just before the string.format line. A null won't cause string.format to fall over, but it will mess up your query.
- I see you are storing LastMessageID in IsolatedStorage on the phone - this makes me wonder if the settings from a previous version of the app are confusing the current version, or if it's become corrupt some other way. Remember that issuing an update to an app does not reset the application's settings (e.g. IsolatedStorage) back to defaults. E.g. Is there a scenario where for certain users since the update their App.LastMessageID has become null or set to an invalid value? It's an easy one to miss because the emulator always starts 'fresh', and when you ask friends to test it's usually just on the latest version (they might not have installed it over a previous version). Again, check your values before the string.format line for nulls or validity.
If it's occasionally failing:
- Your code isn't handling the fact well enough that Internet connections can drop at *any* moment - even for a micro-second - and users won't necessarily notice that (and tell you their signal was fine). Code always needs to handle that kind of eventuality any time you make a connection to a web service (such as Azure). At the moment you are just outputting a message box message and then just letting the app do nothing else which will frustrate users - you could instead have a screen with a 'retry' button, and maybe even something that will send/email you an error report if it keeps happening (you could include the error's message and inner exception etc.).
- It may be that Azure is returning an occasional error - even the best databases get occasional temporary errors for a variety of reasons (too many users, internal connection error,...). You need to detect and handle that in the same way as internet connection errors.
I don't think it's to do with carriers or phone type unless they are blocking access to the azure url / ports you are using - that sounds pretty unlikely as Azure is such a well known service, especially on WP7.
Just as a final thing (maybe not important) your code's logic doesn't handle the scenario of 'no error is returned and at the same time 0 categories are returned' (perhaps this isn't possible).
Hope that helps, and best of luck fixing it.
Ian
Click to expand...
Click to collapse
Hi, Ian,
Wow, what a great reply. I am so grateful for your inputs.
From the reviews, it seems that the app is always failing, and even when users uninstall/reinstall doesn't solve the problem. However, the previous version didn't have this problem. Which leaves me to believe is not the problem with IsolatedSetting. However, its definitely a good idea to check if the LastMessageID is null before using it.
Another speculation is that my new version uses a WCF service hosted on azure, while my previous version only used odata connection. I am guessing the WCF service on azure is not available to all carrier and devices. But the question is that they should see a different error instead of the reported one. And I was hoping to reproduce this problem so I can be confident that its fixed in my next update. Without being able to reproduce it, it makes everything just a little bit harder.
Another suggestion: you may simulate "no connectivity/very slow connection/Azure service not responding" issues by using "tethered" PC connection (if your handset connected to PC via USB cable, it uses your PC connection). Install traffic shaper (like NetLimiter) and try to play...
sunxin8086 said:
Are you from Boston area?
Click to expand...
Click to collapse
Yep.
Thanks, I will try to play with it. however, its desirable to let the app quit when there is no connection. But some users report they experience this error when they have perfect connection.
I can recreate it (the error) on a device it would seem consistently (tried about five times)
Uninstall it if already installed and reboot
reinstalling it (I'm using the Application Deployment tool for this)
reboot the device
Run it: First time I run it I get the error, second time (and subsequent) it's fine.
Note that before running it (and getting the error) I have checked I have internet (e.g. by loading a page in IE). This happens using sim card, wifi, or tethered connection (with wifi off) - tethered should be pretty reliable so can't see that being a connection drop.
This is on an LG panther pre-nodo developer device.
Hope that gives some clues.
All the best,
Ian
Hi, Ian,
Thanks for your update. Were you able to recreate it on a post-nodo device? unfortunately, I don't have a pre-nodo device at my hand.
I don't have a post-nodo device handy to test it on unfortunately. It seems to be happening only soon after startup (it's ok if I leave it a while) as though something on the phone isn't ready yet. Maybe it's not the same therefore as what your users are experiencing (as it's not 'always') but if you think it will help do a version of the xap which outputs the exception message in the message box (just for testing purposes) and I'll see what it says.
Hi, Ian,
Thanks. Last night, I made a new version that generates an email with exception info when initialization failed. Also checks the LastMessageID to see if its null. Let me know if this fixes the problem, and if not, send me the exceptions, please. Thanks for your help.
Hi,
The error report you generate is at the bottom of this message. As you can probably see (if I'm reading it correctly) the error (for my device at least) is not actually the loading of the categories - it seems to be the when you open the push channel as you have no try catch around that.
Note the interesting .net behaviour (if I'm reading your code correctly) that when you first check the error in LoadCompletedEventArgs 'e' of categories_LoadCompleted it is null, but when you subsequently check it - after the open push channel attempt - it contains the push channel exception. It must just retrieve the latest async open error (i.e. that of the push channel not opening).
I would suggest you wrap your push channel open code with a try catch that does the following:
catch (InvalidOperationException e)
{
HandleInvalidOperationException(e);
return;
}
catch (Exception e)
{
// if you're here it's most likely an error in your code rather than one with the push channel
}
This is the sort of things I check for and handle appropriately (if you find a way of checking a code or enum rather than a string match on the message text let me know):
private void HandleInvalidOperationException(InvalidOperationException e)
{
if (e.Message == "Channel not opened")
{
//This exception is raised when a notification channel has not been opened yet for raw notifications.
}
else if (e.Message == "Failed to open channel")
{
//This exception is raised when the notification channel failed to open. Try opening the notification channel again.
}
else if (e.Message == "Channel quota exceeded")
{
//This exception is raised when either trying to open more than one notification channel per application, or when trying to open more than 15 notification channels per device.
}
//InvalidOperationException(Notification server temporarily unavailable)
else if (e.Message == "Notification server temporarily unavailable")
{
//The Microsoft Push Notification Service is unavailable.
}
// unknown if you reach here
}
I also check if there is a channel uri after opening (there sometimes isn't) and if there isn't I set a timer to check it every second until 60 seconds have passed. If it reaches 60 and the uri updated event hasn't fired I assume that the device's power level is too low for a push channel at the moment (about 25% battery will do this on some devices).
It sounds like you could just continue past your current issue though -i.e. your problem may well be the Push call, not the load categories, so with the right try catch etc. (with a revised/recoded check on whether the categories have loaded) you could always continue into the app with a gentle warning that push might be down. Have a play with that second error check in the load categories completed event - you might instead want to have that second 'if' as an 'else if' so that it doesn't get confused by subsequent errors (i.e. other than the categories loading service call).
Hope that's helped.
Cheers,
Ian
Your error report:
Query URL: /JokeCategories?$filter=Hidden eq 0
Outer Exception Message:
Failed to open channel
Outer Exception StackTrace:
at Microsoft.Phone.Notification.SafeNativeMethods.ThrowExceptionFromHResult(Int32 hr, Exception defaultException, NotificationType type)
at Microsoft.Phone.Notification.HttpNotificationChannel.Open()
at FunnyJokes.MainPage.SubscribeToPush()
at FunnyJokes.MainPage.categories_LoadCompleted(Object sender, LoadCompletedEventArgs e)
at System.Data.Services.Client.DataServiceCollection`1.<>c__DisplayClassd.<>c__DisplayClassf.<BeginLoadAsyncOperation>b__b()
at System.Reflection.RuntimeMethodInfo.InternalInvoke(RuntimeMethodInfo rtmi, Object obj, BindingFlags invokeAttr, Binder binder, Object parameters, CultureInfo culture, Boolean isBinderDefault, Assembly caller, Boolean verifyAccess, StackCrawlMark& stackMark)
at System.Reflection.RuntimeMethodInfo.InternalInvoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, StackCrawlMark& stackMark)
at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
at System.Delegate.DynamicInvokeOne(Object[] args)
at System.MulticastDelegate.DynamicInvokeImpl(Object[] args)
at System.Windows.Threading.DispatcherOperation.Invoke()
at System.Windows.Threading.Dispatcher.Dispatch(DispatcherPriority priority)
at System.Windows.Threading.Dispatcher.OnInvoke(Object context)
at System.Windows.Hosting.CallbackCookie.Invoke(Object[] args)
at System.Windows.RuntimeHost.ManagedHost.InvokeDelegate(IntPtr pHandle, Int32 nParamCount, ScriptParam[] pParams, ScriptParam& pResult)
Hi, Ian,
I think that must be it. That totally explains why a small number of users would get this. However, where I am confused that categories_LoadCompleted is the handler for when categories load finishes, and takes LoadCompletedEventArgs, it should only be triggered in the above case. Why failing opening a channel also leads to this handler is puzzling me. Is it feature of .Net or a bug?
To be more specific, if open the channel failed, shouldn't the myPushChannel_ErrorOccurred method called instead of the categories_LoadCompleted? I am deeply confused now.
You just have to check for errors in two places (and you're currently only checking in one) - it would be nice if the error event handled everything but unfortunately it can't; e.g. take the 'InvalidOperationException ' case of no channels being left on the device (quota exceeded), if there's no channel ever created in the first place then there's nothing to assign the error event to anyway; hence why you need to check both on initialisation (with the try catch around the open - see above), and once you've set it going (with the error event).
In your error event you can check what the problem is using a nice enum:
switch (e.ErrorType)
{
case ChannelErrorType.ChannelOpenFailed:
break;
case ChannelErrorType.MessageBadContent:
break;
case ChannelErrorType.NotificationRateTooHigh:
break;
case ChannelErrorType.PayloadFormatError:
break;
case ChannelErrorType.PowerLevelChanged:
// 0 is normal, 1 is low, 2 is critical
if (e.ErrorAdditionalData == (int)ChannelPowerLevel.LowPowerLevel || e.ErrorAdditionalData == (int)ChannelPowerLevel.CriticalLowPowerLevel)
// note a value of 0 here is not an error
break;
}
Ian
Thanks Ian for the explanation. I got this part, however, what still puzzles me is why the InvalidOperationException got captured in the categories_LoadCompleted method. shouldn't this method only called from within the odata class? Is this a feature of .net or a bug??
I agree it doesn't seem to make sense You have no try catch, yet the exception is seemingly being bubbled up a level and then contained somehow within your categories_LoadCompleted method.
The reason is found by decompiling the DataServiceCollection class. Here's part of what happens when you call LoadAsync - notice that when an error occurs (i.e. the push channel exception) your completed event is actually being called a second time (as it is contained in the bolded try catch below), and this time it contains the new InvalidOperationException. Obviously you'll need to code around this behaviour. You'll probably be fine knowing that, but is there a way you can keep the code in the completed method just for completion of loading categories (and subscribe to push, load messages, etc. elsewhere)? It might be good to do that just to help avoid encountering the same confusing situation elsewhere.
Hope that helps!
Ian
Code:
private void BeginLoadAsyncOperation(Func<AsyncCallback, IAsyncResult> beginCall, Func<IAsyncResult, QueryOperationResponse> endCall)
{
this.asyncOperationInProgress = true;
try
{
beginCall.Invoke(delegate(IAsyncResult ar)
{
Deployment.get_Current().get_Dispatcher().BeginInvoke(delegate
{
try
{
QueryOperationResponse queryOperationResponse = endCall.Invoke(ar);
this.asyncOperationInProgress = false;
if (this.LoadCompleted != null)
{
this.LoadCompleted.Invoke(this, new LoadCompletedEventArgs(queryOperationResponse, null));
}
}
[B]catch (Exception error)
{
this.asyncOperationInProgress = false;
if (this.LoadCompleted != null)
{
this.LoadCompleted.Invoke(this, new LoadCompletedEventArgs(null, error));
}
}[/B]
}
);
}
);
}
catch (Exception)
{
this.asyncOperationInProgress = false;
throw;
}
}
You are the man. Yeah, I plan to keep the loadCompleted method clean, so I will try to catch the exception in the subscribeToPush method. Thank you so much for all your help. Couldn't do it without you.
Hi, Ian,
Hope you can see this. I pushed out an update with the error reporting for my app two days ago. The version was pushed before I realized the error has something to do with Push Channel failed to open. However, from the user report, I found another rather interesting and confusing error.
Query URL: /Messages?$filter=Hidden eq 0 and Version eq 1,5 and ID gt 0
Outer Exception Message:
An error occurred while processing this request.
Inner Exception Message:
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<error xmlns="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">
<code></code>
<message xml:lang="en-US">Syntax error at position 29.</message>
</error>
At first, its kinda shocking to me that why my Version was transformed to "1,5", instead of "1.5"(comma instead of period). After googling it, I found it has something to do with CultureInfo. Wow, I would never thought about this, if I don't get an error report. Supporting multi-region is a lot tougher than I thought.
You have to be careful anywhere you use dates, doubles, etc. as string.format (or most string methods) format them according to regional settings of the user - so unless you specify otherwise a user in Germany will see 1,5 whereas a UK user will see 1.5. This is a good thing usually as people get to see numbers and dates in the format they're used to.
You can get round it (when you need to have it a specific way e.g. for your query) using the InvariantCulture (which tells it to not use the current region's settings). E.g. for your versionid:
string.Format(CultureInfo.InvariantCulture.NumberFormat, "{0:0.0}", VersionID);
Will always (off the top of my head - make sure you test it) output using a decimal point rather than a comma.
A simpler way for you might be just to store the version ID as a string in the first place if that doesn't affect anything.
You can test all this in the emulator by e.g. changing the country to Germany and seeing if everything still works.

[Q] Cell ID Location for GPS Intermediate Driver

Hi guys. I'm a newbie in the Windows Mobile world.
Is there an app that allows CellID to be collected by the MsAPI GPS Intermediate Driver? This would surely reduce the locking time of GPS device and even provide a quick instant Facebook Places using Dorothy browser which unlike Android browser which uses hard gps fix.
I found and tried the GPS Mod Driver which suppose to doing this. However, the CellID does not seems to updates even when I updates it. This means that my location was stuck at location A even when I'm in other location.
The CellID is revealed by opening a session to the RIL and calling RIL_GetCellTowerInfo(). The structure returned only has the ID of the Cell Tower in it, not its location.
A secondary lookup has to be performed to translate this into an actual Lat-Long location. Most CellID lookup web services are paid for subscriptions or restricted in their scope.
The Siglog application in the signature below, will display the cell ID, but it does not translate across to the location. That comes out of the GPS driver.
Also, there is nothing in the MS Intermediate GPS driver that lets you supply it with a previously obtained location. You just open it, and then wait for a location changed event, when it gets a usable satellite lock.
Hi alexysc88. I've been using gpsmod for quite a while now on my blackstone, and I've used it across several ROMS without a problem. In fact, I use it the way you describe your needs. XDAFacebook picks up my lat/long almost instantly when I use the check-in feature, same with pocket twit.
I think you don't get the same results that I do because gpsmod doesn't really work immediately (at least not accurately) after installing. After a fresh install, I disable HTC's built-in location service, and set gpsmod to replace it. Then when I go travelling around, I enable my GPS app. I "enable internet data" when I know I'll have consistent 3G signal, otherwise I disable it, but then I manually "update" gpsmod at the end of each day or when I have fast Wifi available. Eventually, gpsmod will return my lat/lon as soon as any gps app with increasing accuracy over time.
This doesn't mean that it is able to switch to cell tower location info when it can't pick up a GPS signal. gpsmod only uses cell tower location initially, then hands-off to the GPS radio after a second or two.
I hope this helps.

[Q] Gnex port to page plus - looking for help on getting data to work

Hi everyone,
Thank you for the great info on getting the galaxy nexus over to page plus.
I've followed dragonhart's youtube video, a blog post based on that
http://innominatethoughts.com/technology/guide-galaxy-nexus-on-pageplus/#comment-180
and gone through some of the original threads referenced in the discussions
http://forum.xda-developers.com/showthread.php?t=1696621
http://forum.xda-developers.com/showpost.php?p=43697770&postcount=936&nocache=1&z=3537060567177832
I probably hit half of the snags mentioned in those articles but have overcome most so far. The one i'm stumped on is the ETS script to program the via chipset.
When running the script after putting in the appropriate values, I get the following error:
Code:
ETS, Id=CP Fault, Unit=HLW... Code 1=HLP_ERR_ACTIVE_PARM_PROFILE_ID, Code 2=0x00000001, Fault Type=Continue
Stepping through the code, this occurs on the line (approx) 106, where the active profile id is set:
Code:
ETS, Id=CP Active Profile ID Set, ParmOperationId=Profile Id of Active Profile Set, opType=Parm Custom Value, ActiveProfile=0
The script finishes, installing back to VZW Toro rom and placing simcard results in talk and text but no data.
If I change the ActiveProfile to 1 instead of 0, the script finishes with no errors but installing VZW Toro rom + sim card still results in talk and text but no data.
I also tried modifying the line below to set the number of profiles set parameter to 2 instead of 1 (I just took a wild guess that since I was using profile id 1, I needed to change it). It had no effect.
Next, i thought maybe my sim card was bad so I ordered a new one. Still no go.
I've reinstalled the via drivers and ets multiple times and gone through the process multiple times after restoring factory settings with *#*#786#*#* each time.
SID, IMEI, MIN, MDN are all verified and correct.
Does anyone have any good suggestions on what I am doing wrong?
Thanks a ton for all the helpful posts on the forums so far. I've been learning alot.
data was working for a little while
Actually as I think of it now, I remember that data was indeed working for a day or two.
However, i was using my verizon sim card from my previous verizon account (where I migrated from to pageplus).
I know this b/c I see that 10mb was used so data was working.
Then suddenly 3G stopped working. I'm guessing they disabled my verizon subscription and my account as well.
However, I've gotten a new sim card and it still doesn't work. Do you think they've essentially somehow 'banned' my phone?

Categories

Resources