Code example for BasicNameValuePair

0
        if (aid != null) {
            params.add(new BasicNameValuePair("aid", aid));
        } 
 
        // TODO: Allow device name to be configured 
        params.add(new BasicNameValuePair("device_type", isTablet(context) ? "Tablet" : "Phone"));
 
        return WebserviceTask.makeRequest(urlPath, params);
    } 
 
    static boolean isTablet (Context context) {
        // TODO: This hacky stuff goes away when we allow users to target devices 
        int xlargeBit = 4; // Configuration.SCREENLAYOUT_SIZE_XLARGE;  // upgrade to HC SDK to get this
        Configuration config = context.getResources().getConfiguration();
        return (config.screenLayout & xlargeBit) == xlargeBit;
    } 
}