ProfileManager

EMDK For Android 4.0

This class handles all the profile related functions.

Example Usage:



private ProfileManager profileManager = (ProfileManager) EMDKManager.getInstance(EMDKManager.FEATURE_TYPE.PROFILE);

Public Methods

isPreviousRequestPending

public boolean isPreviousRequestPending()

This method tells whether the previous process profile request is pending or not. If the previous request is pending, you can't submit the next request till the current request completes and calling the process profile method will return error.

Returns:

boolean - Returns whether the previous process profile request is pending or not.

CreateNameValuePair

public String CreateNameValuePair(java.lang.String emdkName, java.lang.String paramName, java.lang.String paramValue)

This function creates a name value pair string according to the Name-Value pair request. The return string is compatible with com.symbol.emdk.ProfileManager. processProfile(String profileName, PROFILE_FLAG profileFlag, String[] extraData) function's extraData array element. If this function failed it throws InvalidParameterException exception.

Parameters:

emdkName - emdk name String

paramName - Parameter name String

paramValue - Parameter value String

Returns:

java.lang.String - Returned in the format: emdkName.paramName=paramValue

processProfile

public EMDKResults processProfile(java.lang.String profileName, ProfileManager.PROFILE_FLAG profileFlag, org.w3c.dom.Document extraData)

Processes the given profile based on the data provided and the flag and return status of the action.

Example Usage:



DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
DocumentBuilder db = dbf.newDocumentBuilder();
Document extraData;
extraData = db.newDocument();
profileManager.processProfile("Profile1", PROFILE_FLAG.GET, extraData);

Parameters:

profileName - Name of the profile. ex: 'Profile1'.

  • You can also specify just part of the profile when a fully qualified name of the following format is given: [profileName][featureType][name in profile parameter] to just edit part of the profile. For example, if my profile is called 'Profile1' and the name in profile parameter is 'myName'. Passing 'profileName' as 'Profile1/ActivitySelection/myName' will just process this part of the profile.
  • Valid [featureType]: ActivitySelection, Barcode, MSR, Intent, Keystroke, IP.

profileFlag - ProfileManager.PROFILE_FLAG

If the profileFlag is set to SET, and if the given profile is not available in the EMDKConfig.xml, it will look for valid profile in extraData argument and if present, the profile will be added to the internal XML volatile repository and also applied to the device. If the profile is present in the EMDKConfig.xml, it will be applied to the device.

If profileFlag is set to GET and if the profile is present in the internal repository, it will be returned in extraData.

extraData - This can be used to provide data for processing action.

Returns:

com.symbol.emdk.EMDKResults

processProfile

public EMDKResults processProfile(java.lang.String profileName, ProfileManager.PROFILE_FLAG profileFlag, java.lang.String[] extraData)

Processes the given profile based on the data provided and the flag and return status of the action.

Example Usage:



profileManager.processProfile("Profile1", PROFILE_FLAG.GET, new String[]{""});

Parameters:

profileName - Name of the profile. ex: 'Profile1'

  • You can also specify just part of the profile when a fully qualified name of the following format is given: [profileName][featureType][name in profile parameter] to just edit part of the profile. For example, if my profile is called ‘EmdkSampleProfile-1’ and the name I gave to the Clock feature is 'clock1'. Passing 'profileName' as ' EmdkSampleProfile-1/Clock/clock1’ will just process this part of the profile.
  • Valid [featureType]: ActivitySelection, Barcode, MSR, Intent, Keystroke, IP, Clock, PowerMgr, PersistMgr, CertMgr, AppMgr, AccessMgr, Wi-Fi, GprsMgr

profileFlag - ProfileManager.PROFILE_FLAG

If the profileFlag is set to SET, and if the given profile is not available in the EMDKConfig.xml, it will look for valid profile in extraData argument and if present, the profile will be added to the internal XML volatile repository and also applied to the device. If the profile is present in the EMDKConfig.xml, it will be applied to the device.

If profileFlag is set to GET and if the profile is present in the internal repository, it will be returned in extraData.

extraData - This can be used to provide data for processing action.

Returns:

com.symbol.emdk.EMDKResults

processProfile

public EMDKResults processProfile(java.lang.String profileName, ProfileManager.PROFILE_FLAG profileFlag, ProfileConfig extraData)

Processes the given profile based on the data provided and the flag and return status of the action.

Example Usage:



profileManager.processProfile("Profile1", PROFILE_FLAG.GET, ???);

Parameters:

profileName - Name of the profile. ex: 'Profile1'

  • You can also specify just part of the profile when a fully qualified name of the following format is given: [profileName][featureType][name in profile parameter] to just edit part of the profile. For example, if my profile is called 'Profile1' and the name in profile parameter is 'myName'. Passing 'profileName' as 'Profile1/ActivitySelection/myName' will just process this part of the profile.
  • Valid [featureType]: ActivitySelection, Barcode, MSR, Intent, Keystroke, IP

profileFlag - ProfileManager.PROFILE_FLAG

If the profileFlag is set to SET, and if the given profile is not available in the EMDKConfig.xml, it will look for valid profile in extraData argument and if present, the profile will be added to the internal XML volatile repository and also applied to the device. If the profile is present in the EMDKConfig.xml, it will be applied to the device.

If profileFlag is set to GET and if the profile is present in the internal repository, it will be returned in extraData.

extraData - ProfileConfig This can be used to provide data for processing action. This parameter is only supported for DataCapture profile features.

Returns:

com.symbol.emdk.EMDKResults

processProfileAsync

public EMDKResults processProfileAsync(java.lang.String profileName, ProfileManager.PROFILE_FLAG profileFlag, org.w3c.dom.Document extraData)

Processes the given profile based on the data provided and the flag and return status of the request. This is an asynchronous method and result will be returned through the registered callback.

Parameters:

profileName - Name of the profile.

profileFlag - ProfileManager.PROFILE_FLAG

If the profileFlag is set to SET, and if the given profile is not available in the EMDKConfig.xml, it will look for valid profile in extraData argument and if present, the profile will be added to the internal XML volatile repository and also applied to the device. If the profile is present in the EMDKConfig.xml, it will be applied to the device. The result will be returned to the application via data listener callback.

If profileFlag is set to GET and if the profile is present in the internal repository, it will be returned via data listener callback.

extraData - This can be used to provide data for processing action.

Returns:

com.symbol.emdk.EMDKResults

processProfileAsync

public EMDKResults processProfileAsync(java.lang.String profileName, ProfileManager.PROFILE_FLAG profileFlag, java.lang.String[] extraData)

Processes the given profile based on the data provided and the flag and return status of the request. This is an asynchronous method and result will be returned through the registered callback.

Parameters:

profileName - Name of the profile.

profileFlag - ProfileManager.PROFILE_FLAG

If the profileFlag is set to SET, and if the given profile is not available in the EMDKConfig.xml, it will look for valid profile in extraData argument and if present, the profile will be added to the internal XML volatile repository and also applied to the device. If the profile is present in the EMDKConfig.xml, it will be applied to the device.

If profileFlag is set to GET and if the profile is present in the internal repository, it will be returned data listener callback.

extraData - This can be used to provide data for processing action.

Returns:

com.symbol.emdk.EMDKResults

processProfileAsync

public EMDKResults processProfileAsync(java.lang.String profileName, ProfileManager.PROFILE_FLAG profileFlag, ProfileConfig extraData)

Processes the given profile based on the data provided and the flag and return status of the request. This is an asynchronous method and result will be returned through the registered callback.

Parameters:

profileName - Name of the profile.

profileFlag - ProfileManager.PROFILE_FLAG

If the profileFlag is set to SET, and if the given profile is not available in the EMDKConfig.xml, it will look for valid profile in extraData argument and if present, the profile will be added to the internal XML volatile repository and also applied to the device. If the profile is present in the EMDKConfig.xml, it will be applied to the device.

If profileFlag is set to GET and if the profile is present in the internal repository, it will be returned via data listener callback..

extraData - ProfileConfig This can be used to provide data for processing action. This parameter is only supported for DataCapture profile features.

Returns:

com.symbol.emdk.EMDKResults

addDataListener

public void addDataListener(ProfileManager.DataListener listener)

The client can register to get data notification via callbacks.

Parameters:

listener

Returns:

void

removeDataListener

public void removeDataListener(ProfileManager.DataListener listener)

The client can un-register to get data notification via callbacks.

Parameters:

listener

Returns:

void