반응형

Platform/Android 124

[Asset] asset에서 읽은 이미지 base64 인코딩 된 이미지로

asset에서 읽은 이미지 base64 인코딩 된 이미지로 private HashMap createInstallManagerInfo() throws Exception { HashMap installHashMap = new HashMap(); //asset에서 읽은 이미지 -> bas64 인코딩된 이미지로 AssetManager assetManager = getResources().getAssets(); InputStream is = null; is = assetManager.open("seal.jpg"); byte[] buf = new byte[1024]; int bytesRead; ByteArrayOutputStream output = new ByteArrayOutputStream(); while ((..

Platform/Android 2020.08.06

[INTENT] URL 로 Activity 호출

나의 경우에는 하위 모듈에서 app 상의 activity를 호출할 때 사용하였다. https://gun0912.tistory.com/13 [안드로이드/Android]URL로 액티비티 실행하는 방법(Custom URL Scheme) 우리는 보통 Activity를 실행시킬때 아래와 같이 코드를 작성합니다. Intent intent = new Intent(this,AAA.class); startActivity(intent); 만약 URL을 실행하고싶은 경우, 아래와 같이 해당 URL을 적어주고 ACT.. gun0912.tistory.com

Platform/Android 2020.07.23

[Bitmap] Uri 에서 Bitmap을 얻는 방법

uri를 얻어온 후, Bitmap으로 바꾸는 방법입니다! (ex. 갤러리를 통해 사진을 가져올 때) Android P 이상부터 ImageDecoder를 사용해서 가져올 수 있습니다. +) MediaStore.Images.Media.getBitmap(ContentResolver cr, Uri url) 은 API29에서 @deprecated 되었다고 합니다. ImageDecoder가 성능이 좋다나 ..? Bitmap bitmap = null; try { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) { bitmap = ImageDecoder.decodeBitmap(ImageDecoder.createSource(getContentResolver(), imageUr..

Platform/Android 2020.07.07
반응형