Received: by 10.68.233.137 with SMTP id tw9mr3554751pbc.6.1349902326200; Wed, 10 Oct 2012 13:52:06 -0700 (PDT) X-BeenThere: android-developers@googlegroups.com Received: by 10.68.237.161 with SMTP id vd1ls3778711pbc.3.gmail; Wed, 10 Oct 2012 13:50:05 -0700 (PDT) Received: by 10.68.189.37 with SMTP id gf5mr2545367pbc.16.1349902205558; Wed, 10 Oct 2012 13:50:05 -0700 (PDT) Date: Wed, 10 Oct 2012 13:50:04 -0700 (PDT) From: Nicholas Campion To: android-developers@googlegroups.com Message-Id: Subject: Strategy for Unknown Location MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_4_11396288.1349902204093" ------=_Part_4_11396288.1349902204093 Content-Type: multipart/alternative; boundary="----=_Part_5_8727779.1349902204094" ------=_Part_5_8727779.1349902204094 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Obviously, Android apps sometimes don't know their location (lastKnownLocation returns null, etc.). Internally, we deal with this by checking if the app wide Location object is null and substituting -999 for latitude and longitude ... something that is obviously invalid so we can quickly spot it. I'm wondering what other people do in this area. I looked at creating a Null Object Location but got kinda worried by the two constructors for Locations that I might be barking up the wrong tree. Anyone have ideas on how to deal with creating a substitute location when the OS won't provide one? ------=_Part_5_8727779.1349902204094 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 7bit Obviously, Android apps sometimes don't know their location (lastKnownLocation returns null, etc.). Internally, we deal with this by checking if the app wide Location object is null and substituting -999 for latitude and longitude ... something that is obviously invalid so we can quickly spot it.

I'm wondering what other people do in this area. I looked at creating a Null Object Location but got kinda worried by the two constructors for Locations that I might be barking up the wrong tree. Anyone have ideas on how to deal with creating a substitute location when the OS won't provide one?
------=_Part_5_8727779.1349902204094-- ------=_Part_4_11396288.1349902204093--