code: public void addEvent(KeenProject project, String eventCollection, Map<String, Object> event,
                           Map<String, Object> keenProperties, KeenCallback callback) {
  
          if (!isActive) {
              handleLibraryInactive(callback);
              return;
          }
  
          if (project == null && defaultProject == null) {
              handleFailure(null,
                            project,
                            eventCollection,
                            event,
                            keenProperties,
                            new IllegalStateException("No project specified, but no default project found"));
              return;
          }
          KeenProject useProject = (project == null ? defaultProject : project);
  
          try {
              // Build the event.
              Map<String, Object> newEvent =
                      validateAndBuildEvent(useProject, eventCollection, event, keenProperties);
  
              // Publish the event.
              publish(useProject, eventCollection, newEvent);
              handleSuccess(callback, project, eventCollection, event, keenProperties);
          } catch (Exception e) {
              handleFailure(callback, project, eventCollection, event, keenProperties, e);
          }
      }
docs: Synchronously adds an event to the specified collection. This method will immediately
  publish the event to the Keen server in the current thread.
  
  @param project         The project in which to publish the event. If a default project has been set
  on the client, this parameter may be null, in which case the default project
  will be used.
  @param eventCollection The name of the collection in which to publish the event.
  @param event           A Map that consists of key/value pairs. Keen naming conventions apply (see
  docs). Nested Maps and lists are acceptable (and encouraged!).
  @param keenProperties  A Map that consists of key/value pairs to override default properties.
  ex: "timestamp" -&gt; Calendar.getInstance()
  @param callback        An optional callback to receive notification of success or failure.