Has anyone been able to get the iPhone compass working in LiveCode?
I've tried the "How do I get the Location and use the Digital Compass in iOS?" lesson example and none of the compass-related functionalities work for me:
I can start "Location Tracking" and get my current location in the simulator and on my iPhone 4, even though "iphoneCanTrackLocation ()" and "iphoneStartTrackingLocation" produces an error when not running on the simulator or a real iPhone 4.
However, the heading tracking doesn't work; "iphoneStartTrackingHeading", "iphoneCanTrackHeading ()" and "iphoneCurrentHeading()" all produce errors and don't work on the iOS simulator or an actual iPhone 4.
My environment:
LiveCode 4.5.3 (also tested on colleague's LiveCode 4.6.1, iphoneCanTrackHeading () returns false)
XCode version 4.0.2
iOS Simulator version: 4.3
iPhone 4 OS: 4.3.2
Does anyone have any idea what I might be doing wrong or any suggestions on how to access compass data using LiveCode?
Thanks,
Gordon.
Digital Compass and iOS
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Re: Digital Compass and iOS
I managed to get everything to dump to a bunch of text fields.
Very heavily based on the examples in the documentation, with some added code for the fields and compass.
It worked on my iPhone 3GS. Updated every few feet as I went for a walk.
Hope this helps.
Very heavily based on the examples in the documentation, with some added code for the fields and compass.
It worked on my iPhone 3GS. Updated every few feet as I went for a walk.
Hope this helps.
- Attachments
-
- gps.livecode.zip
- (2.34 KiB) Downloaded 360 times
Check out my LiveCode program, WriteSpire, on the App Store!
Re: Digital Compass and iOS
Thanks for your example. I've just tested it on my iPhone 4 after associating it with one of my provisional profiles. I select "GPS On", but then pressing the "get location" button doesn't do anything.
I've attached my Livecode file to this post:
BTW, which version of LiveCode are you running?
I've attached my Livecode file to this post:
- When I run it on the simulator or on iPhone, none of the green buttons do anything.
- After starting location tracking, "Get current location" displays the GPS location OK.
- After I click "Start Heading Tracking", clicking "Get current heading" displays "1" on the status field, but it doesn't show any compass information in the other field.
BTW, which version of LiveCode are you running?
- Attachments
-
- navRadar.livecode.zip
- (3.07 KiB) Downloaded 307 times
Re: Digital Compass and iOS
Hi gwyy,
have you resolved your issue? Me too I have your exact problem, and I can't figure out why...
have you resolved your issue? Me too I have your exact problem, and I can't figure out why...
Re: Digital Compass and iOS
Hi Shankez,
I think it's the version of LiveCode I was using. It won't work on 4.5.3 because apparently the compass is not supported. I don't think it's supported on 4.6.1 either. It was some time ago, but I think I got it going temporarily after I managed to download a demo of 4.6.2, but don't quote me on that. Unfortunately, I'm still using LiveCode 4.5.3 and things have gotten too busy for me since then, so I've not come back to it yet. I do wish the online docs and examples tell you which LiveCode versions are supported!!!
G.
I think it's the version of LiveCode I was using. It won't work on 4.5.3 because apparently the compass is not supported. I don't think it's supported on 4.6.1 either. It was some time ago, but I think I got it going temporarily after I managed to download a demo of 4.6.2, but don't quote me on that. Unfortunately, I'm still using LiveCode 4.5.3 and things have gotten too busy for me since then, so I've not come back to it yet. I do wish the online docs and examples tell you which LiveCode versions are supported!!!
G.