본문 바로가기

프로그래밍/Android-Java34

[ANDROID] Expected BEGIN_ARRAY but was STRING at line 1 column 1 path $ release apk 시, 위와 같은 에러가 뜨면서 apk가 만들어 지지 않음 build APK 후 generate signed apk 를 해주었더니 그제서야 apk 생성 2020. 10. 16.
[JAVA/Android] JNI proguard 난독화 buildTypes { release { minifyEnabled true signingConfig signingConfigs.release proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } 프로가드 활성화해서 apk파일을 만들고, 앱을 실행시키는 과정에서 JNI DETECTED ERROR IN APPLICATION: JNI GetJavaVM called with pending exception java.lang.NoSuchMethodError: no non-static mdethod ~~~ 라는 JNI 관련 에러가 뜨면서 앱이 죽는다.. 해결방법은 -keep public class TestClass.. 2020. 9. 23.
[JAVA] 소수점 반올림 double n = 1.23456; System.out.println(Math.round(n)); // result : 1 double n = 1.23456; System.out.println(Math.round(n * 10)/10); // result : 1.2 double n = 1.23456; System.out.println(Math.round(n * 100)/100); // result : 1.23 double n = 1.23456; System.out.println(Math.round(n * 10000)/10000); // result : 1.2346 2020. 9. 8.
[JAVA] list 내 원소 내림차순 정렬 public static class Descending implements Comparator { @Override public int compare(Float o1, Float o2) { return o2.compareTo(o1); } } Descending descending = new Descending(); Collections.sort(_arr, descending); ArrayList인 _arr의 원소들을 Log로 찍어보면 내림차순으로 정렬되어 있음.! 2020. 9. 7.