Question

I am writing a barcode scanner for iOS and Android using Flex Mobile and ZXing. I have optimized ZXing as much as I can, but it is still too slow to use for continual scanning on some older devices. I extracted some of the heavy work into a C SWIG using FlasCC and got some pretty decent speedups during scanning. When testing on an actual device though, I get errors when starting my app. The debug console says "Mutex cannot be initialized" and crashes. Removing calls to my SWC, the app starts just fine. First of all, is using this type of SWC even possible on a mobile device? If so, what am I doing wrong? Also, the size of the generated library is pretty large (400KB+). Is there any way to reduce the size by excluding all the extra fluff?

Was it helpful?

Solution

While you can use FlasCC on mobile, I wouldn't recommend it: your code can run at native speeds and you have access to the OS APIs. Have you looked into Air Native Extensions?

OTHER TIPS

This is an old question, but in case anyone else encounters this issue:

I had the same problem and the fix was simply recompiling my FlasCC SWC using the latest version of FlasCC (now known as CrossBridge).

I used CrossBridge version 1.0.1 and it did the trick.

AIR for mobile doesn't yet support Flash Workers, which is what the FlasCC multi-threading is based on. Are you trying to run ZXing in a background thread, or are you compiling your FlasCC SWC with "-pthread" ?

[edit] Actually there might be an error in our startup code for AIR mobile, even when the FlasCC code is not threaded... testing a fix now

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top