11

Do any one have idea for finding true direction using iPhone? I want to implement such application in which I need to find direction in which iPhone is pointing and want to make application same as compass application in iphone 3GS.

Does iPhone 3G supports compass functionality? And can any one tell me how compass application find directions so accurately like a real magnetic compass?

Please help me for this. I am in a critical situation.

Thanks in advance.

AppAspect
  • 4,461
  • 2
  • 30
  • 46

4 Answers4

10

here is a sample code link from apple.com for using magnetometer and Core Location https://developer.apple.com/library/ios/#samplecode/Teslameter/Introduction/Intro.html

you need to be logged in, in case you cant find the page, just look for Teslameter example in Sample Code section of https://developer.apple.com

Paul Peelen
  • 10,073
  • 15
  • 85
  • 168
akshayk80
  • 166
  • 2
  • 6
3

Here i have given you the simple PDF to get an overview about the Magnetometer, CLLocation and accelerometer functions. make a look about this.,

http://learningiphoneprogramming.com/pdf/The_Sensors_in_your_iPhone.pdf

Adhees
  • 31
  • 1
2

You can get lot of help from this link http://answers.oreilly.com/topic/1657-how-to-use-the-iphones-digital-compass/

also if you want to search it in Apple look for CLLLocationManager and UIAcelerometer. You will find the code hopefully.

Taimur.

Jezen Thomas
  • 13,619
  • 6
  • 53
  • 91
Taimur Ajmal
  • 2,778
  • 6
  • 39
  • 57
1

The iPhone 3GS has a magnetometer for detecting magnetic position, the 3G doesn't so you won't be able to do it on a 3G

Woody
  • 5,052
  • 2
  • 22
  • 28
  • If you just want to do an ordinary compass application on the iPhone 3GS or 4G, there is sample code on apples developer website – Woody Sep 09 '10 at 10:23
  • Can you please tell me the name of the application which is on apple developers website. I am not able to find any source code there. Please help me for this. – AppAspect Sep 09 '10 at 10:40