Re: Geolocation API

On Jun 13, 2008, at 7:50 AM, Jon Ferraiolo wrote:

> Two comments:
>
> (1) I think pretty much all device APIs (location, battery,  
> connection status, SMS message queue, camera, ...) should have  
> asynchronous APIs. Certainly in the general case not every API will  
> be able to respond synchronously. Some implementations might require  
> some network communication for either completion of the operation or  
> verify identity and credentials. Since at least some of the future  
> set of mobile device APIs will need to be asynchronous and that in  
> at least some cases (albeit perhaps a small percentage) the  
> geolocation API in particular will need to be asynchronous, I  
> suggest that the geolocation API have an async design (i.e., the  
> "getlocation()" method passes a callback function).
>

In agreement regarding async apis for Geolocation.  I do not know what  
we will do with the other device APIs;  probably off topic.


> (2) For notification APIs (e.g., listenForReports()), why not use  
> AddEventListener and therefore leverage DOM events?
>

Not a bad idea, but the current APIs are passing options when setting  
up the listener.  How would you handle that?

Regards,
Doug

Received on Friday, 13 June 2008 15:40:44 UTC