locked
Can an app get the notification of device being plugged in or unplugged?

    Question

  • For example, can an app receive the notification of a web cam being plugged in?

    Hong

    Wednesday, July 2, 2014 3:35 PM

All replies

  • Yes, please see DeviceConnectionChangeTrigger class.

    Matt Small - Microsoft Escalation Engineer - Forum Moderator
    If my reply answers your question, please mark this post as answered.

    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined objects and unknown namespaces.

    Wednesday, July 2, 2014 7:52 PM
    Moderator
  • Thanks a lot for the tip, Matt.

    After checking out the class, I have some sense about how to get the notification of unplugging a device.  I will try it.  I could not figure out how to use it to get the notification of a device being plugged in.  Could you offer a tip or point me to some example on it?


    Hong

    Wednesday, July 2, 2014 8:02 PM
  • are you try to build a phone app or tablet? the api matt provided is only for phone. don't think there is an api for windows.

    Microsoft Certified Solutions Developer - Windows Store Apps Using C#

    Thursday, July 3, 2014 6:14 AM
  • Thank you for pointing that out, Dave.  

    This is a Windows Store (i.e. Windows 8.x) app.   I am more interested in getting the notification of a device being plugged in.


    Hong

    Thursday, July 3, 2014 9:04 AM
  • I keep missing that part since we combined the APIs...

    Matt Small - Microsoft Escalation Engineer - Forum Moderator
    If my reply answers your question, please mark this post as answered.

    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined objects and unknown namespaces.

    Thursday, July 3, 2014 11:58 AM
    Moderator
  • I assume it is impossible to get such notifications in a Windows Store app.

    Hong

    Thursday, July 3, 2014 12:04 PM
  • i will keep checking that for you matt ;)

    but i am not aaware of other api's that can do this


    Microsoft Certified Solutions Developer - Windows Store Apps Using C#

    Thursday, July 3, 2014 12:05 PM