Okey, I\'ve done all the business, followed all the steps, but still can\'t get it to work. The simple Example app that comes with the Facebook SDK, is working on the emulator a
If the keytool command doesn't work for you, I found a way around that stuff: you can just reverse engineer which key to put as Key Hash in the Facebook Developer section. Within your Activity just print out the Key Hash by doing:
try {
PackageInfo info = getPackageManager().getPackageInfo("[your package name, e.g. com.yourcompany.yourapp]", PackageManager.GET_SIGNATURES);
for (Signature signature : info.signatures) {
MessageDigest md = MessageDigest.getInstance("SHA");
md.update(signature.toByteArray());
Log.d("Hash Key:", Base64.encode(md.digest()));
}
} catch (NameNotFoundException e) {
} catch (NoSuchAlgorithmException e) {
}
This worked for me. The MessageDigest class is included in the JDK. The Base64 class not. You can use this one for example.