code: public static String[] getNames(JSONObject jo) {
          if (jo.isEmpty()) {
              return null;
          }
          return jo.keySet().toArray(new String[jo.length()]);
      }
docs: Get an array of field names from a JSONObject.
  
  @param jo
  JSON object
  @return An array of field names, or null if there are no names.