本文介绍了在Android的Yelp的集成的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要整合Yelp的API在我的Andr​​oid应用程序。我从来没有这样做所以需要一点帮助。我想知道我怎么开始,有什么事情都需要等。

I have to integrate yelp api in my android app. I have never done it so need a bit of help.I want to know how do I start, what all things are required, etc.

我尝试实施这一code https://github.com/Yelp/yelp-api/blob/master/v2/java/Yelp.java在机器人。它提供了在的NoSuchMethodError线request.send()

I tried implementing this code https://github.com/Yelp/yelp-api/blob/master/v2/java/Yelp.java in android.It gives a NoSuchMethodError at line request.send()

可能是什么问题?

推荐答案

有关Yelp的集成在Android的:

For Yelp Integration in Android:

第1步:注册Yelp的网站。你将需要Yelp的钥匙。 这里注册。获取API访问权限。

Step 1: Register to Yelp site. You will require Yelp keys. Register here . Get API access.

第二步:您需要有刻划1.2.1.jar在您的项目。 这里得到它。

Step 2: You need to have scribe-1.2.1.jar in your project. Get it here.

第三步:添加这两个文件在您的项目:的和 YelpApi2.java

Step 3: Add these 2 files in your project: Yelp.java and YelpApi2.java.

第四步::您可以从Yelp.java删除main()方法,而是从你的活动调用Yelp.search()。搜索()需要3 arguements:长期,经度和纬度。期限是您要搜索的东西(如餐馆,酒吧等)。

Step 4: You can remove the main() method from the Yelp.java and instead call the Yelp.search() from your activity. Search() takes 3 arguements: term,latitude and longitude.Term is the thing you want to search(eg. restaurants,bars,etc.).

第五步::当你发送请求,你会得到一个JSON响应。解析获取数据的响应。有关JSON响应参数的详细信息,请看到这个

Step 5: When you send the request, you get a json response. Parse the response to get the data. For more information on json response parameters, See this.

按照以下步骤,你就可以做Yelp的集成在你的Andr​​oid。看到Yelp的提供的API文档。

Follow these steps and you will be able to do Yelp Integration in your Android.See the the Api documentation provided by Yelp.

我发现了另外一个例子:Yelp示例

Another example which I found out: Yelp Example

这篇关于在Android的Yelp的集成的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-15 19:35