Football Fans: Download the 2012 Schedule App from Google Play!


Go Back   Android Forums > Android Development > Application Development

Application Development Dev Lounge for the Coder Folks



Reply
 
LinkBack Thread Tools
Old November 21st, 2011, 06:36 PM   #1 (permalink)
New Member
 
Join Date: Nov 2011
Posts: 6
 
Device(s):
Thanks: 1
Thanked 0 Times in 0 Posts
Default Camera API / GPS / Compass?

Hi all,

How to get Camera direction of GPS enabled phone?

All i found about GPS is that it just tells the location of the device, how do one get the direction where camera is pointing with GPS enabled phone?

For example, I need to see the camera api and work out which direction the camera is pointing. So that I can see the direction I'm viewing. In the other word, it is work like a compass.

Can anyone assist me on this or any suggestion tutorials or website to look at?

Much appreciated.
theBorneo

theBorneo is offline  
Reply With Quote
Sponsors
Old November 28th, 2011, 07:18 AM   #2 (permalink)
Member
 
Join Date: Dec 2010
Location: Aarhus, Denmark
Posts: 134
 
Device(s): SE Xperia X10
Thanks: 2
Thanked 22 Times in 22 Posts
Default

You shouldn't rely on the GPS sensor to tell you which way you are looking. The direction given by the GPS is based on your prior movement, meaning that you would have to move a considerable distance while looking in that same direction to get anything precise.

You need to use the magnetic sensor and the accelerometer to get the compass direction of the phone. Here is an example of how it is done:

Coding for Android: Using orientation sensors: Simple Compass sample

HF
JamTheMan is offline  
Reply With Quote
The Following User Says Thank You to JamTheMan For This Useful Post:
theBorneo (December 1st, 2011)
Old December 1st, 2011, 11:28 AM   #3 (permalink)
New Member
 
Join Date: Nov 2011
Posts: 6
 
Device(s):
Thanks: 1
Thanked 0 Times in 0 Posts
Default

Thanks for the thoughts JamTheMan - One question though -- How does android mob work with the data? Say for example one of this app that has been created (star walk) - where do you keep the database? Does most android use SQLite? If yes, how does it works?

For example on this scenario, where you keep the names of the stars? images? etc etc. What kind of data be held in tables in the database and how does it incorporate with the android? Any suggestion?
theBorneo is offline  
Reply With Quote
Old December 1st, 2011, 11:41 AM   #4 (permalink)
New Member
 
Join Date: Nov 2011
Posts: 6
 
Device(s):
Thanks: 1
Thanked 0 Times in 0 Posts
Default

Thanks hubtraining, but on that tutorial I can't see any about tutorial building a database with android?
theBorneo is offline  
Reply With Quote
Reply

Bookmarks


Go Back   Android Forums > Android Development > Application Development User CP
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -5. The time now is 11:49 AM.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
Custom vBulletin Skins by: Relivo