title: How to invoke lambda function in android?
body: <p>So i made this lambda function, and in that function I made an if statement, which creates me a user in a user table in dynamoDB. How do i call that ONLY call that if statement in my lambda function from android?</p>
  
  <p>Here is my lambda function </p>
  
  <pre><code>exports.handler = function(event, context) 
  {
      console.log('stageA');
      console.log(JSON.stringify(event, null, '  '));
      var responseCode = 200;
      var userTableName = "usersTable";
      var requestBody = event.body;
      var pathParams = event.path;
      var httpMethod = event.httpMethod;  // HTTP Method (e.g., POST, GET, HEAD)
      //User parameters
      var displayName;
      var email;
      var fbUserID;
      var firstName;
      var folders;
      var lastName;
      var origin;
      var profileImageRef;
      var level;
      var username;
      var birthdate;
      var experience;
      var folder;
  
  
      if (pathParams == "/user/createByEmail" &amp;&amp; httpMethod == "POST") 
      {
          console.log('create by email action');
          requestBody = JSON.parse(requestBody);
           //Set variables
          firstName = requestBody.firstName;
          lastName = requestBody.lastName;
          email = requestBody.email;
          username = requestBody.username;
          experience = "0";
          birthdate = requestBody.birthdate;
  
          dynamodb.putItem(
              {
                  "TableName": userTableName,
                  "Item" : 
                  {
                      "displayName":{"S": username},
                      "email":{"S": email},
                      "firstName" : {"S" : firstName},
                      "folderNames" : {"M" : { 
                          "My Cards": {"N": "0" } 
                                      } },
                      //"folders" : {"M" : {"My Cards": {}}},
                      "lastName" : {"S" : lastName},
                      "experience" : {"N" : experience},
                      "username": {"S": username},
                      "birthdate": {"S": birthdate}
                  }
              }, 
              function(err, data) 
              { if (err) {
                      console.log(err);
                      context.done(err);
                  } else {
                      var response = 
                      {
                          statusCode: responseCode,
                          headers: 
                          {
                              "x-custom-header" : "custom header value"
                          },
                          body: JSON.stringify(username)
                      };
                      console.log('great success: %j',data);
                      context.succeed(response);
                  }
              });
      }
  </code></pre>
  
  <p>And in android, i made an interface which will be called in an AsyncTask to call my lambda function:</p>
  
  <pre><code>  public interface MyInterface {
  
          /**
           * Invoke lambda function "echo". The function name is the method name
           */
          @LambdaFunction
          String user(String userEmail);
  
          /**
           * Invoke lambda function "echo". The functionName in the annotation
           * overrides the default which is the method name
           */
          @LambdaFunction(functionName = "myUserAPiFxnName")
          void noUser(NameInfo nameInfo);
      }
  </code></pre>
  
  <p>I am new to AWS and lambda, and really hope for your guide. I am not sure if i am doing this write, and hope someone has a clear cut way with steps!</p>
  
  <p>Cheers!</p>