Android Appendix

 

Apéndice 1: Sync Web (HTML) SDK

Since 2.3 version you can get the UDID from your WebApp activity to sync with the native app users tracked. What the SDK does is to set the UDID the Android SDK has generated as a cookie for all requests the WebView launches. 

You have to add this method: 

public static void syncWithSdkWeb(Context context, String url);

And this an example of how to integrate it:

WebView webView = (WebView) findViewById(R.id.webView);
        webView.getSettings().setJavaScriptEnabled(true);

        String url = "http://www.myurl.com";
        eMMa.syncWithSdkWeb(this, url);

        webView.setWebViewClient(new MyWebViewClient());
        webView.setWebChromeClient(new WebChromeClient());
        webView.loadUrl(url);

 

Appendix 2: Header

///---------------------------------------------------------------------
/// Init eMMa
///---------------------------------------------------------------------
public static void starteMMaSession(Context c, String appKey);

 

///———————————————————————
/// eMMa Configuration
///———————————————————————
public static String getSDKVersion(); //Get current SDK version
public static void setDebuggerOutput(boolean visible); //Show or hide debugger outputs

 

///———————————————————————

/// eMMa User behaviour

///———————————————————————

 

//Track event
public static void trackEvent(Context c, String event);

 

///———————————————————————
/// eMMa User Stats
///———————————————————————

 

//Login
public static void loginUserID(Context c, String userId, String mail,
Map<String,String> extras);
public static void loginUserID(Context c, String userId, String mail)
public static void loginDefault(Context c);
//Register. Lead generation
public static void registerUserID(Context c, String userId, String mail, Map<String,String> extras);
public static void registerUserID(Context c, String userId, String mail);
//Custom segmentation
public static void trackExtraUserInfo(Context c, Map<String,String> info);

 

///———————————————————————
/// eMMa m-Commerce
///———————————————————————

 

//Start an order
public static void startOrder(Context c, String orderId, String customerId,
float totalPrice, String coupon, Map<String,String> extras);
public static void startOrder(Context c, String orderId, String customerId,
float totalPrice, String coupon);
public static void startOrder(Context c, String orderId, String customerId,
float totalPrice, Map<String,String> extras);
public static void startOrder(Context c, String orderId, String customerId,
float totalPrice);
public static void startOrder(Context c, String orderId, float totalPrice);
public static void startOrder(Context c, String orderId, float totalPrice, String coupon, Map<String,String> extras);
public static void startOrder(Context c, String orderId, float totalPrice,
String coupon);
public static void startOrder(Context c, String orderId, float totalPrice, Map<String,String> extras);
//Add products to an existent order
public static void addProduct(String productId, String name, float qty, float price, Map<String,String> extras);
public static void addProduct(String productId, String name, float qty, float price);

 

//Track order
public static void trackOrder(Context c);

 

//Cancel order by id
public static void cancelOrder(Context c, String orderId);

 

///———————————————————————
/// eMMa Promo Web View
///———————————————————————

 

public static void checkForWebview(Context c);
public static void checkForWebview(Context c, Button button);
public static void checkForWebview(Context c, String label);
public static void checkForWebview(Context c, Map<String, String> params);
public static void checkForWebview(Context c, Button button, String label);
public static void checkForWebview(Context c, Button button, Map<String,String> params);
public static void checkForWebview(Context c, String label, Map<String,String> params);

 

///———————————————————————
/// eMMa Tab Host View
///———————————————————————

 

public static void checkForPromoOnTabHost(Context c, TabHost mTabHost);
public static void checkForPromoOnTabHost(Context c, TabHost mTabHost, TabSpec mTabSpec);
public static void checkForPromoOnTabHost(Context c, TabHost mTabHost, Map<String,String> params);
public static void checkForPromoOnTabHost(Context c, TabHost mTabHost, TabSpec mTabSpec, Map<String,String> params);

 

///———————————————————————
/// eMMa Notifications
///———————————————————————

 

public static void startPushSystem(Context c);
public static void startPushSystem(Context c, int icon);

 

///—————————————————————————————
/// @name eMMa AdBall
///—————————————————————————————

 

public static void checkForAdBall(Context c);

public static void checkForAdBall(Context c, String label);

public static void checkForAdBall(Context c, Map<String,String> params);

public static void checkForAdBall(Context c, String label, Map<String,String> params);

public static void checkForAdBall(Context c, String label, Map<String,String> params, eMMaWebViewInterface ewi);

public static boolean closeAdBall();

 

///—————————————————————————————
/// @name eMMa Banner
///—————————————————————————————

 

public static void checkForBanner(Context c);

public static void checkForBanner(Context c, Button button);

public static void checkForBanner(Context c, String label);

public static void checkForBanner(Context c, Map<String,String> params);

public static void checkForBanner(Context c, Button button, String label);

public static void checkForBanner(Context c, Button button, String label, int topMarginY, int bottomMarginY);

public static void checkForBanner(Context c, Button button, Map<String,String> params);

public static void checkForBanner(Context c, String label, Map<String,String> params);

public static void checkForBanner(Context c, Button button, String label, Map<String,String> params);

public static void checkForBanner(Context c, Button closeButton, String label, Map<String,String> params, eMMaWebViewInterface ewi, int topMarginY, int bottomMarginY);

public static boolean closeBanner();

Have more questions? Submit a request

0 Comments

Article is closed for comments.