Más contenido relacionado
自宅の冷蔵庫の温度湿度を晒してみた
- 20. FirebaseのDBの処理はこれだけ。
Firebase myFirebaseRef = new Firebase(“https://hoge.firebaseio.com/”);
Map<String, Object> post = new HashMap<String, Object>();
post.put(“temperature”, おんど);
post.put(“humidity”, しつど);
post.put(“timestamp”, タイムスタンプ);
myFirebaseRef.child(”fuga").push().setValue(post);
setValueするだけでローカルのDBに保存して、
通信が繋がっている時に自動的に同期してくれる!
アプリの書き込み側
- 21. Firebase DBの処理はこれだけ。(範囲指定の場合)
var firebaseRef = new Firebase("https://hoge.firebaseio.com");
var messagesRef = firebaseRef.child(’fuga');
messagesRef.orderByChild("timestamp")
.startAt(from.getTime())
.endAt(after.getTime())
.on("child_added", function(snapshot){
var msg = snapshot.val();
//以下グラフ更新処理
});
Webの読み出し側
Notas del editor
- 加速度を取りたかったけどうまくいかず。
- ブルワーカー