ranga543 / yelp-fusion-android Goto Github PK
View Code? Open in Web Editor NEWAn Android library for the Yelp Fusion API v3
License: MIT License
An Android library for the Yelp Fusion API v3
License: MIT License
I don't know how to get more than 50 results for a business search made.
For some reason, the maximum value for limit can be set to only 50. The getTotal method gives me 328 results when I set the limit to 50.
This only lets me get 50 results out of 328. How do I get the rest 278 results?
Thanks.
public class selectionPage extends AppCompatActivity {
TextView mRestaurantTitle, mRateCat;
ImageView mMainImage;
YelpFusionApiFactory mApiFactory;
YelpFusionApi mYelpFusionApi;
Map<String, String> mParams;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
this.requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.selection_page);
mRestaurantTitle = (TextView) findViewById(R.id.titleLabel);
mRateCat = (TextView) findViewById(R.id.rateCatLabel);
mMainImage = (ImageView) findViewById(R.id.mainImage);
Picasso
.with(this)
.load("http://i.imgur.com/DvpvklR.png")
.into(mMainImage);
mMainImage.setOnTouchListener(new OnSwipeTouchListener(this){
public void onSwipeTop() {
Toast.makeText(selectionPage.this, "top", Toast.LENGTH_SHORT).show();
}
public void onSwipeRight() {
Toast.makeText(selectionPage.this, "right", Toast.LENGTH_SHORT).show();
}
public void onSwipeLeft() {
Toast.makeText(selectionPage.this, "left", Toast.LENGTH_SHORT).show();
}
public void onSwipeBottom() {
Toast.makeText(selectionPage.this, "bottom", Toast.LENGTH_SHORT).show();
}
});
mApiFactory = new YelpFusionApiFactory();
try {
mYelpFusionApi = mApiFactory.createAPI(
getResources().getString(R.string.appId),
getResources().getString(R.string.appSecret)
);
} catch (IOException e) {
e.printStackTrace();
}
mParams = new HashMap<>();
mParams.put("term", "indian food");
new FetchPictures().execute();
}
class FetchPictures extends AsyncTask<String, String, String> {
@Override
protected void onProgressUpdate(String... values) {
super.onProgressUpdate(values);
}
@Override
protected String doInBackground(String... params) {
Call<SearchResponse> call = mYelpFusionApi.getBusinessSearch(mParams);
Response<SearchResponse> response = null;
try {
response = call.execute();
} catch (IOException e) {
e.printStackTrace();
}
if(response != null) {
Log.v("Business", response.body().getBusinesses().toString());
}
// call.enqueue(callback);
return null;
}
}
}
Map<String, String> params = new HashMap<>();
params.put("term", "Boba");
params.put("latitude", "37.86701009652528");
params.put("longitude", "-122.2539898316383");
Call<SearchResponse> call = yelpFusionApi.getBusinessSearch(params);
This is my SearchResponse call to get params, but get java.lang.NullPointerException: Attempt to invoke interface method 'retrofit2.Call com.yelp.fusion.client.connection.YelpFusionApi.getBusinessSearch(java.util.Map)' on a null object reference
This is after I long click on my android screen, to invoke a business search (Trying to make a basic yelp app in android).
In the examples it shows two calls, Call call = yelpFusionApi.getBusinessSearch(params); and Call call = yelpFusionApi.getBusinessSearch("San Francisco", params);
getBusinessSearch only takes in Map<String, String> params, so why is there an extra string in the arguments?
NOTE: the instructions seem pretty straightforward so I'm actually super confuse why I'm having so much trouble....
So I’ve been running into a number of problems all of which force my app to crash the first being when i make a call to the YelpFusionApiFactory’s createAPI function passing the appID and the AppSecret. I was able to get around this by going to a third party (i.e. Rapid) which generated the access token. i know use the …Factory’s createAPI function passing in the access token. however this does not fix the original problem i was having the next few problems all occur when trying to use the actual api for instance calling execute on the response object....i am a newbie to yelp and android studio...though i feel i have come accustom to android studio .....THANK YOU IN ADVANCE FOR ANY HELP
the app itself doesn't do anything.. at the moment I'm just trying to get comfortable with api
Is there any plan to release a fix for the new Authentication method?
They no longer use the clientid + app secret any more.
https://www.yelp.com/developers/documentation/v3/authentication#where-is-my-client-secret-going
When trying to pass a list of businesses from one activity to another, it fails with Caused by: java.io.NotSerializableException: com.yelp.fusion.client.models.Category
It appears as though Category is not serializable. Can changes be made to fix this?
When I try to compile this, I get an error about:
../yelp-fusion-android-master/bintray.properties (No such file or directory)
Should I make my own such file? If so, how do I know what it looks like?
I note this file is in your gitignore, but it seems like it's needed for the code below in your gradle file:
Properties bintrayProperties = new Properties()
bintrayProperties.load(project.rootProject.file('bintray.properties').newDataInputStream())
bintray {
user = bintrayProperties.getProperty('user')
key = bintrayProperties.getProperty('key')
configurations = ['archives']
pkg {
repo = 'android'
name = 'yelp-fusion-client'
userOrg = 'ranga543'
licenses = ['MIT']
vcsUrl = 'https://github.com/ranga543/yelp-fusion-android.git'
publish = true
githubRepo = 'ranga543/yelp-fusion-android'
githubReleaseNotesFile = 'README.md'
version {
name = '0.1.5'
desc = 'Yelp Fusion Client 0.1.5'
released = new Date()
vcsTag = 'v0.1.5'
gpg {
sign = true
passphrase = bintrayProperties.getProperty('gpg.password')
}
}
}
}
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
Dependency:
<dependency>
<groupId>io.github.ranga543</groupId>
<artifactId>yelp-fusion-client</artifactId>
<version>0.1.3</version>
<type>pom</type>
</dependency>
results in:
Failure to find com.android.support:appcompat-v7:jar:25.1.1 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 errors.
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.