반응형

- Android 16

[Android] 새로고침 구현 - swipe refresh

swipe refresh 데이터를 받아오는 작업을 하거나, 새로고침이 필요한 경우 해당 라이브러리를 사용하여 간단한게 구현할 수 있습니다. build.gradle // swipe refresh implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.1.0" xml // 내용 새로고침을 구현할 부분을 SwipeRefreshLayout으로 감싸 줍니다. Activity SwipeRefreshLayout swipeRefreshLayout; ... // 새로고침 swipeRefreshLayout = findViewById(R.id.swiperefreshlayout); swipeRefreshLayout.setOnRefreshListener(new Swi..

- Android 2023.01.29

[Android] lottie 라이브러리를 사용하여 애니메이션 구현

lottie lottie 애니메이션은 카테고리 옆 이미지, 로딩 다이얼로그 등 화면을 보다 동적으로 보여주기에 목적에 따라 다양하게 활용 될 수 있습니다. build.gradle // lottie implementation 'com.airbnb.android:lottie:5.0.2' raw 파일 생성 res 우클릭 - New - Android Resource Directory lottie 홈페이지 https://lottiefiles.com/ LottieFiles: Download Free lightweight animations for website & apps. Effortlessly bring the smallest, free, ready-to-use motion graphics for the web..

- Android 2023.01.29

[Android] Retrofit2 라이브러리를 사용하여 서버와 통신하기

Retrofit2 라이브러리를 사용하여 서버와 데이터를 주고 받는 작업을 진행하겠습니다. Retrofit2 Retrofit2 은 서버와의 RestAPI 통신을 가능하게 도와주는 라이브러리 입니다. retrofit 외에 통신을 가능하게 하는 라이브러리가 있지만, 속도 뿐만 아니라 많은 장점을 보유하고 있기에 Retrofit을 많이 선호 한다고 합니다. build.gradle // retrofit2 implementation 'com.squareup.retrofit2:retrofit:2.9.0' // Gson 변환기 implementation 'com.squareup.retrofit2:converter-gson:2.9.0' retrofit, gson 라이브러리를 추가해 줍니다. ApiClient.java 클..

- Android 2023.01.29

[Android] JSoup 네이버 날씨 크롤링

크롤링(crawling) - 크롤링은 웹페이지의 내용을 그대로 가져와 데이터를 추출하는 행위 입니다. 위 사진은 현재 서울기준 네이버 날씨이며, 포커싱 된 부분의 글자를 추출하여 기기 화면으로 가져오는 코드를 Jsoup 라이브러리를 통하여 작성해보겠습니다. build.gradle // jsoup implementation 'org.jsoup:jsoup:1.13.1' xml MainActivity // 날씨 크롤링 TextView tv_temper; String tem; private String URL = "https://m.search.naver.com/search.naver?sm=mtp_sly.hst&where=m&query=%EC%84%9C%EC%9A%B8+%EB%82%A0%EC%94%A8&acr=..

- Android 2023.01.29