@UsesLibraries(libraries = "superRewards.jar")
public class superRewards extends AndroidNonvisibleComponent implements Component {
public static final int VERSION = 1;
public static final String USER_ID = "9001234";
public static final String APP_HASH = "nhhpuxlrfgi.022815956434";
private ComponentContainer container;
private String user_id = "";
private String app_hash = "";
public superRewards(ComponentContainer container) {
super(container.$form());
this.container = container;
userID(USER_ID);
appHash(APP_HASH);
}
// Creacion de las Propiedades.
@SimpleProperty(
category = PropertyCategory.BEHAVIOR)
public String userID() {
return user_id;
}
@SimpleProperty(
category = PropertyCategory.BEHAVIOR)
public String appHash() {
return app_hash;
}
// Establecimiento de las Propiedades.
@DesignerProperty(editorType = PropertyTypeConstants.PROPERTY_TYPE_STRING, defaultValue = superRewards.USER_ID + "")
@SimpleProperty(description = "User ID on your database. It can be either numeric or text, but must be passed as a String variable")
public void userID(String nuevouserID) {
this.user_id = nuevouserID;
}
@DesignerProperty(editorType = PropertyTypeConstants.PROPERTY_TYPE_STRING, defaultValue = superRewards.APP_HASH + "")
@SimpleProperty(description = "Your app hash, which you can find in your Dashboard.")
public void appHash(String nuevoappHash) {
this.app_hash = nuevoappHash;
}
// Funcion que une los dos textos.
@SimpleFunction(description = "Join both variables to call the Offers.")
public String superRewards(String userID, String appHash) {
SuperRewards sr = new SuperRewards(getResources(), "com.play.Getcogas");
sr.showOffers(MainActivity.this, appHash, userID);
}
}