Hello,
I'm really new to programming with EMDK on Android and currently in the progress of programming an App for my company special for the TC56/51.
Now i'm stuck with the ProfileManager, i'm trying to upgrade the app via the AppManager feature to accomplish this I'm setting the Profile in the extra Data:
extraData[0] = "<?xml version=\"1.0\" encoding=\"UTF - 8\"?>" + "<characteristic type=\"Profile\">" + "<parm name=\"ProfileName\" value=\"UpdateMobileClient\"/>" + "<characteristic type=\"AppMgr\" version=\"5.1\">" + "<parm name=\"emdk_name\" value=\"UpdatePaxControlMobile\"/>" + "<parm name=\"Action\" value=\"Upgrade\"/>" + $"<parm name=\"APK\" value=\"{updateFilePath}\"/>" + "</characteristic>" + "</characteristic>"; var emdkStatus = eMDKProvider.ProfileManager.ProcessProfile("UpdateMobileClient", Symbol.XamarinEMDK.ProfileManager.PROFILE_FLAG.Set, extraData);
But the only Result i get is this:
<?xml version="1.0" encoding="UTF-8"?> <wap-provisioningdoc> <characteristic type="status"> <parm name="code" value="1"/> <parm name="description" value="Failure"/> <characteristic type="extended_status"> <parm name="code" value="10"/> <parm name="description" value="Failed to connect dependency services."/> </characteristic> </characteristic> </wap-provisioningdoc>
So far i was not able to find any solution, the the APK file is in the right spot.
I really don't know how to get more information why the profile does not work or were my problem is.
I hope someone can help me out.
Patrick
Hi,
That error would indicate that something has gone wrong opening the EMDK service, perhaps you invoked the API before it was ready? I suggest taking a look at the sample app for application installation: App Manager - Zebra Technologies TechDocs , hopefully that will be a good starting point to figure out what is going wrong.
Points: 0
You voted ‘up’
Hi Darryn,
thanks for your fast reply I forgot to mention that i'm using the EMDK under xamarin Android. so far i had no problem with the EMDKManager and the BarcodeScanning features with the build in scanner on the TC56. So i think the API should be ready if the scanner works perfectly fine and i try then to execute the AppManager routine?
I tried some Sample code from the Wifi Sample but it also shows up the same message, so i think you are right that some where else musst be the problem.
This i my current code for the providing of the EMDK API for My app, it will be initialized as one of the first things because Scanner initialization will be also very early in the Init Prozess of the App:
Also i looked into the App Manager Sample, and as far as i can see i'm doing it right...
Also one question more poped up in my head, all the profiles i set or i will set get saved internal by the API, right? Is there a way to see wich profiles allready loaded in?
I found nowhere an answer to this?
But thanks for your help so far.
Points: 0
You voted ‘up’
You say you tried the WiFi sample... do you mean this one? WiFi Configuration - Zebra Technologies TechDocs . And that didn't work? I don't see why that would not work on a TC56, you should be able to disable and enable the WiFi. If you can get that WiFi sample working then if you modify the EMDKConfig.xml as follows:
And modify the MainActivity.cs as follows:
it should install the apk (obviously there is a step there about adding the apk to the device in the correct name / location)
But I really don't understand why the WiFi sample I linked to above would not work on a TC56 I'm afraid.
Points: 0
You voted ‘up’
> Also one question more popped up in my head, all the profiles i set or i will set get saved internal by the API, right? Is there a way to see wich profiles allready loaded in?
No, I don't believe so, they are just applied to the device.
Points: 0
You voted ‘up’
Oh i think i miss described it, i copied the the xml from the Wifi Sample over to my code and tried to prozess this, but with the same result(see my first post)
i haven't tried the complet sample code yet, but i will later.
thanks for your help so far
Points: 0
You voted ‘up’
Good morning from Germany,
this morning i tried the Wifi Sample and it worked perfectly on the TC56, sorry for the bad description.
I now tried also to add the profile xml Data via extraData and EMDKConfig.xml, but every time i get the result that says:
Failed to connect dependency services.
But in the next moment, i try the scanner, wich also needs the EMDK API but the BarcodeScanner not the ProfileManager and it works perfectly fine...
I really have no idea what i'm doing wrong!?
Is it because i'm using Xamarin.Android? but the Sample works fine so far?
Or is Xamarin.Forms a problem?
Points: 0
You voted ‘up’
Hi Patrick,
I've used in the past our EMDK with Xamarin.Android and Xamarin.Forms and it works, once you keep in mind the lifecycle of your application/activities.
I don't think that the problem is in the XML you're using per se, but in the way you're using the EMDK in your codes.
If I understand correctly, you're able to request a ProfileManager instance using:
ProfileManager = EMDKManager.GetInstance(EMDKManager.FEATURE_TYPE.Profile) as ProfileManager;
But you get the "Failed to connect dependency services." once you try to set an actual profile with:
var emdkStatus = eMDKProvider.ProfileManager.ProcessProfile("UpdateMobileClient", Symbol.XamarinEMDK.ProfileManager.PROFILE_FLAG.Set, extraData);
What I don't understand is why you're building a Task to execute the Synchronous ProfileProcess API when there's an Async version API in the EMDK:
ProfileManager - Zebra Technologies TechDocs
~Pietro
Points: 0
You voted ‘up’
Hi Pietro,
it's good to hear that it should work so there have to be a issue/solution
yes, with this code, i get an instance of the profileManager and as far as i can see while debugging, this works.
yes that's exactly what's happen all the time.
I have tried also the Async version, but with the same result, so as long as i'm try to get it to run, i switched back to the synchronous version but it really doesn't seem to matter when it came to the error (Failed to connect dependency services) both versions return the same Xml result.
Points: 0
You voted ‘up’
Ok, I cannot see anything from wrong what you posted.
Let's do some basic error checking (sorry for the "is the light on?" kind of questions).
Which version of EMDK are you using?
Which version of Mono, Xamarin.Android and Xamarin.Forms are you using?
Which build number and patch level is on your TC51/TC56 (from the settings, about phone/device)?
Would be possible to have a test project to test from our side?
thanks
~Pietro
Points: 0
You voted ‘up’
EMDK Version 2.6.0.69 in VS2017
Xamarin Forms 2.4.0.91020 (there is an Nuget update to 2.5.0.122203)
TC56 Buildnumber 01-16-08.1-MG-00
MX:
OSX version: QCT.60.6.3
MXMF version: 6.2.1.0
Points: 0
You voted ‘up’
Hello everyone,
I now found my bug, i was using a second EMDKListener, that steels/reInit the EMDKManager and the profilemanager is so not longer working...
Sry for that :/
I now fixed it, and it works, but i can't upgrade the app, is it possible to upgrade the app itself, while it is running?
(should i make a new thread)
Thanks for all your help
Patrick
Points: 0
You voted ‘up’
Log in to post comments