xamarin android EMDK ProcessProfile always return checkXml !

// Expert user has replied.
Y Yanis Dalabiras 3 years 7 months ago
21 4 0

Hello,
i work with visual studio 2015 and xamarin.
 
I have a device zebra TC 75 with android version 6.0.
I've a zebra tutorial for to create a profil and load it when user click on a button on the app.
 
On this profil i set just the wifi never sleep and screen off to 30 min that's all
I've follow this link : Your First EMDK For Xamarin Application - Zebra Technologies TechDocs
 
well, when i run my app i check that the screen off is set to 15 second for testing it.
 
when i run the app, click on button the EMDKResults return always check xml BUT my profil is set !!!!
Never time the EMDKResults return Success ....
 
Here is it the code i used , anyone have an idea ?
the code is the same than the article, i've add the necessary in the manifest file, i've reboot my device ...
 
I can't understand why the EMDKResults is always set to check xml ...argh !!!!
 
on my mainActivity => onCreate method
protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
 
            // Set our view from the "main" layout resource
            SetContentView(Resource.Layout.Main);
 
            tvStatus = FindViewById(Resource.Id.textViewStatus);
            button = FindViewById(Resource.Id.MyButton);
            button.Click += delegate { ApplyProfile(); };
            //
            EMDKResults result = EMDKManager.GetEMDKManager(this, this);
            if (result.StatusCode == EMDKResults.STATUS_CODE.Success)
                tvStatus.Text = "RESULT IS OK";
            else
                tvStatus.Text = "EMDK MANAGER NOT LOAD";
        }
 
Next, on button i do that :
void ApplyProfile()
        {
            if (profileManager != null)
            {
                EMDKResults results = profileManager.ProcessProfile("ClockProfile", ProfileManager.PROFILE_FLAG.Set, new String[] { "" });
                if (results.StatusCode == EMDKResults.STATUS_CODE.Success)
                    tvStatus.Text = "Status: Profile applied successfully ...";
                else
                {
                    if (results.StatusCode == EMDKResults.STATUS_CODE.CheckXml)
                    {
                        using (XmlReader reader = XmlReader.Create(new StringReader(results.StatusString)))
                        {
                            String checkXmlStatus = "Status:\n\n";
                            while (reader.Read())
 
thanks for your time

Please Register or Login to post a reply

4 Replies

C Charitha Mallawaarachchi

Hi Christophe,

Billie has explained you the reason above why it is happening.

If you want to analyze the return xml, you can refer to the existing samples Zebra has provided. Refer the CheckXmlError private method of the below sample.
WiFi Configuration - Zebra Technologies TechDocs

Hope this helps.

Thanks,
Charith.

C Christophe BERNARD

Hello Charita,
thanks for your time and the link you provide in this mal.

have a nice day

C Christophe BERNARD

Hello again,
just one think

How i can know if the profile is set or not ?
In resume, in my app on the splash screen i will activate the profile by the method => ProcessProfile
but everytime the user load my app, the processProfile will be executed and it's take some time ...

Is it a method or something else to check if the profil has been set or not ?

thanks for all guys

Y Yanis Dalabiras

Hi Christophe,
     That is expected behavior,  Success will only be returned when using the Profile Manager Data Capture features. All other Profile Manager features will return CheckXml. You will need to inspect the XML to see if there any errors in the XML

CONTACT
Can’t find what you’re looking for?