I\'m working on an Android app, in which I want to integrate a Facebook posting feature. I downloaded the Facebook-Android SDK, and I got the readme.md (text file) in there,
Add this code to onCreate
of your activity, it will print the hash under the KeyHash tag in your logCat
try {
PackageInfo info = getPackageManager().getPackageInfo(
getPackageName(),
PackageManager.GET_SIGNATURES);
for (Signature signature : info.signatures) {
MessageDigest md = MessageDigest.getInstance("SHA");
md.update(signature.toByteArray());
Log.d("KeyHash:", Base64.encodeToString(md.digest(), Base64.DEFAULT));
}
}
catch (NameNotFoundException e) {
}
catch (NoSuchAlgorithmException e) {
}
You can add multiple hashkeys for your account, so if you been running in debug don't forget to run this again in release mode.