Mapbox 方向 API Android 不工作

Mapbox Directions API Android not working

我开始为我的应用程序使用 Mapbox Directions API,我正要检查它是否有效。我浏览了 Antonio Zugaldia 的博客,他在那里解释了如何通过简单的步骤显示方向。 (https://www.mapbox.com/blog/android-directions-library/)

所以我开始实现所有代码并尝试 运行 该应用程序,但没有成功。我调试应用程序,发现流程在这一行中断:

Response<DirectionsResponse> response = client.execute();

当我调试这一行的时候,我看到它在OkHttpCall.javaclass中的方法名中掉了下来:

public Response<T> execute() throws IOException

最后一行是:

return parseResponse(rawCall.execute());

那么我怎样才能使导航更容易呢?

感谢您的提问,抱歉给您带来麻烦。对于我们所有的服务,包括 Directions API,我们现在使用的是 Mapbox Android 服务,它比原始库更强大。我们这里有 documentation on how to install it here, and full example for Directions。希望这可以帮助。