3 Replies Latest reply on Feb 22, 2017 8:25 AM by Billie Hecox

    getEMDKManager method not calling onOpened auto-generated stub

    Paul Clark

      In my android project, my end goal of this is to get a instance of a scanner object on my TC8000 to control when the scanner is able to scan based on what EditText has focus. When I call the EMDKResults results = EMDKManager.getEMDKManager(getApplicationContext(),this);, the onOpened(EMDKManager emdkManager) stub is never getting called. Therefore, the global emdkManager object is never getting set. I have done some research and one of the articles that I found says that "the application must not block the Main thread to receive EMDKListener.onOpened callback." Is this set to block when you start a new Android Project? Why is the onOpened never getting called?

       

      Sorry I am a .NET developer trying to learn Android Studio/IntelliJ IDEA.

        • Re: getEMDKManager method not calling onOpened auto-generated stub
          Darryn Campbell

          Hi, just to make sure everything is set up correctly and nothing has been missed from the application setup (e.g. some EMDK permission) have you tried running any of the samples on the TC8000?  The BarcodeSample1 sounds like it would be a good fit: Barcode APIs - Zebra Technologies Techdocs .  I think the advice about the application not blocking the main thread is more good practice but regardless, the sample app does not block it.

           

          I understand there is probably a very good reason you are going down the Android Studio route but just in case you weren't aware we also have a Xamarin component targeted at .NET developers.

          1 of 1 people found this helpful
            • Re: getEMDKManager method not calling onOpened auto-generated stub
              Paul Clark

              Darryn,

              Thank you for the response. I am currently trying to complete one of the tutorials that are on the website (basic scanning tutorial). I appreciate the feedback and it has indeed led me to my answer. I opened up the download that you suggested and tried to understand how everything ran on the TC8000. It appears that stopping the program in the middle of the onCreate can cause problems in the program. I'm guessing it has something to do with timing but when I was stepping through the program, the onOpened was not getting called but when I let it run, it did get called. I also placed the initializeScanner method in the onOpened instead of the onCreate in the MainActivity. It seems to be working now so I appreciate the suggestion of downloading and opening that project. Many thanks!