Android
-
Android Library(Android Archive) aar의 리소스 변경하기Android 2020. 6. 18. 13:57
Modifying contents of Android .aar file / Converting to and from .zip format 안드로이드 라이브러리 파일의 리소스를 내가 원하는 것으로 변경하고 싶을 때 리눅스 환경에서 unzip으로 압축을 풀고 tempFolder로 들어가서 변경할 resource를 수정한다. unzip library.aar -d tempFolder 다시 패키징하기 위해 압축을 풀었던 디렉토리로 이동한다. cd tempFolder 상위 디렉토리에 NewLibrary.aar이란 이름으로 zip 압축을 다시 한다. zip -r ../NewLibrary.aar * 다시 import 후 사용한다.
-
Invoke-customs are only supported starting with Android OAndroid 2020. 6. 17. 14:21
app/build.gradle에 아래 옵션을 추가 Java 8을 쓴다면 android { compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } } Java 10을 쓴다면 android { compileOptions { sourceCompatibility JavaVersion.VERSION_1_10 targetCompatibility JavaVersion.VERSION_1_10 } } Java 7을 쓴다면 android { compileOptions { sourceCompatibility JavaVersion.VERSION_1_7 targetCompatibility Ja..
-
Testable API provide site for client devopmentAndroid 2020. 6. 16. 17:55
https://randomuser.me/ Random User Generator | Home Copyright Notice All randomly generated photos were hand picked from the authorized section of UI Faces. Please visit UI Faces FAQ for more information regarding how you can use these faces. randomuser.me Testable API provide site for client devopment ex) https://api.randomuser.me/?results=10 Result
-
[Android] postDelayed()를 이용해서 주기적 메소드 실행Android 2020. 6. 16. 17:23
final Handler handler = new Handler(); handler.postDelayed(new Runnable() { @Override public void run() { //Do something after 100ms Toast.makeText(c, "check", Toast.LENGTH_SHORT).show(); handler.postDelayed(this, 2000); } }, 1500); Keep life-cycle in mind Handler handler = new Handler(); @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); handler.p..
-
[Android] CountDownTime 주기적 실행 타이머Android 2020. 6. 16. 17:01
CountDownTimer countDownTimer = new CountDownTimer(10 * 1000, 1000) { public void onTick(long millisUntilFinished) { //반복 실행 구문 } public void onFinish() { //마지막 실행 구문 } }; countDownTimer.start(); //타이머 실행 countDownTimer.cancel(); //타이머 종료 CountDownTimer 의 객체를 생성할때 매개변수 2개 = 총 실행될 시간, 반복주기시간 단위는 모두 ms 단위이므로 위 구문에서는 '10초(10*1000 ms) 동안 1초(1000 ms)마다 실행하겠다' 라는 뜻 CountDownTimer 의 객체를 생성하면 자동으로 onTic..
-
After migrating to AndroidX, Error inflating class android.support.design.widget.AppBarLayoutAndroid 2020. 6. 14. 02:13
AppBarLayout add below 'material:1:1:0' in build.gradle (Module: app) implementation 'com.google.android.material:material:1.1.0' in layout.xml AppBarLayout -> com.google.android.material.appbar.AppBarLayout coordinatorlayout implementation 'androidx.coordinatorlayout:coordinatorlayout:1.1.0' constraint:constraint implementation 'com.android.support.constraint:constraint-layout:1.1.3'