본문 바로가기

firebase

(7)
[안드로이드][프로젝트2]Firebase orderByChild descending 하는 법 (부제: recyclerView setReverseLayout(true)) 내가 본래 원했던 것은 firebase orderByChild를 통하여 recyclerView를 내림차순으로 정렬하는 거였다. 먼저 내가 시도했을 때 소용 없었던 방법을 소개하겠다. 1. 공식문서에 있는 내용 citiesRef.orderBy("name", Direction.DESCENDING); 이 방법은 공식문서에서 나온 내용이나 실제로 위와 같이 코드를 입력하면 작동이 안 된다. Direction에서 문제가 생겨 통하지 않는다. 출처: https://firebase.google.com/docs/firestore/query-data/order-limit-data#java_2 Cloud Firestore로 데이터 정렬 및 제한 | Firebase Documentation Join Firebase at G..
[안드로이드][프로젝트1] 내가 MPAndroid X axis 값을 날짜와 시간으로 변환한 방법(firebase 연동) 1. DataPoint 클래스의 xValue를 long값으로 바꿔준다. public class DataPoint { long xValue; int yValue; public DataPoint(long xValue, int yValue) { this.xValue = xValue; this.yValue = yValue; } public DataPoint(){ } public long getxValue() { return xValue; } public int getyValue() { return yValue; } } 참고:https://youtu.be/WcwhZztfY2g 2. SimpleDateFormat 지정해주자. SimpleDateFormat sdf = new SimpleDateFormat("MM-dd..
[프로젝트1][안드로이드] 내가 Firebase와 연동한 상태로 MPAndroidchart 를 이용하여 Line Chart를 만든 법 0. gradle 환경 설정은 필수. 1.RegisterActivity와 MainActivity(로그인 액티비티)에 다음 문구를 추가한다. hashMap.put("ChartValues",""); // will add later 2. fragment_calendar.xml 레이아웃을 다음과 같이 짜준다. 3. DataPoint 클래스를 만들어준다. public class DataPoint { int xValue, yValue; public DataPoint(int xValue, int yValue) { this.xValue = xValue; this.yValue = yValue; } public DataPoint(){ } public int getxValue() { return xValue; } publi..
[오류일지][프로젝트1]18. 유저 리스트가 안 나왔던 이유 위의 사진은 정상적으로 작동했을 때의 Users 리스트 모습니다. 그런데 이걸 해결하기 전에 유저리스트가 뜨질 않았다. 왜 그런 걸까 살펴보던 중, firebase realtimebase에서 제대로 저장이 안 된 계정(데이터)를 발견했다. 알고보니 데이터가 저장이 제대로 안 된 것이 영향이 있었던 것이다. 그 계정을 삭제하니 위와같이 잘 작동하게 되었다.
[프로젝트1] 내가 로그인Activity를 구현한 방법 전체 코드 더보기 package com.example.grapegraph; import androidx.annotation.NonNull; import androidx.appcompat.app.AppCompatActivity; import android.app.ProgressDialog; import android.content.Intent; import android.os.Bundle; import android.view.View; import android.view.WindowManager; import android.widget.Button; import android.widget.EditText; import android.widget.ImageView; import android.widget.T..
[프로젝트1] android firebase sign out 기능 구현 사용자를 로그아웃 시키려면 signOut()을 호출하면 된다. FirebaseAuth.getInstance().signOut(); 참고: https://firebase.google.com/docs/auth/android/custom-auth?hl=ko Android에서 커스텀 인증 시스템을 사용하여 Firebase에 인증 | Firebase Documentation Join Firebase at Google I/O 2022 live from Shoreline Amphitheatre and online May 11-12. Register now 의견 보내기 Android에서 커스텀 인증 시스템을 사용하여 Firebase에 인증 사용자가 정상적으로 로그인할 때 커스텀 서명 firebase.google.com..
[오류일지]17. firebase stroge 쓸 땐 변수를 생성해야지! 어제 프로필 이미지 업로드, 업데이트 기능을 구현하는데 자꾸 오류가 떠서 애먹었다. 오류가 뜨는 이유를 찾아보니 내가 바로 가장 중요한 변수 선언을 안 했던 것이다! //storage FirebaseStorage storage; StorageReference storageReference; storage = FirebaseStorage.getInstance(); storageReference = storage.getReference(); 잘하자 로빈아 ^^