03-09-2013 07:52 PM
Security prompt goes background when I create new instance of BarcodeScaner class.
It appears and viewFinder goes Foreground(on top of it)and user cannot select desired option for security.
I assume that somehow we need to synchronize thread with security prompt and wait for user to finish.
Or GlobalEventListener is solution?
Thanks in advance
03-10-2013 07:08 AM
I suggest the appropriate approach is to ask for the Permissions that you want, right up front (at application start-up) and not try things like this unless you know you have the appropriate permissions.
The ApplicationPermissionDemo is a good sample to use for this.
03-11-2013 04:08 PM
Ok,in that case,it should work.But regarding App Manager for Middle for example,app stops executing until user select security option,and than continue,that is exact behavior for Player class when accessing Media just wonder how to synchronize with App Manager for UiApplication to get same result?If prompt is called from Manager thread,than it is possible to synchronize with that thread a wait to finish(wait for user to select option)and then continue executing code that changes screen and show viewFinder of BarcodeScaner class.I will try to write code for granting permissions,and post the result.Also,I want to have full control of app behavior including interaction with App Manager,because when I run my example code for BarcodeScaner and security prompt is shown and hide after few seconds,it really looks like bug,and than is exactly behavior that I don't want in my app
Thanks for replay
03-11-2013 06:32 PM
I agree that the behavior you see can be different depending on what application you are running. For example, the network interaction will wait but screen shot will fail and supply you with a blank image. This inconsistency is why I recommend that you do not wait till the permissions is requested, but do it in a consistent way at application start up.
Sorry I have no experience of Barcode scanner class and how it interacts, so I have no if there is a work around that will get it to behave as you want.
03-12-2013 10:42 AM
Peter is correct, you should be manually requesting the permissions your app needs before you try and use them. All at once is fine before the app starts, but you can also do it such that before you do something that needs permissions prompt the user, and then if it's granted, try and do what you were going to do in the first place.