Good day. The question on the use of library VK. How to get a profile picture, using VKSDK\ Can not find the right information on the Internet.
In your request you need to specify one of the following fields: photo_50 or photo_100 or photo_200:
VKRequest yourRequest = VKApi.users().get(VKParameters.from(VKApiConst.FIELDS,"photo_50"))
After that when you will retrieve users data you can get photo_50:
yourRequest.executeWithListener(new VKRequest.VKRequestListener() {
@Override
public void onComplete(VKResponse response) {
super.onComplete(response);
VKUsersArray usersArray = (VKUsersArray) response.parsedModel;
for (VKApiUserFull userFull : usersArray) {
Log.i(TAG, "Avatar image URL: " + userFull.photo_50);
}
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With