This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.dipoletech.unnmobile; | |
import android.app.Activity; | |
import android.content.ComponentName; | |
import android.content.Context; | |
import android.content.DialogInterface; | |
import android.content.Intent; | |
import android.content.pm.ResolveInfo; | |
import android.database.Cursor; | |
import android.graphics.Color; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
For step-by-step instructions on connecting your Android application to this backend module, | |
see "App Engine Backend with Google Cloud Messaging" template documentation at | |
https://github.com/GoogleCloudPlatform/gradle-appengine-templates/tree/master/GcmEndpoints | |
*/ | |
package com.dotdex.squattn; | |
import com.dotdex.squattn.models.RegistrationRecord; | |
import com.dotdex.squattn.util.Utility; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<LinearLayout | |
xmlns:android="http://schemas.android.com/apk/res/android" | |
android:layout_width="match_parent" | |
android:layout_height="wrap_content" | |
android:orientation="vertical"> | |
<RelativeLayout | |
android:layout_width="match_parent" | |
android:layout_height="wrap_content"> | |
<LinearLayout |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"Key2" : "Value2", | |
"key1" : 12, | |
"key3" : 12.09, | |
"key4" : 198376475886432 | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class FirebaseQuery { | |
//Build a key value Pair | |
public Map<String, Object> getKeyValuePair(){ | |
Object obj = new Object(); | |
Map<String, Object> keyValuePair = new HashMap<>(); | |
keyValuePair.put("key1","This is a string value"); //a string value | |
keyValuePair.put("key2",12); //an integer value |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"members" : { | |
"kZDqscQARJVmdYMad9ndJ7X5kmo2" : 100, | |
"kZDqscQARJVmdYMad9ndJ7X5kmo3" : 200, | |
"kZDqscQARJVmdYMad9ndJ7X5kmo4" : 200, | |
"kZDqscQARJVmdYMad9ndJ7X5kmo4" : 100 | |
}, | |
"schoolId" : "-KWJUc2ylvhO02VfVImh", | |
"schoolName" : "University of Nigeria Nsukka ", | |
"setAdmin" : "kZDqscQARJVmdYMad9ndJ7X5kmo2", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class QuerySetByMembers{ | |
public void querySet(String memberId) | |
{ | |
Query queryByMember = FirebaseDatabase.getInstance().getReference().child("sets").orderByChild("members/"+memberId); | |
queryByMember.addValueEventListener(new ValueEventListener() { | |
@Override | |
public void onDataChange(DataSnapshot dataSnapshot) { | |
//Not that we are returning a list as our query is on sets | |
//so iterate through the datasnapshot and get the values | |
for (DataSnapshot data : dataSnapshot.getChildren()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void querySet(String memberId) | |
{ | |
Query queryByMember = FirebaseDatabase.getInstance().getReference().child("sets").orderByChild("members/"+memberId).endAt(200); | |
queryByMember.addValueEventListener(new ValueEventListener() { | |
@Override | |
public void onDataChange(DataSnapshot dataSnapshot) { | |
//Not that we are returning a list as our query is on sets | |
//so iterate through the datasnapshot and get the values | |
for (DataSnapshot data : dataSnapshot.getChildren()) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void querySet(String memberId) | |
{ | |
Query queryByMember = FirebaseDatabase.getInstance().getReference().child("sets").orderByChild("members/"+memberId).startAt(300); | |
queryByMember.addValueEventListener(new ValueEventListener() { | |
@Override | |
public void onDataChange(DataSnapshot dataSnapshot) { | |
//Not that we are returning a list as our query is on sets | |
//so iterate through the datasnapshot and get the values | |
for (DataSnapshot data : dataSnapshot.getChildren()) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"-KXAlZM_-wGb6VtDWaXi" : { | |
"members" : { | |
"93O9tc5SebdZEOtei8tiTN8JQRt2" : 100, | |
"KUwDuuo9zqR0EfAQD5DdGMI3MnS2" : 200, | |
"L9qJXkjvsfRLip5Awg0yhJLcmJb2" : 500 | |
}, | |
"schId" : "-KXAlZMY1cwVaekwtqm2", | |
"schName" : "University of Nigeria Nsukka", | |
"setAdmin" : "KUwDuuo9zqR0EfAQD5DdGMI3MnS2", |
OlderNewer