title: Receiving data from calling Firebase Cloud Function in Android
body: <p>I'm trying to calling a firebase cloud function that I have written.</p>
  
  <p>I have tested the function using Postman to mimic HTTP requests. Here is the JSON result when I call my function within Postman:</p>
  
  <pre><code>{
   "groups": [
      {
          "isPublic": true,
          "members": [
              true
          ],
          "numberOfMembers": 1,
          "groupId": "-LAOPAzMGzOd9qULPxue"
      },
      {
          "isPublic": true,
          "members": [
              true
          ],
          "numberOfMembers": 1,
          "groupId": "-LAOP7ISDI2JPzAgTYGi"
      }
   ]
  }
  </code></pre>
  
  <p>I am attempting to do the same and retrieve this JSON list within my android app. I am following the example on Firebase's website :<a href="https://firebase.google.com/docs/functions/callable" rel="noreferrer">https://firebase.google.com/docs/functions/callable</a></p>
  
  <p>This is Firebase's example on how to retrieve the data:</p>
  
  <pre><code>return mFunctions
          .getHttpsCallable("addMessage")
          .call(data)
          .continueWith(new Continuation&lt;HttpsCallableResult, String&gt;() {
              @Override
              public String then(@NonNull Task&lt;HttpsCallableResult&gt; task) throws Exception {
                  String result = (String) task.getResult().getData();
                  return result;
              }
          });
  </code></pre>
  
  <p>It is unclear how I can take the result from my cloud function and use it in the rest of my Android app.</p>
  
  <p>Furthermore, this example returns a Task object which according to Firebase's documentation has now deprecated : <a href="https://firebase.google.com/docs/reference/admin/java/reference/com/google/firebase/tasks/Task" rel="noreferrer">https://firebase.google.com/docs/reference/admin/java/reference/com/google/firebase/tasks/Task</a>)</p>
  
  <p>Is there a clearer, more simple way to handle the data from a function call?</p>
  
  <p>Calling a function is extremely simple so I feel that there must be a more straight forward method to receiving the response.</p>