I want to build a Windows Phone 8 (C#) application with Qualcommm's FastCV. It's very simple with Android, about I have problems with Windows Phone because there isn't any documentation about it.
After installation FastCV SDK v1.5 for Windows Phone, I have a header file (fastcv.h) and a .lib file (libfastcvnative.wp63.lib). How can I use/refer the both C++ files in VS 2012/2013? Are there also a tool like CDT in Eclipse?
At Qualcomm's Dev-Forum there is a solution, but I cannot understand it.
Another question: Are there others computer vision (object detection, text recognition ..) for windows phone 8 - maybe with a better documentation?
Thanks!
I came across over this CodePlex project. It seems to be doing what you need. If it does not work, you could try the approach below.
One problem is that C# is managed code, while FastCV library is probably native code.
So you would need a wrapper that "forwards" the FastCV functions you intend to use. Native Code and Manged C++ interoperability is more easy to have as you can have managed code and native code even in the same file. See here for more details.
So you need to make a manged C++ library, load it as an assembly from your C# project and consume it from there. The C++ managed library will just call the native FastCV functions.
Are there others computer vision (object detection, text recognition
..) for windows phone 8 - maybe with a better documentation?
Yes. You can have OpenCV for Windows 8 / 8.1. Check here for more information. It's not guaranteed to be optimized better than FastCV but I have a feeling that it's much more complete than FastCV functions. I would go with OpenCV before FastCV.
Related
I just got back from Microsoft Build 2018 where they announced .NET Core 3 support for WPF applications. This is great because I can finally start using some of those cool fluent design things that are available for UWP. The only problem is, it's not getting released until next year.
I started looking into converting my app to a UWP app (because I'm impatient) but I'm running into some challenges. Mainly hardware. Talking with a few guys at Build, they made it seem like it was possible to write UWP apps that connect to low-level Win32 drivers for communicating with hardware (HID printers, card readers, bar code scanners, etc). I'm not having any luck finding information about this. Just to be clear, this is not an app I want to release to the Windows Store. This is a kiosk app that runs on our own hardware.
How does one access Win32 APIs for hardware integration in UWP?
Your best bet is likely to use P/Invoke, which is technology designed to allow .NET code to call unmanaged code. Assuming that your hardware is accessed through Win32 APIs in a DLL, this may be your best option.
The pinvoke.net Web site provides specific examples of the .NET code needed to call a specific Win32 API. Perhaps those examples can help you get started.
UWP app written in C++/CX has access to the Win32 and COM APIs that are part of the Universal Windows Platform (UWP).
The APIs in Win32 and COM APIs for UWP apps is only for C++, you can not use the C# to access it directly. Please see Visual C++ Language Reference (C++/CX) to get more details about C++/CX.
But, you can create a Windows Runtime component in C++/CX, then call it from C#, you can see the Walkthrough here:
https://learn.microsoft.com/en-us/windows/uwp/winrt-components/walkthrough-creating-a-basic-windows-runtime-component-in-cpp-and-calling-it-from-javascript-or-csharp
I've read that applications which are being developed using Mono are deployed with a MonoRuntime that works similar as ART, interprets the C# code, executes them etc. I assume Unity and Xamarin both does this.
What is strange for me is that theoretically I could write a runtime and ship it with my app? But that is supposed to be next to the runtime, below the application framework? How can the sandboxing let this happen?
I assume this might be the solution to my confusion, but I struggle understanding it.
What am I missing here?
Thanks in advance
First think about how NDK/JNI apps work on Android. They are launched from standard Android Java code run via ART/Dalvik and use JNI calls into C/C++ code. The process is still within the standard Android 'sandbox' but has additional lower level access to libraries provided by Android NDK headers. As that code is written in C/C++ it can be performant/cross system compatible.
So to answer:
But that is supposed to be next to the runtime, below the application framework?
I would argue no, at least you aren't really below the Android application framework. The MonoRuntime is started from Android and can use any of the 'Standard Libraries' which are exposed either via a JNI wrapper to the Android Java side or by a NDK header.
If you look at the below diagram you'll see 'Standard Libraries' which can be OpenGL ES which has a Android Java API and OpenSL ES which exposes more detail in NDK than the Android Java media api.
I could write a runtime and ship it with my app?
Yes you could, although you may want to define clearly what you mean by 'runtime'. If you are pre-compiled you can strip out unnecessary classes/modules which I believe Mono does.
How can the sandboxing let this happen?
You are still in the sandbox. Nothing prevents you from writing your own interpreter / Virtual Machine written in C/C++, interfacing the Android framework through standard JNI/NDK calls, and adding it to your own APK. Regardless you are still limited to what the Android framework/runtime allows for apps along with same process restrictions and limitations.
Currently I`m exploring how to write mobile apps for Android using Xamarin and C#. Also I have some c++ libraries(and source code for them) that should be used in application. These libraries are responsible for communication via internet(just to say).
So it is possible to use this c++ code in xamarin.android project? Or it should be rewritten in c# to be used?
Im not sure with networking but most C++ code can be used 100% in Xamarin.
If it works, you can't be sure if it works correctly in every situation on IOS.
We had the same problem with using UDP Sockets for VOIP(C#).
Most of the time it will work, but in case of VOIP you need to use iOS sockets so you can set them to a special mode so they won't be closed when the app gets paused.
So it depends on what you want to do and how the C++ code is written.
Im not sure if you can use normal unix sockets when using C++ on iOS but that should be the only problem when using it.
Just checked: Does Mac/IOS use the same sys/socket.h as the Linux kernel?
I think, if your library uses BSD sockets everything should be fine.
Usually it is possible to call some code in any other library unless
It exports the functionality
There is a wrapper in your language to make use of that exported functionality.
I do not know much about this Xamarin thing but I guess you should see if the library is binary compatible not code (i.e) that compiles with the source of your C++ project and you can make calls to it from your C# program.
Also while checking the Zamarin library documents, it seems that not every piece of C# code can be used on Xamarin platform. Please check the Xamarin community and the forums for more in details.
I've recently chosen to learn C# and develop mobile apps using C# on Xamarin. Particularly for Windows Phone and Android development. I know that Windows Phone app development is mostly C#, and that Xamarin can compile native code for Android, but how does it compare to native development in Java? Will I be able to use EVERY or at least most (like 90%+) of the Android SDK and extensions using Xamarin?
The main thing which I think there is to consider is your preferred programming language - which in your case is C# - and using that. The only thing that is of concern to me when building an app in C# as oppose to Java is their is not as many 3rd party references to use as there is with Java. You will find yourself downloading example files and reverse engineering them in order to learn how to do new features, you will have to search intellisence far more to find what something is using if you can only find a Java based example of something. One thing which you will find though is that it usually can just be the same method as what is in Java but the first letter being capitalized. LINQ is a major benefit I find in data manipulation which is not available in Java.
Good luck with whatever you choose, James
I did not do any stats or study of Xamarin C# coverage of Android Java API, but in my work, everything that I needed when porting code from Java to C# was there. Also, Xamarin says that for new Android SDK releases they usually have C# counterparts released within 24 hours. And, as #dotToString remarked, you can add Java jar libraries to Xamarin C# project and make calls to them if necessary.
Performance is another matter - I don't believe it runs natively on Android. Rather, Mono runtime is somehow interpreting the byte code. I did some comparison of Java vs. Xamarin C# code performance on real life code, see more at:
Does anyone have benchmarks (code & results) comparing performance of Android apps written in Xamarin C# and Java?
Greg
you can use all of the android functionality and java library interop. also, you get the advantage of non windows specific .net including linq.
Can I write applications for iPhone in C++ or C#?
Where can I find simulators for iPhone for testing my apps.
How to write them?
You need at least a small Objective C stub to hook into the system and deal with provided services (including getting input), but your program can be primarily in C++ if you would like. Apple seems to disallow C#; tools such as MonoTouch appear to be banned by the current developer agreement.
With a Macintosh, you go to Apple's developer website and download the tools and SDKs for free. They only run on the Mac.
You will want to start here for iPhone development:
http://gemma.apple.com/iphone/index.action
This is where you will get the iPhone SDK, simulator, and other essential tools.
You can use C, Obj-C, and C# (via MonoTouch).
C++ is a partial via Objective-C++. If you're serious about iPhone development though, I would suggest learning Objective-C.
Apple seems to reserve the right to kill the ability to run any application that wasn't writting in either C or Objective-C.
As far as I know, you can use C# for the iPhone using MonoTouch.
Another tool is unity, which is geared towards games and is based on the same codebase.
Both of these are proprietary and cost $$$.