DroidForums.net is the original Verizon Android Forum! Registered Users do not see these ads. Please Register - It's Free!
Results 1 to 9 of 9

Thread: How to calculate distance between two droids?

  1. Droid Newbie
    Chrispyk's Avatar
    Member #
    182504
    Join Date
    Mar 2011
    Posts
    4
    Phone
    Enter Current Phone Model Here
    #1

    How to calculate distance between two droids?

    Well, let's kill two birds with one thread. I'm new here, and I'm looking to develop a Droid game. I can code it, but I'd like to see if there's some easier way than what I have planned now.

    My game needs to know the relative distance between multiple droid phones and one central droid phone (all running my game). I have two theories on how that might be achieved.
    1: require a particular GPS program be installed on each phone, and use that data to calculate the distance, or
    2: Have one phone put out a signal of some sort, and have other phones use the amplitude of the signal to determine how close they are.

    Is anyone familiar enough with this stuff to recommend a solution, or shall I blaze a trail? Thanks in advance!
  2. Master Droid
    Skull One's Avatar
    Member #
    45849
    Join Date
    Mar 2010
    Posts
    760
    Liked
    9 times
    Phone
    iPhone 4S daily. Droid and DX
    #2
    First you need to define: What is the granularity of distances you want to measure. IE feet, yards, miles?

    Your 1st idea is useless because your app can talk directly to the GPS of the phone without needing to have an extra program.

    Your 2nd idea is unworkable under more conditions than I care to list.
    Facts are the very first casuality of bad information.
  3. Droid Newbie
    Chrispyk's Avatar
    Member #
    182504
    Join Date
    Mar 2011
    Posts
    4
    Phone
    Enter Current Phone Model Here
    #3

    Red face

    Ideally, I'd like to have it return feet, but yards is workable. I can't use a margin bigger than that, though.

    And sorry about my lack of knowledge on the Droid's capabilities, that's why I'm here.
  4. Droid Ninja
    Snow02's Avatar
    Member #
    159755
    Join Date
    Jan 2011
    Posts
    1,343
    Liked
    27 times
    Phone
    Droid X
    #4
    It sounds like this might be a good place to start.
    http://developer.android.com/guide/t...-location.html
  5. Master Droid
    Skull One's Avatar
    Member #
    45849
    Join Date
    Mar 2010
    Posts
    760
    Liked
    9 times
    Phone
    iPhone 4S daily. Droid and DX
    #5
    Ok feet it is.

    Does your app have to work indoors?

    How many feet can it be off and not render the data useless?


    EDIT:
    And Snow02 found the link I was looking for.
    Facts are the very first casuality of bad information.
  6. Droid Newbie
    Chrispyk's Avatar
    Member #
    182504
    Join Date
    Mar 2011
    Posts
    4
    Phone
    Enter Current Phone Model Here
    #6
    It's all for outdoors (if they go indoors, they lose). And it can be off by no more than 2-3 yards and still be accurate enough for my purposes. Obviously, less than that is better, but I know battery life can be an issue.
  7. Droid Newbie
    Chrispyk's Avatar
    Member #
    182504
    Join Date
    Mar 2011
    Posts
    4
    Phone
    Enter Current Phone Model Here
    #7
    And that link is incredibly helpful, btw. Many thanks, Snow02.
  8. Droid Ninja
    Snow02's Avatar
    Member #
    159755
    Join Date
    Jan 2011
    Posts
    1,343
    Liked
    27 times
    Phone
    Droid X
    #8
    No problem. That's the go-to site for any android app development questions. For the most part, it does a great job of walking you through implementing specific features. Best of luck.

    And you might want to check out the game Home Invasion. It sounds very similar to what you're working on.
  9. Master Droid
    Skull One's Avatar
    Member #
    45849
    Join Date
    Mar 2010
    Posts
    760
    Liked
    9 times
    Phone
    iPhone 4S daily. Droid and DX
    #9
    Quote Originally Posted by Chrispyk View Post
    It's all for outdoors (if they go indoors, they lose). And it can be off by no more than 2-3 yards and still be accurate enough for my purposes. Obviously, less than that is better, but I know battery life can be an issue.
    Excellent, so you can use true GPS to determine position instead of cell tower data.

    If memory serves, been a while since I played with the live data, you need 4 sats to get a 3D fix on your location. But the float error can be as large as 900 feet. 5 sats can get you down into the 150 feet float error area. 6 sats can get you down into the 30 foot. 7 sats can get you down to 15 feet. But if you do averaging of the data over time you can actually reduce this issue greatly.

    Buildings higher than 10 feet could screw with your accuracy if the sat is low on the horizon.

    There is also the issue of drift, that can screw up your positioning data. WAAS is used to correct that and I am unsure if the Android OS has access to that data.
    Facts are the very first casuality of bad information.

Links

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Similar Threads

  1. Cake - The Distance
    By tpoynor in forum Droid Ringtones
    Replies: 0
    Last Post: 03-08-2010, 12:36 AM
  2. Measuring Distance
    By homemadehitshow in forum Android Applications
    Replies: 11
    Last Post: 02-23-2010, 03:07 PM
  3. Distance Traveled app?
    By kidtelex in forum Android Applications
    Replies: 1
    Last Post: 01-10-2010, 09:58 AM
  4. Short Distance Navigational IM
    By goodnluck2000 in forum Android Hacks and Help
    Replies: 9
    Last Post: 12-01-2009, 09:13 PM

Search tags for this page

android calculate distance between two devices
,
app distance between two phones
,
distance between devices
,

distance between two android phones

,

distance between two phones

,
find distance between two phones
,
find distance using phone
,
masure distance by two android phone
,

measure distance between two phones

,
measuring relative distance between two android phones
Click on a term to search our site for related topics.

Tags for this Thread

Find us on Google+