小编sre*_*mar的帖子

如何使用Google CardBoard SDK实施Google StreetView?

我们计划为Google StreetView创建Google Cardboard体验.谷歌已经公开了谷歌街景API,以根据位置和角度获取图像.如果我使用此API,我需要根据用户头部移动来拼接图像.用户可以水平360度,垂直180度观看物体.如何基于StreetView API实现此功能以及我需要多长时间才能发出请求以及组合图像的最佳方式是什么.有没有什么办法可以直接在com.google.vrtoolkit.cardboard.CardboardView中使用"com.google.android.gms.maps.StreetViewPanoramaView"?感谢提前..

android google-maps google-street-view google-cardboard

6
推荐指数
1
解决办法
1257
查看次数

错误:不兼容的类型:GsonConverterFactory无法转换为Factory

我正在尝试使用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

怎么解决???

android gson retrofit

6
推荐指数
2
解决办法
3488
查看次数

登录Retrofit 2.0

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)

这是唯一的解决方案?以前的规定非常方便...

rest android retrofit

5
推荐指数
1
解决办法
1065
查看次数

在Android(蓝牙低功耗)中启用蓝牙特性通知不起作用

如果我们在一个字符上调用setCharacteristicNotification,而不是在值Change上给出远程通知?如何在蓝牙LE中的中央设备上启用远程通知?

android bluetooth bluetooth-lowenergy gatt

3
推荐指数
2
解决办法
2万
查看次数