0

I have a problem to filter time in the firebase database, I wanted to write a program which always filter data from ten minutes ago to now in the firebase using Android Java but i didn t do it. I tried to write with startat() but as i said it didn t work.

`Query query=database.getReference("handler").child("button").orderByChild("time").startAt(start).endAt(finish);query.addValueEventListener(new ValueEventListener() {
            @Override
            public void onDataChange(@NonNull DataSnapshot dataSnapshot) {

for(DataSnapshot ds:dataSnapshot.getChildren()){HashMap hashmap = (HashMap) ds.getValue();list.add(hashmap.get("realtime")); textView.setText(list.size());}}} `

israfilll
  • 11
  • 3
  • What exactly didn't work? Show us what you have tried so far. – Alex Mamo Oct 17 '19 at 16:00
  • @israfilll please add some of your code to your question – Erdinc Ay Oct 17 '19 at 16:10
  • actually i am trying to get data from database which is in the last 10 minutes when i send data to firebase database but it must be continous – israfilll Oct 17 '19 at 16:12
  • @israfilll, as for me, I am not aware what the issue is, you have to show us some more code on Android side and some more information how you are trying to access it, meanwhile have a look at: https://stackoverflow.com/questions/2493331/what-are-the-best-practices-for-sqlite-on-android – Erdinc Ay Oct 18 '19 at 07:18

0 Answers0