Welcome to the CSC Q&A.
Get help and give help!
Write great code!
It is our choices... that show what we truly are, far more than our abilities.

Categories

+10 votes

This could be on any platform or using any technologies. Hopefully this post might give a network where people can reach out for help if they get stuck on a problem that someone has already solved.

asked in CSC490_Spring2019 by (1.7k points)

3 Answers

+5 votes

Learning about the SHA-1 code and how our project would not even build when we had an unregistered SHA-1

answered by (3.2k points)
+4 votes

Finding out that if your object hits your player, you go flying off into space. That was really interesting and not at all disorienting to discover

answered by (2k points)
+3 votes

Okay so here me out on this! If you are planning on using Firebase and you have created any custom class to store a custom type for your project please read through these two links.

I spent many hours trying to store a custom type / object into Firebase (containing many different fields like: String, int, ArrayList, etc.) and I wanted to be able to reference this stored data for some functionality of my application.

It turns out that the "DataSnapshot" type that is provided in the Firebase package has a method for getting all immediate children of the current DB reference point. So, you are able to store this into your own custom type by the following code.

=======================================================================

Declare a global list to store the data to:
ArrayList list = new ArrayList<>();
...

list = new ArrayList<>();
list.clear();
myRef.addValueEventListener(new ValueEventListener() {

        @Override
        public void onDataChange(@NonNull DataSnapshot dataSnapshot) {
            DataSnapshot d = dataSnapshot.getChildren;
            CustomType q = d.getValue(CustomType.class);
            list.add(q);
            // Now from here you are able to do any get() methods you have defined in your 
               own custom class and a way to test this until you figure out how you want to use it 
               is as follows!
           ToastToast.makeText(this, ""+list.get(0).getName(),Toast.LENGTH_SHORT).show();
           }

}

=======================================================================
https://firebase.google.com/docs/reference/android/com/google/firebase/database/DataSnapshot#getChildrenCount()

https://stackoverflow.com/questions/38652007/how-to-retrieve-specific-list-of-data-from-firebase

If you need any additional clarification on this let me know during class and I can hopefully assist you.

answered by (4.1k points)
+1

@Stonedahl ---- can you help fix the formatting of my answer...it's not letting me change much unfortunately.

...