android


trying to get results from youtube api via retrofit


get request endpoint method defined in api interface
#GET("youtube/v3/search")
Callback<YoutubeResponse> getYouTubeVideos(#Query("key") String apiKey,
#Query("channelId") String channelId,
#Query("part") String videoPart,
#Query("order") String videoOrder,
#Query("maxResults") int maxResults,
Callback<ChannelListResponse> callback);
Method call to get the results :
Callback <YoutubeResponse> call = apiService.getYouTubeVideos(API_KEY,
"UCjXfkj5iapKHJrhYfAF9ZGg", "snippet", "date", 20, new Callback<ChannelListResponse>() {
#Override
public void onResponse(Call<ChannelListResponse> call, Response<ChannelListResponse> response) {
Log.v("check", response.body().getEtag() + "check");
}
#Override
public void onFailure(Call<ChannelListResponse> call, Throwable t) {
}
}) ;
I am not getting results via this implementaion giving illegal stat exception .
There is some structual mistake because the log says Unable to create call adapter for retrofit2.Callbackfor method ApiInterface.getYouTubeVideos
using these additional links to implement the same . Using this reference link for help : YouTube Data API v3 search JSON response retrofit parsing error
But If keep the return type of getYouTubeVideos() as void. Then it says service method can not have void return type .
A help in this regards will be appreciated
Please correct the retofit syntax like this.
api interface,
#GET("youtube/v3/search")
Call<ChannelListResponse> getYouTubeVideos(#Query("key") String apiKey,
#Query("channelId") String channelId,
#Query("part") String videoPart,
#Query("order") String videoOrder,
#Query("maxResults") int maxResults);
Method call,
Call<ChannelListResponse> call = apiService.getYouTubeVideos(API_KEY,
"UCjXfkj5iapKHJrhYfAF9ZGg", "snippet", "date", 20);
call.enqueue(new Callback<ChannelListResponse>() {
#Override
public void onResponse(Call<ChannelListResponse>call,
Response<ChannelListResponse> response) {
Log.d(TAG, "onResponse");
}
#Override
public void onFailure(Call<ChannelListResponse>call, Throwable t) {
// Log error here since request failed
Log.e(TAG, t.toString());
}
});

Related Links

How to recover a project that is installed on my smartphone
Android Studio folders and Version Control for small projects (SVN)
Firebase Enabling Offline Capabilities on Android
Android - If WebView visible an extra, buggus, View is also is created
Azure Geography Datatype and Android
Ajax basic authentication using Cordova prompting for credentials
android:Theme.Holo.Light. using right libraries
Trouble with implementing app for different screens on Android
Make fails due to multiple target patterns, when compiling android msm kernel for nexus 6p
Change the onClick method of a button programmatically?
I am an Android System app. Can I delete myself without root access?
Emojis issue in android
Concat two mp4 video programatically
Check the username and password using .NET Webservice (SOAP)
how can android https connection with volley?
$cordovaFile.writeFile () throws an error always in ionic IOS whenever i try to click a picture and send an api request with it in ionic?

Categories

HOME
notepad++
eclipse
ggplot2
pagination
character-encoding
youtube-data-api-v3
sublimetext
scripting
missing-data
mvc5
gluon-mobile
retrofit2
special-characters
dkim
filechannel
plink
docx
event-sourcing
esoteric-languages
null-pointer
feathersjs
charles
google-maps-autocomplete
symbols
microsoft-ocr
exploit
object-storage
tosca
jquery-callback
expressionengine3
itunes
nsurl
dotspatial
xbox
weather
jbutton
spring-security4
card.io
apns-php
gdata
mongoose-schema
azure-arm
naming
subclipse
install.packages
apollostack
memory-mapping
monkey-testing
vaadin-elements
chai-as-promised
configurationmanager
tinymce-3
reindex
static-cast
subnet
backbone-collections
oozie-coordinator
java-websocket
janus
google-photos
ampps
donations
taocp
meteor-packages
jboss-tools
dup
xdoclet
fink
thread-sleep
pushbots
grass
concept-insights
linklabel
qt5.2
coda
finalbuilder
google-refine
procedural-programming
rapidsvn
genymotion-call
angular-carousel
lambda-architecture
koala
solace-mq
windows-phone-8-sdk
css-reset
traceability
sqlclr
iboutlet
httponly
failing-tests
koken
gobject-introspection
cloudfiles
nhprof
undefined-index
resharper-6.0
opml
pagemethods
spread
wordprocessingml
unmanagedresources

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App