Android Open Source - android-sdk Doorbell Api






From Project

Back to project page android-sdk.

License

The source code is released under:

MIT License

If you think the Android project android-sdk listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package io.doorbell.android;
//ww w .  ja  v a 2s .com
import io.doorbell.android.manavo.rest.RestApi;
import io.doorbell.android.manavo.rest.RestCache;

import org.json.JSONObject;

import android.app.Activity;


public class DoorbellApi extends RestApi {
  
  private String mApiKey;
  private long mAppId;
  
  public DoorbellApi(Activity activity) {
    super(activity);
    
    this.BASE_URL = "https://doorbell.io/api/";
    this.rest.setHost("doorbell.io");
    this.setUserAgent("Doorbell Android SDK");
    
    this.acceptAllSslCertificates();
  }
  
  public void setAppId(long id) {
    this.mAppId = id;
  }
  
  public void setApiKey(String key) {
    this.mApiKey = key;
  }
  
  public void reset() {
    super.reset();
    
    this.cachePolicy = RestCache.CachePolicy.NETWORK_ONLY;
  }
  
  public void impression() {
    this.setLoadingMessage(null);
    this.post("applications/"+this.mAppId+"/impression?key="+this.mApiKey);
  }
  
  public void open() {
    this.setLoadingMessage(null);
    this.post("applications/"+this.mAppId+"/open?key="+this.mApiKey);
  }
  
  public void sendFeedback(String message, String email, JSONObject properties, String name) {
    this.addParameter("message", message);
    this.addParameter("email", email);
    
    this.addParameter("properties", properties.toString());
    
    this.addParameter("name", name);
    
    this.post("applications/"+this.mAppId+"/submit?key="+this.mApiKey);
  }
  
}




Java Source Code List

io.doorbell.android.DoorbellApi.java
io.doorbell.android.Doorbell.java
io.doorbell.android.callbacks.OnShowCallback.java
io.doorbell.android.manavo.rest.RestApi.java
io.doorbell.android.manavo.rest.RestCache.java
io.doorbell.android.manavo.rest.RestCallback.java
io.doorbell.android.manavo.rest.RestErrorCallback.java
io.doorbell.android.manavo.rest.RestRequest.java