In the Facebook android tutorial we are told to use following code to create a key hash:
keytool -exportcert -alias androiddebugkey -keystore ~/.andro
There are two ways to generate Hashkey for Facebook.
You can use the following code snippet
try {
PackageInfo info = getPackageManager().getPackageInfo(getPackageName(), PackageManager.GET_SIGNATURES);
for (Signature signature : info.signatures) {
MessageDigest messageDigest= MessageDigest.getInstance("SHA");
messageDigest.update(signature.toByteArray());
String hashKey = new String(Base64.encode(messageDigest.digest(), 0));
Log.i("Hash Key ", "value is " + hashKey);
}
} catch (NoSuchAlgorithmException e) {
Log.e("Exception ", "is ", e);
} catch (Exception e) {
Log.e("Exception ", "is ", e);
}
You can create Hashkey for Facebook Online by pasting your SHA1 on This link
Happy Coding :)