`

MASF server of Google

 
阅读更多

从下面Android代码可以得到一些有限的提示:

http://www.netmite.com/android/mydroid/frameworks/base/location/java/com/android/internal/location/LocationMasfClient.java

 

Service to communicate to the Google Location Server (GLS) via MASF server

 

// Methods exposed by the MASF server
private static final String REQUEST_QUERY_LOC = "g:loc/ql";
private static final String REQUEST_UPLOAD_LOC = "g:loc/ul";

 

可以认为,MASF是一个中继服务器,客户端和MASF服务器交互,然后MASF服务器再和Google真正的服务器交互。

客户端和MASF服务器交互通过HTTP协议,数据格式是protocol buffer,已经有jar包:

https://github.com/android/platform_external_googleclient/blob/master/googleclient-lib.jar

在请求的数据中,可以指定请求的服务的URL,版本号等信息。

 

一些定义:

  public static final short PROTOCOL_VERSION_0_0 = 0;
  public static final short PROTOCOL_VERSION_0_1 = 1;
  public static final short SERVICE_VERSION_0 = 0;
  public static final short SERVICE_VERSION_1 = 1;
  public static final short SERVICE_VERSION_2 = 2;
  public static final int BLOCK_TYPE_REQUEST_HEADER = 1;
  public static final int BLOCK_TYPE_REQUEST_PLAIN = 256;
  public static final int BLOCK_TYPE_REQUEST_MULTIPART = 257;
  public static final int BLOCK_TYPE_RESPONSE_NON_MULTIPART = 33024;
  public static final String ENCODING_GZIP = "g";
  public static final String ENCODING_NOP = "n";
  public static final String ENCODING_NONE = "";
 
分享到:
评论
1 楼 wuzhi11love 2013-03-08  
好像从MASF返回的定位数据需要单独处理一下,然后才能用protocol buffer的格式来处理

相关推荐

Global site tag (gtag.js) - Google Analytics