我们计划为Google StreetView创建Google Cardboard体验.谷歌已经公开了谷歌街景API,以根据位置和角度获取图像.如果我使用此API,我需要根据用户头部移动来拼接图像.用户可以水平360度,垂直180度观看物体.如何基于StreetView API实现此功能以及我需要多长时间才能发出请求以及组合图像的最佳方式是什么.有没有什么办法可以直接在com.google.vrtoolkit.cardboard.CardboardView中使用"com.google.android.gms.maps.StreetViewPanoramaView"?感谢提前..
我正在尝试使用Retrofit 2.0.0.beta2,如下所示设置Converter for Gson
Retrofit retrofit = new Retrofit.Builder()
.baseUrl(BASE_URL)
.addConverterFactory(GsonConverterFactory.create())
.build();
Run Code Online (Sandbox Code Playgroud)
这个gradle抛出错误之后
GsonConverterFactory无法转换为Factory
怎么解决???
Retrofit的先前版本使用RestAdapter并提供了启用日志的功能。为什么在Retrofit 2.0中删除了该功能?
要启用日志,我必须这样做。
Retrofit retrofit = new Retrofit.Builder()
.baseUrl(BASE_URL)
.addConverterFactory(GsonConverterFactory.create())
.build();
/** Handles Log */
retrofit.client().interceptors().add(new LoggingInterceptor());
class LoggingInterceptor implements Interceptor {
@Override
public Response intercept(Interceptor.Chain chain) throws IOException {
Request request = chain.request();
long t1 = System.nanoTime();
Logger.d(String.format("Sending request %s on %s%n%s",
request.url(), chain.connection(), request.headers()));
Response response = chain.proceed(request);
long t2 = System.nanoTime();
Logger.d(String.format("Received response for %s in %.1fms%n%s",
response.request().url(), (t2 - t1) / 1e6d, response.headers()));
// Logger.d(""+new String(response.body().bytes()));
return response;
}
Run Code Online (Sandbox Code Playgroud)
这是唯一的解决方案?以前的规定非常方便...
如果我们在一个字符上调用setCharacteristicNotification,而不是在值Change上给出远程通知?如何在蓝牙LE中的中央设备上启用远程通知?