Giter Site home page Giter Site logo

firebase's Introduction

Firebase

  • 실시간으로 단말기와 서버간의 통신이 가능
  • Nosql(JSON형식)

to Use (2017.6.30일자 기준)

  1. tools > Firebase
  2. 실시간 서버 통신 Realtime Database 선택하여 Firebase 홈페이지에 로그인 후 프로젝트 생성

스크린샷 2017-06-30 오후 9.11.39

  1. Connection your app to Firebase와 Add the RealTime Database to your app 연결 - 자동으로 Gradle에 추가 됨
  2. 코드에 추가 _ 자동으로 루트가 생성 됨(트리구조)
// 파이어베이스의 데이터베이스에 연결
FirebaseDatabase database = FirebaseDatabase.getInstance();
// 래퍼런스를 가져옴
DatabaseReference myRef = database.getReference("message");

myRef.setValue("Hello, World!");

데이터 입력시

스크린샷 2017-07-01 오전 12.06.46

  1. 코드에 추가
myRef.addValueEventListener(new ValueEventListener() {
    @Override
    public void onDataChange(DataSnapshot dataSnapshot) {
      // 데이터 변경사항이 생기면 담아줌
        String value = dataSnapshot.getValue(String.class);
        Log.d(TAG, "Value is: " + value);
    }

    @Override
    public void onCancelled(DatabaseError error) {
        Log.w(TAG, "Failed to read value.", error.toException());
    }
});

firebase's People

Contributors

daaa08 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.