Java 7

[Android-java] Unable to start activity ComponentInfo{com.example.health/com.example.starBooks.MainActivity}: android.view.InflateException: Binary XML file line #70: ScrollView can host only one direct child 에러 해결

안녕하세요 개발 중에 만난 에러를 적어보려고 합니다. 에러 내용 : Unable to start activity ComponentInfo{com.example.health/com.example.starBooks.MainActivity}: android.view.InflateException: Binary XML file line #72: ScrollView can host only one direct child ScrollView에는 하나의 레이아웃만 존재해야하는데 아래 코드와 같이 1개 이상이 있을 경우 해당 에러가 발생합니다. 해결방법 아래 코드와 같이 하나의 레이아웃으로 묶어주시면 됩니다.

Android 2021.09.25

[Android-java] ScrollView 사용법 및 에러 해결

개발환경 : Windows 사용 라이브러리 : DataBinding (데이터 결합 라이브러리) 안녕하세요 개발 중에 ScrollView가 먹통이라서 삽질을 했네요 ㅠㅠ 삽질 끝에 먹통을 해결했습니다 !! 어이없는 실수였지만 다른 분들도 혹시 이런 상황이 생길 수도 있으니 참고용으로 올렸습니다!! ScrollView란? 데이터가 많아져 UI가 꽉 찼을 때 위아래로 이동할 수 있는 뷰입니다. 데이터가 많아 아래까지 내려가있는 상황인데 이런 경우 ScrollView를 사용하시면 됩니다. ScrollView 안에는 한 개의 레이아웃만 사용할 수 있으니 레이아웃안에 레이아웃을 생성해주셔야 합니다. 저는 툴바 아래에 사용하기 위해 match_parent와 wrap_parent 대신 0dp를 사용해 크기를 맞춰주었습..

Android 2021.08.26

[Android-java] 서버 통신 시 SocketTimeoutException 에러

사용 라이브러리 : Retrofit2 안녕하세요 서버 통신 테스트 중에 SocketTimeoutException 에러가 발생했습니다. HTTP FAILED: java.net.SocketTimeoutException: failed to connect to /13.209.146.xxx (port 80) from /192.168.xxx.2 (port 38864) after 10000ms 원인은 서버가 올라가있지 않거나 통신 제한시간이 짧아서 오류가 난다고 합니다. 해결 방법 통신 제한시간이 짧은 경우 타임아웃 시간을 설정해주시면 됩니다! OkHttpClient client = new OkHttpClient.Builder() .addInterceptor(interceptor) .connectTimeout(100..

Android 2021.08.25

[Eclipse - Spring] web.xml에서 "There are '37' errors in 'jsp_2_1.xsd'.", "cvc-id.3: A field of identity constraint 'web-app-servlet-name-uniqueness' matched element 'web-app', but this element does not have a simple type." 에러 해결

안녕하세요 개발 설정을 하기 위해 Eclipse를 다루면서 발생한 에러를 해결하였습니다. 처음 프로젝트를 생성하면 다음과 같은 에러가 나타났습니다. line 2 : There are '37' errors in 'jsp_2_1.xsd' line 19 : cvc-id.3: A field of identity constraint 'web-app-servlet-name-uniqueness' matched element 'web-app', but this element does not have a simple type. 해결 방법은 간단합니다. xsi : schemaLocation에서 url 사이 세미콜론( ; )을 추가 해주면 바로 해결 가능합니다 :)

Web 2021.03.29

[Android-Java] TabLayout 배경색 다르게 설정하기

Android에서 TabLayout에서 탭했을 때 배경색을 변경하는 코드는 따로 없기 때문에 drawable을 만들어주어야 합니다. 1. 기본 배경색 drawable > tab_background_unselected.xml 2. 선택된 탭 배경색 drawable > tab_background_selected.xml 3. 최종 배경색 설정 drawable > tab_background.xml 4. TabLayout에 배경색으로 설정 app:tabBackground="@drawable/tab_background" 결과화면

Android 2021.03.18

[Android-java] Retrofit2 적용하기 / 로그인 구현

개발툴 : Android Studio (안드로이드 개발툴) / Postman (서버 데이터를 보기 위한 툴) Volley 라이브러리를 사용하다가 Retrofit2로 변경하였습니다. AndroidManifest.xml Build.gradle(:app) dependensies { //로그를 남기기 위한 라이브러리 implementation 'com.squareup.okhttp3:logging-interceptor:3.11.0' //retrofit 통신을 위한 라이브러리 implementation 'com.squareup.retrofit2:converter-gson:2.6.2' implementation 'com.squareup.retrofit2:retrofit:2.6.2' implementation 'com..

Android 2021.03.12