How to send notifications to all users using REST API in OneSignal?

I have made an app in android which uses onesignal. Now I am building an another app which i will use as admin app for me. The problem here is that in the admin app I am performing a particular function on button click and at the same time I want to send notification to all the users who are using my app to inform them that some data has changed. But the problem is that I don't know properly how to use it. So, I read the onesignal documentation and copied the sample java code under the onClickListener method of the button in my admin app and changed the REST API key and the app id. But nothing happened. I am really confused what to do right here. Please if anyone of you know the answer please help me. Here is my code -

Button submit = (Button) findViewById(;
submit.setOnClickListener(new View.OnClickListener() {
        public void onClick(View view) {

public void notify(){

try {
   String jsonResponse;

   URL url = new URL("");
   HttpURLConnection con = (HttpURLConnection)url.openConnection();

   con.setRequestProperty("Content-Type", "application/json; charset=UTF-8");
   con.setRequestProperty("Authorization", "Basic NGEwMGZmMjItY2NkNy0xMWUzLTk5ZDUtMDAwYzI5NDBlNjJj");

   String strJsonBody = "{"
                      +   "\"app_id\": \"5eb5a37e-b458-11e3-ac11-000c2940e62c\","
                      +   "\"included_segments\": [\"All\"],"
                      +   "\"data\": {\"foo\": \"bar\"},"
                      +   "\"contents\": {\"en\": \"English Message\"}"
                      + "}";

   System.out.println("strJsonBody:\n" + strJsonBody);

   byte[] sendBytes = strJsonBody.getBytes("UTF-8");

   OutputStream outputStream = con.getOutputStream();

   int httpResponse = con.getResponseCode();
   System.out.println("httpResponse: " + httpResponse);

   if (  httpResponse >= HttpURLConnection.HTTP_OK
      && httpResponse < HttpURLConnection.HTTP_BAD_REQUEST) {
      Scanner scanner = new Scanner(con.getInputStream(), "UTF-8");
      jsonResponse = scanner.useDelimiter("\\A").hasNext() ? : "";
   else {
      Scanner scanner = new Scanner(con.getErrorStream(), "UTF-8");
      jsonResponse = scanner.useDelimiter("\\A").hasNext() ? : "";
   System.out.println("jsonResponse:\n" + jsonResponse);

} catch(Throwable t) {