Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Finding Direction in iPhone like in Compass?

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.

like image 500
AppAspect Avatar asked Sep 09 '10 10:09

AppAspect


People also ask

Can my iPhone act as a Compass?

The Compass app comes pre-installed on every new iPhone, and can help you figure out your direction and elevation. Though not always accurate, the iPhone's Compass app can come in handy when you want to make sure you're on the right path.

How do I know the direction of my iPhone?

Just tap on the GPS coordinates in the Compass app to launch Maps. You then can tap the navigation icon in the bottom left until you turn on compass mode, which will orient the map with magnetic north. Once you know where north is on the map, you can find your target on the map and guesstimate your direction of travel.

How does iPhone know which way is north?

The magnetometer in your smartphone measures the Earth's magnetic field. Then it uses the WMM to align Magnetic North to Geographic North and determines your location in relation to the magnetic field.


2 Answers

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

like image 198
akshayk80 Avatar answered Sep 21 '22 16:09

akshayk80


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

like image 25
Adhees Avatar answered Sep 19 '22 16:09

Adhees