0

How can I retrieve an URL that contains a large avatar with Twitter fabric on Android? I have tried already:

            Twitter.getApiClient(session).getAccountService().verifyCredentials(true, false, new Callback<User>() {
                @Override
                public void success(Result<User> result) {
                    User user = result.data;

                    Map<String, String> values = new HashMap<>();
                    values.put(Contributor.ID, user.idStr);
                    values.put(Contributor.NAME, user.name);
                    values.put(Contributor.USERNAME, user.screenName);
                    values.put(Contributor.AVATAR, user.profileImageUrlHttps);
                    values.put(Contributor.COVER, user.profileBannerUrl);
                    values.put(Contributor.LOCATION, user.location);
                    values.put(Contributor.ABOUT, user.description);

                    loginRequest(VENDOR_TWITTER, values);
                }

                @Override
                public void failure(TwitterException e) {
                    ...
                }
            });

This results in a small image. Is there a way to build an URL to make direct access to that file such as: https://pbs.twimg.com/profile_images/{id}/avatar.jpg?size=large or similar?

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
Angga Ari Wijaya
  • 1,759
  • 1
  • 15
  • 31

1 Answers1

0

Yes, there is a way.

My avatar image is

https://pbs.twimg.com/profile_images/687638251939753984/V_ykmwaR_normal.png

If you take off the _normal you will get a larger image.

https://pbs.twimg.com/profile_images/687638251939753984/V_ykmwaR.png

Note not all users have higher resolution avatars.

Terence Eden
  • 14,034
  • 3
  • 48
  • 89