How to fetch large images from discogs api? - android

Is it possible to get higher quality images from discogs api? Right now I can only get a thumbnail image of size 150x150. Is there any way for developers to get a better quality image? The JSON only has link for thumnail images.
So if this is my request
https://api.discogs.com/database/search?page=1&per_page=1&key=my_key&secret=my_secret&q=Waka%20Waka
This is the response that I get
{
"pagination":{
"per_page":1,
"items":1731,
"page":1,
"urls":{
"last":"https://api.discogs.com/database/search?q=Waka+Waka&per_page=1&secret=my_secret&page=1000&key=my_key",
"next":"https://api.discogs.com/database/search?q=Waka+Waka&per_page=1&secret=my_secret&page=2&key=my_key"
},
"pages":1000
},
"results":[
{
"style":[
"Alternative Rock",
"Jazz-Rock",
"Fusion"
],
"thumb":"https://api-img.discogs.com/YokvweulGO7tRuNoSv3b1F4UntQ=/fit-in/150x150/filters:strip_icc():format(jpeg):mode_rgb():quality(40)/discogs-images/R-1378139-1466530254-6813.jpeg.jpg",
"format":[
"Vinyl",
"LP",
"Album"
],
"country":"US",
"barcode":[
"(31,456) RE I",
"(31,457) RE I",
"MS-2094 31456-1",
"MS-2094 31457-1",
"S1\u00b7MS 2094A 31456-Re1-T2 ",
"25 MS 20941 31457 Re1\u00b7T2",
"ASCAP"
],
"uri":"/Frank-Zappa-Waka-Jawaka-Hot-Rats/master/35744",
"community":{
"have":3089,
"want":1992
},
"label":[
"Bizarre Records",
"Reprise Records",
"Warner Bros. Records Inc.",
"Warner Bros. - Seven Arts Records, Inc.",
"Warner Bros. Records Inc.",
"Warner Bros. Records Inc.",
"Munchkin Music",
"Paramount Studios"
],
"catno":"MS 2094",
"year":"1972",
"genre":[
"Rock"
],
"title":"Frank Zappa - Waka / Jawaka \u2022 Hot Rats",
"resource_url":"https://api.discogs.com/masters/35744",
"type":"master",
"id":35744
}
]
}
I want to have larger images, how can I do that? Is that even possible? Thanks !!

When you search for releases you get an id that you can use to get more release info.
Make call to https://api.discogs.com/releases/{id}?key={your_key}&secret={your_secret}
Response usually has some image urls that you can download.

Related

How to post row data in array using Json in retrofit2

I am looking for post data on the server using retrofit2 in this format.
[
{
"BeneficiaryNameID": 1,
"BeneficiaryName": "Ronak",
"RFIDTag": "00000001",
"Village": "valsad",
"Faliya": "valsad",
"createDate": "10/4/2021 2:57:31 PM",
"RehabStatus": 1
},
{
"BeneficiaryNameID": 2,
"BeneficiaryName": "Rachna",
"RFIDTag": "00000002",
"Village": "gurgoun",
"Faliya": "test",
"createDate": "10/4/2021 2:57:31 PM",
"RehabStatus": 2
} ]
I have searched so many links but didn't get results. I waste my 2,3 hrs. Please help me.

How to change sequence of list View items in android

I have a calendar like this:
materialise calendar
every tic icon shows their corresponding event.
and I have a json response like this:
{
"Table": [
{
"userid": 4,
"eventname": "adi",
"eventdate": "/Date(1484121600000-0800)/",
"eventcolor": "2413AD",
"autoid": 2005
},
{
"userid": 4,
"eventname": "Aditya",
"eventdate": "/Date(1479974400000-0800)/",
"eventcolor": "5986FF",
"autoid": 1011
},
{
"userid": 4,
"eventname": "aditya",
"eventdate": "/Date(1484812800000-0800)/",
"eventcolor": "13AD1A",
"autoid": 2006
},
{
"userid": 4,
"eventname": "dfgdgdgs",
"eventdate": "/Date(1478678400000-0800)/",
"eventcolor": "AD3D1F",
"autoid": 1005
},
{
"userid": 4,
"eventname": "dfgdgdgs",
"eventdate": "/Date(1478678400000-0800)/",
"eventcolor": "AD3D1F",
"autoid": 1006
}
]
}
Here comes the real problem.When I click any date on the calendar, above json response comes in a listView according to sequence of json. But, I want to change the sequence according to which date i clicked(i.e. Date i am clicked in the calendar, that date comes first in the list and remaining item comes after that).
I'm not posting any code, If any one wants to see my code, please ask.
When you parse the list from JSON at that time you check the date of each object and compare to the clicked date and store that particular index.
Then you simply parse the list from JSON response
at parsing time you remove that particular object at that stored index and move to the first position of that list.
Use code like:
list.removeAt(stored_index);
list.add(0, objectOfList);
and then simply add that list to adapter

Android: Bing image search result customization

I am implementing the Bing search for image searching.
I refered this link, and change my response to JSON.
It works and the result is like:
{
"d": {
"results": [{
"__metadata": {
"uri": "https://api.datamarket.azure.com/Data.ashx/Bing/Search/Image?Query=\u0027Pepsi\u0027&$skip=0&$top=1",
"type": "ImageResult"
},
"ID": "64737694-fc53-4d68-933d-10edc214fd3a",
"Title": "Pepsi: Like Madonna, its look has been reinvented time and time again ...",
"MediaUrl": "http://tjthesportsgeek.files.wordpress.com/2012/02/pepsi.png",
"SourceUrl": "http://tjthesportsgeek.com/2012/02/14/tale-of-the-tape-coke-vs-pepsi/",
"DisplayUrl": "tjthesportsgeek.com/2012/02/14/tale-of-the-tape-coke-vs-pepsi",
"Width": "1588",
"Height": "2064",
"FileSize": "569827",
"ContentType": "image/png",
"Thumbnail": {
"__metadata": {
"type": "Bing.Thumbnail"
},
"MediaUrl": "http://ts2.mm.bing.net/th?id=OIP.M7f9b9a39639b9ca8bb6f1cba6e35d041H0&pid=15.1",
"ContentType": "image/jpg",
"Width": "369",
"Height": "480",
"FileSize": "19879"
}
},
// Next array element
]
}
}
but what i need is:
The json result with only MediaUrl and MediaUrl of Thumbnail. (As it is possible in Google Custom Search with the help of tag "field" like fields=items(link,image/thumbnailLink))
The image only with medium size. (I searched for this and applied the filter but of no use.)
Please reply with your valuable suggestions.
You can't filter output fields.
Use the parameter: ImageFilters = Size.Medium
My ref: https://onedrive.live.com/view.aspx?resid=9C9479871FBFA822!109&app=Word&authkey=!ACvyZ_MNtngQyCU

retrieve video (categoryID) from youtube using json

i want to upload youtube videos from my app and find those videos after.
to do so i uploaded the videos using v3 youtube api
here is part of the code that use to add title, description Etc.
snippet.setTitle("Test Upload via Java on " + cal.getTime());
snippet.setDescription(
"Video uploaded via YouTube Data API V3 );
// Set your keywords.
List<String> tags = new ArrayList<String>();
tags.add("test");
tags.add("example");
tags.add("java");
tags.add("YouTube Data API V3");
tags.add("erase me");
snippet.setTags(tags);
i want to add catagotyid so i just add :
snippet.setCategoryId("test");
in this moment the upload code stop to work, why ?
to retrieve all the video that upload by my app i need to fill in part line "snippet" (without Quotes) and in id line add my category id like "test" (without Quotes),
and then result catch by json ?
UPDATE :
How should I fill the "try it!" ? to recieve list of catagoryID, And assume that I got the list, how do I know which category to choose?, I think I'm missing something and I do not know what
Try a GET request on this:
https://www.googleapis.com/youtube/v3/videoCategories?part=snippet&regionCode=US&key={YOUR_API_KEY}
Of course you replace the {YOUR_API_KEY} with your key. You should get back something like this:
{
"kind": "youtube#videoCategoryListResponse",
"etag": "\"Fn7tolrWrLXf7uknBpwCU9OfMA8/jOw8Jx4EQq_udW-0UgiRcCMWqWQ\"",
"items": [
{
"id": "1",
"kind": "youtube#videoCategory",
"etag": "\"Fn7tolrWrLXf7uknBpwCU9OfMA8/gljmmWdkbtlCrMi74KVYLrbTaIA\"",
"snippet": {
"channelId": "UCBR8-60-B28hp2BmDPdntcQ",
"title": "Film & Animation"
}
},
{
"id": "2",
"kind": "youtube#videoCategory",
"etag": "\"Fn7tolrWrLXf7uknBpwCU9OfMA8/n1RtRMaPpKgph8MvS9wf742Tm5U\"",
"snippet": {
"channelId": "UCBR8-60-B28hp2BmDPdntcQ",
"title": "Autos & Vehicles"
}
},
{
"id": "10",
"kind": "youtube#videoCategory",
"etag": "\"Fn7tolrWrLXf7uknBpwCU9OfMA8/1LzYK9Uf9Nt0hzBqNqhuHw0LPI0\"",
"snippet": {
"channelId": "UCBR8-60-B28hp2BmDPdntcQ",
"title": "Music"
}
},

Tutorial on onpen_exchange rate

I am working on a currency calculator app in android and I am using the open-exchange rate api.I am having problems on how to call the json elements (Currencies),I need a json script that I can use to to display all the currencies and their values. The tricky part is how to get the currency part only.please help.
{
"disclaimer": "Exchange rates provided by [...]",
"license": "Data collected and blended [...]",
"timestamp": 1319730758,
"base": "USD",
"rates": {
"AED": 3.672626,
"AFN": 48.3775,
"ALL": 110.223333,
"AMD": 409.604993,
/* 160 fx rates available - see currencies.json */
"YER": 215.035559,
"ZAR": 8.416205,
"ZMK": 4954.411262,
"ZWL": 322.355011
}
}
Thanks

Categories

Resources