C# on Windows Mobile - c#

I am new to C# , working on C# for windows mobile.
I have done basic examples , however where should i get necessary documents (APIS , examples etc ) for C# so that i can explore more .

Windows Mobile Developer Center: http://msdn.microsoft.com/en-us/windowsmobile/default.aspx

OK, assuming that you're already familiar with Visual Studio, Emulators Images, or have already worked with actual devices, you should already have obtained the latest Windows Mobile SDKs; these already include lots of samples and documentation for both managed and unmanaged APIs.
However, you oughta know, most hardware vendors provide their own very specific SDKs and developer's libraries (i.e., for managing barcode and RFID readers, third party bluetooth stacks, add-on hardware, etc.). I'm not talking about crappy smartphones here, but industrial devices such as Motorola's or Intermec's rugged mobile computers.
You will have to sign up to gain access to their software libraries and knowledge bases, though.
http://www.symbol.com/
http://www.intermec.com/
Have fun.

MSDN? http://msdn.microsoft.com/en-us/netframework/aa497273.aspx

You may want to check OpenNetCF. This library is very useful.

You may also have a look here where you will find a lot of useful information about developing for Windows Mobile. You can find links to the MSDN Forums and there are links to tons of videos in which certain tasks are explained very well (with source code in C# and VB.Net).
Good luck!

You're probably going to want to look at this question as well, as it's going to be very relevent for you.

Related

Capture camera using DirectShow

I'm developping a SmartDevice application (Pocket PC 2003 template) in C# for a device with Windows Mobile 6.1. I need to use the camera of this device (photos, video); to do this work i tried using the CameraCaptureDialog class but it does not work for Pocket PC applications.
So, I documented on the internet and found that I probably refer to DirectShow API, but the problem is that I do not know where to start because I can't found a working/correct example.
My questions:
Is this the right way? Are there alternatives?
Where I can find a very good example that shows how to do this work?
You may try directshowbetcf: http://alexmogurenko.com/blog/directshownetcf/ if you really want to go with DirectShow and NetCF.
There's plenty of examples of directshow on the web. There is a site dedicated to converting the API over to C# which makes it a lot easier, maybe this was it http://directshownet.sourceforge.net/about.html. I struggled with DirectShow until I read the book "programming directshow" from microsoft press. About a third of that way through that book it all seemed incredibly easy and I was able to complete what I wanted. In the end it's a lot like referencing any library and using the classes from within that library. The added difficulty is that you need to add wrappers because they are all COM objects but that has been done for you.
This might be useful to you to understand the DirectShow technology. Basically gives a start to DirctShow and explains some of the important points. But its C++ not C#. Hope this help
Basic Video Capture
DirectShow is the video capture API in Windows Mobile 6. There is a Video Capture Filter there and all in all things are designed pretty much the same way they are in Windows.
The problem is that however that this is a native API, and not just in Windows Mobile. To develop in C# you need some bindings and they are missing. On desktop there is DirectShow.NET, which is a missing piece, but it does not seem to fit well for CE. Yet you still need to fill this gap in Windows Mobile.
To work it around you have a few ways, the first would be to go through DirectShow.NET and update it appropriately to start working on your device, strip parts missing in mobile OS etc. This would get you a twin for DS.NET but for mobile operating system.
Another option would be to do some C++ development and implement the minimal sufficient feature set in that domain, exposing the component via COM. Then you will reference this from managed code and things will get connected together. And another obvious option would be to use a third party solution which already does one of the mentioned above.

Snapping pictures from Windows C# Canon SDK vs PTP or MTP

I am hoping to receive some general guidance on accomplishing a seemingly simple goal. I have a DSLR camera (Canon EOS 50D) and need to write an application that will tell the camera to take a picture. I also need to transfer the picture to the computer and possibly delete it from the camera's storage. A bonus would be to get a live preview from the camera in my application. My environment will be Windows (either XP Pro or Vista Enterprise) and .Net 3.5 (C#).
I have done some research and found a couple of options. One I know will work, but limits me to using only Canon cameras in the future. I have found and downloaded an SDK from Canon that provides a lot of this functionality. I've looked over the SDK and while it's extensive and written in C it does have C# wrappers that will speed up development a bit.
Another option I've found is called Windows Portable Devices. Apparently, it is an API that will talk to devices that implement PTP and MTP standards. It is COM based and as far as I can tell it has no .Net wrappers. This is not however a show stopper. I could P/Invoke the functionality I need or write a Managed C++ DLL to use in my application to talk to the camera.
I am looking for anyone with experience with WPD to give me pointers. I've perused the documentation and seen references to transferring images and deleting images. I have not, however, seen mention of commands to take a picture, get a preview image, or say focus/auto-focus.
The WPD api provides the command WPD_COMMAND_STILL_IMAGE_CAPTURE_INITIATE
I am not sure whether your camera supports it but it should be simple enough to find out. If you can get the "wpdinfo" tool from the driver development kit and start it with your camera connected then send it a WPD_COMMAND_CAPABILITIES_GET_SUPPORTED_COMMANDS command and see if it supports the still image capture command. IF so then you could give that a try.
The comment from TallGanglyGuy is incorrect. ptp does allow you to trigger new images and change exposure, etc. Some cameras have firmware that only exposes some of the ptp commands.
PTP supports common device controls, such as taking a picture, so that
the user could take advantage of the PC/camera combination in new and
different ways again, without requiring additional software.
quoted from http://msdn.microsoft.com/en-us/windows/hardware/gg463507.aspx#EXC
try my Eos Framework: https://github.com/esskar/Canon.Eos.Framework
IMHO it's a better alternative then the .cs file that comes with the SDK.
PTP and MTP are both protocols for transferring files from a digital still camera (DSC). The protocols provide no functionality for triggering new images, or setting exposure control. You will be stuck using the camera specific SDK. If you want multiple vendor support Nikon has an SDK that provides similar support as the Canon SDK for their cameras.
More info on PTP and MTP can be found here:
http://en.wikipedia.org/wiki/Picture_Transfer_Protocol
and
http://en.wikipedia.org/wiki/Media_Transfer_Protocol
EDIT
I forgot to mention that WIA may be interesting to you, assuming your camera's driver provides a WIA interface.
This is really generic, but it may help.
I had to write an application that used two different bar code scanners from two different vendors with different SDK's. I created an interface that defined the methods and events that I wanted to code for, and then wrote adapter classes that implemented my interface.
This worked well in my case, and switching from one to the other was pretty seamless. If you took the same approach, you wouldn't be totally dependent upon one SDK.

Using c# .NET 3.0 on a Windows XP machine, what is the most efficent way to record from multiple webcams?

I am trying to figure out what APIs to use to connect and record from a webcam. In al of my research, Google, I have found many OLD articles which discus Directshow and COM. I don't want to write code that is using an obsolete API.
Any direction with this is greatly appreciated.
DiectShow is still the best way to connect to Webcams (or other sources).
You can use DirectShow.NET which is a thin warpper arund DirectShow.
If you are using Vista, you can use the new Media Foundation APIs. But, they are not available on XP, so DirectShow is the way to go. The DirectShow.NET wrapper pointed to by Shay works great with C#. Be sure to also download the Samples, there are several capture samples worth checking out like PlayCap and CapWMV.
UberDemo wrote an article about another way of capturing using the Windows Media Encoder SDK with WPF in this article.
avicap32.dll I guess is the safest option due to its readily availability... http://channel9.msdn.com/forums/TechOff/93476-Programatically-Using-A-Webcam-In-C has the PInvoke code you will be needing.
http://codeplex.com/touchless is an interesting related project!

Wiimote example programs

I'd like to use the Wiimote (accelerometers, gyroscopes, infrared camera, etc, etc, etc) on various applications.
It's a bluetooth device, and I know others have connected it to their computer.
What's the easiest way to start using it in my software - are there libraries for C#, for instance?
I want my software to be usable and easily installable - what's the current easiest way to connect a wiimote to the computer? Can I make that process part of my software installation?
-Adam
Have you seen Johnny Chung Lee's 'Procrastineering' Blog? He's written a lot on the subject of using wii remotes and has some fantastic demonstration videos. [Edit] I just found out Mr Lee did a TED talk which gives a good introduction to the stuff he's done too...
There's a wealth of information over on Wiibrew.org - check out their Wiimote Library page for some other APIs if you want to look beyond c#. As an avid Python fan, I'm quite curious to have a play with the pyWiimote library :-)
Coding4Fun had a managed C# library up that would allow you to interface with it but it seems their site is down right now. Though I think they used the Robotics Studio so that may be a place to start.
Found it... http://www.codeplex.com/WiimoteLib
Oh and I forgot to post a link to these videos I saw quite some time ago. http://www.cs.cmu.edu/~johnny/projects/wii/
If you use WiimoteLib (from Coding4Fun as mentioned in another answer), there is an example application called WiimoteTest. This tests all of the Wiimote inputs and outputs, including for multiple Wiimotes at the same time, so it is a good starting point for your own Wiimote code as it gives you an example of how to do pretty much anything you would want to.
For the second part of your question, connecting the Wiimote to the computer is pretty much the same as connecting any other Bluetooth device. I don't know that it would be very suitable to have this done at installation as it is likely to be connected and disconnected a lot, especially since the Wiimote will turn itself off if not used for a while. However, it's pretty much a matter of following a standard Windows wizard to connect to it, so it's not too hard. This assumes you have a Bluetooth driver that will work with the Wiimote - more information on that is available at the Coding4Fun website. It worked for me with the default driver that already came with my laptop but if it doesn't for you, the one they recommend is BlueSoleil.
what's the current easiest way to
connect a wiimote to the computer?
I not found solution for connect wiimote within my software, you have to connect manually into Windows, but on Windows register bluetooth device it very take time, Try Toshiba bluetooth stack it more convenient.

Bluetooth APIs in Windows/.Net?

I am in the process of writing a Bluetooth scanner that locates and identifies mobile devices in the local vicinity. Is this something that I can accomplish using C#, or do I need to drop down into the C/C++ APIs? My application is targeting Windows XP and Vista. Pointers are appreciated.
Thanks!
One problem with Bluetooth on the PC is that there are several BT stacks in use and you can never quite know which one is available on a given machine. The most common ones are Widcomm (now Broadcom) and Microsoft (appeared in XP, maybe one of the service packs). However, some BT hardware vendors package BlueSoleil and some use Toshiba. Most dongles will work with the MS stack so the .NET libs I've seen tend to use that.
Each of the stacks has a totally different way of doing the discovery part where you browse for nearby devices and inquire their services.
If I had to pick one approach today I'd probably do the discovery in C++ and add an interface for .NET.
The 32feet.net stuff worked pretty well when I tried it but didn't support the Widcomm stack.
There is also Peter Foot's 32feet.net
http://inthehand.com/content/32feet.aspx
I've played around with this back when it was v1.5 and it worked well.
Mike Petrichenko has a nice BT framework. It works with BlueSoleil, Widcomm, Toshiba and Microsoft.
It is now called the Wireless Communications Library and works with Bluetooth 802.11 and Infrared. Mike named the company Soft Service Company and sells non-commercial and commercial licenses with and without source code in prices ranging between $100 and $2050.

Categories