AbAppletic AbAppletic - 3 days ago 4
Android Question

How can I create identicons using Java or Android?

I've seen many questions about this, but all of them are C#. None of them are Java, and I couldn't find a proper library for this.

image

What library can do this for me programmatically by giving it a string/hash? This algorithm is actually implemented on StackExchange.

Answer

I solved the problem.

I used Gravatar. I first got the link of the image and stored it as a String like this:

String identiconURL = "http://www.gravatar.com/avatar/" + userID + "?s=55&d=identicon&r=PG";

Then, I used Glide:

Glide.with(ProfilePictureChooserActivity.this)
      .load(identiconURL)
      .centerCrop()
      .into(imageView);
Comments