By: Sagar Chamling
sudo apt install git
public class ImageUtil { | |
/** | |
* | |
* @param base64Str Base64 string for the image. | |
* @return Bitmap value for the image. | |
* @throws IllegalArgumentException | |
*/ | |
public static Bitmap convert(String base64Str) throws IllegalArgumentException { | |
byte[] decodedBytes = Base64.decode( | |
base64Str.substring(base64Str.indexOf(",") + 1), |
class BitmapUtils { | |
private static final String FILE_PROVIDER_AUTHORITY = "np.com.ravigarbuja.emojifyme.fileprovider"; | |
/** | |
* Resamples the captured photo to fit the screen for better memory usage. | |
* | |
* @param context The application context. | |
* @param imagePath The path of the photo to be resampled. |
public class DpPixelConversion { | |
public static int dpToPx(Context context, float dp) { | |
return (int) (dp * ((float) context.getResources().getDisplayMetrics().densityDpi / DisplayMetrics.DENSITY_DEFAULT)); | |
} | |
public static float pxToDp(Context context, float px) { | |
return px / ((float) context.getResources().getDisplayMetrics().densityDpi / DisplayMetrics.DENSITY_DEFAULT); | |
} | |
} |
https://developer.android.com/studio/publish/app-signing.html
Build and sign your app from terminal:
keytool -genkey -v -keystore my-release-key.jks -keyalg RSA -keysize 2048 -validity 10000 -alias my-alias
To get debug key certificate:
keytool -exportcert -alias androiddebugkey -keystore ~/.android/debug.keystore | openssl sha1 -binary | openssl base64
To get release key certificate: