yelp / yelp-android Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
"Prior to December 7, 2017 the API used OAuth 2.0 to authenticate requests to the API. In an effort to simplify authentication, starting March 1, 2018 the API will no longer use OAuth 2.0 for requests and will move over to only API Keys. The token endpoint will be deprecated March 1, 2018, at which point you will no longer be able to make requests to it. "
-source: Yelp (https://www.yelp.com/developers/documentation/v3/authentication#where-is-my-client-secret-going)
Is there an update to support this in the roadmap? We're closing in on less than a month with no announced update for the yelp-android project.
@tzuhanwu any thoughts on using below gradle dependency ?
'com.ryanharter.auto.value:auto-value-parcel:0.2.0'
If the number of business to return is limited (e.g. params.put("limit", "3");), then searchResponse.businesses().size() will be 3 but searchResponse.total() seems to return the # of businesses that match the criteria without the limit. Is this expected ?
I would like to create a sample using yelp-android, but I get following exception
javax.net.ssl.SSLHandshakeException: java.security.cert.CertPathValidatorException: Trust anchor for certification path not found
How to know or get certification path?
Any idea on when we can expect a YelpFusion version? If you need help, I'd be happy to contribute as well.
As of Android plugin 2.4.0, annotation processors must be explicitly declared now. The auto-value-1.2.jar dependency on the compile classpath contains an annotation processor. Please add it to the annotationProcessor configuration.
In previous versions of the Android plugin for Gradle, dependencies on the compile classpath were automatically added to the processor classpath. That is, you could add an annotation processor to the compile classpath and it would work as expected. However, this causes a significant impact to performance by adding a large number of unnecessary dependencies to the processor.
See: https://developer.android.com/r/tools/annotation-processor-error-message.html in order to prepare the library for later Android development environment releases.
I receive this error quite a bit when invoking the Search endpoint:
com.yelp.clientlib.exception.exceptions.InvalidSignature
An issue was closed last month that had some similarities (Issue #36), but I'm not sure it was fully resolved as the solution was listed as simply just using RX libraries.
Here is give or take my exact implementation, some days it works, some days I get the above error:
YelpAPIFactory apiFactory = new YelpAPIFactory(Constants.YELP_CONSUMER_KEY,
Constants.YELP_CONSUMER_SECRET,
Constants.YELP_TOKEN,
Constants.YELP_TOKEN_SECRET);
YelpAPI yelpAPI = apiFactory.createAPI();
Map<String, String> params = new HashMap<>();
// general params
params.put("limit", "10");
params.put("radius_filter","16094");
params.put("actionlinks","true");
params.put("term", "restaurants");
params.put("cll", latitude + "," + longitude);
final Call<SearchResponse> yelpDataCall = yelpAPI.search(getCity(latitude,longitude), params);
yelpDataCall.enqueue(new Callback<SearchResponse>() {
@Override
public void onResponse(Call<SearchResponse> call, Response<SearchResponse> response) {
int statusCode = response.code();
SearchResponse yelpData = response.body();
}
@Override
public void onFailure(Call<SearchResponse> call, Throwable t) {
// com.yelp.clientlib.exception.exceptions.InvalidSignature
Log.d("Yelp", t.toString());
}
});
Building a project with Maven dependency:
<dependency> <groupId>io.github.ranga543</groupId> <artifactId>yelp-fusion-client</artifactId> <version>0.1.3</version> </dependency>
results in the following Maven error:
The following artifacts could not be resolved: io.github.ranga543:yelp-fusion-client:jar:0.1.2, com.android.support:appcompat-v7:jar:25.1.1: Failure to find io.github.ranga543:yelp-fusion-client:jar:0.1.2 in https://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced
Version 0.1.3 and 0.1.2 both result in the same error.
Just created a brand new project, want to test this library, can't compile due to the following: (gradle attached at the end)
Error:FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':app:transformResourcesWithMergeJavaResForDebug'.
com.android.build.api.transform.TransformException: com.android.builder.packaging.DuplicateFileException: Duplicate files copied in APK META-INF/LICENSE
File1: /Users/JeffreyLiu/.gradle/caches/modules-2/files-2.1/com.fasterxml.jackson.core/jackson-databind/2.7.2/84ffa765dd258dbab8695963c41308b054f3a1cb/jackson-databind-2.7.2.jar
File2: /Users/JeffreyLiu/.gradle/caches/modules-2/files-2.1/com.google.auto.value/auto-value/1.1/f6951c141ea3e89c0f8b01da16834880a1ebf162/auto-value-1.1.jar
File3: /Users/JeffreyLiu/.gradle/caches/modules-2/files-2.1/com.fasterxml.jackson.core/jackson-core/2.7.2/8b8310381b690e317f5f0574e9b2dd7034778b4c/jackson-core-2.7.2.jar
File4: /Users/JeffreyLiu/.gradle/caches/modules-2/files-2.1/com.fasterxml.jackson.core/jackson-annotations/2.7.0/19f42c154ffc689f40a77613bc32caeb17d744e3/jackson-annotations-2.7.0.jar
Try:
Run with --stacktrace option to get the stack trace. Run with --debug option to get more log output.
===============gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 24
buildToolsVersion "24.0.3"
defaultConfig {
applicationId "com.qvivr.testyelp"
minSdkVersion 18
targetSdkVersion 24
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:24.2.1'
compile 'com.android.support:design:24.2.1'
testCompile 'junit:junit:4.12'
compile 'com.yelp.clientlib:yelp-android:2.0.0'
}
seeing the error on async search API callback:
Call call = yelpAPI.search(coordinate, queryParams);
public void onFailure(Call call, Throwable t)
this throwable has below message.
"com.yelp.clientlib.exception.exceptions.InvalidSignature:"
I double checked the yelp credentials and initialization code, they seem correct. Is it known issue ?
There is no main activity in android source. It does not build When i import this project in Android studio.
could you please help?
Would there also be support for using Java Rx? Seems like a cleaner way to call api for data
I added the following code to YelpAPI.java and also added the necessary libraries.
@GET("/v2/business/{businessId}")
Observable<Business> getBusinessRx(@Path("businessId") String businessId);
This way we can use subscriptions for cleaner code at the developer's end
Looks like it's a good idea to have ProGuard rules set up, let's take a look and integrate with the SDK.
YelpAPIFactory error:
java.lang.NoClassDefFoundError: Failed resolution of: Lse/akerfeldt/okhttp/signpost/OkHttpOAuthConsumer;
at com.yelp.clientlib.connection.YelpAPIFactory.(YelpAPIFactory.java:37)
I am sure my CONSUMER_KEY, CONSUMER_SECRET, TOKEN, TOKEN_SECRET are correct.
Can anyone help me with this? Thank you!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.