×

Discussion Board

Results 1 to 6 of 6
  1. #1
    Regular Contributor
    Join Date
    Sep 2008
    Posts
    55

    Checking / listening for headphone availability / (un)plugging from S60 3rd onwards

    Hi all,

    I'm trying to implement listening to a headset being (un)plugged, but it's not really working out as I hoped.

    Sources:
    http://wiki.forum.nokia.com/index.ph...odeChanged_API
    http://wiki.forum.nokia.com/index.ph..._notifications

    The code (for S60 5th edition and Symbian^3 also I think):
    Code:
    // registering observer
    CAccMonitor* accMonitor = CAccMonitor::NewLC();
    accMonitor->StartObservingL(this); // with 'this' being my observer (implementing 'MAccMonitorObserver')
    I think I should be getting callback events to 'ConnectedL(CAccMonitorInfo* aAccessoryInfo)' and 'DisconnectedL(CAccMonitorInfo* aAccessoryInfo)' but I'm not receiving anything.
    Could someone shed some light if I'm doing something wrong or am I not doing enough to register for these events?

    I also want to have this functionality on S60 3rd edition devices, but I read that 'KAccessoryModeChanged' is to be used there.
    Does this API work on all S60 3rd devices, because the note (see first link at bottom) says: 'While the API is include in the S60 3rd Edition FP1 version of the SDK API Plug-in it is a known issue that it will not work with S60 3rd Edition FP1 phones.'
    Isn't it possible to also use the accMonitor on S60 3rd devices by including the needed libraries somehow?

    An alternative would be to just check if a headset is connected. I don't know if there is possible way to just check for that instead of listening to (un)plugged-events?
    Another alternative which I saw somewhere, would be to check the 'Indicator pane' from the status pane and check for the headset icon (EAknIndicatorHeadset), but I think an application cannot access that pane for it's state, am I right?


    Any help is greatly appreciated!

    Thijs

  2. #2
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,165

    Re: Checking / listening for headphone availability / (un)plugging from S60 3rd onwar

    Firstly APIs in API plug-ins are not having any compatibility promise, and if it is marked that is does not work on some specific platform version then it does not work there. also you can not use APIs that are for newer platform versions in older ones, you could try always using APIs made for older platform versions and see whether they work with newer ones, but still remember that with these APIs there is no compatibility promise.

    Also, you can not use this API as a local variable, thus do Try it with a supported platform version, i.e. 5th edition device, and make the class instance a member variable of your class, construct it in the ConstructL function and delete it in destructor, that way it would be valid the whole life time of the class it is used in.

  3. #3
    Regular Contributor
    Join Date
    Sep 2008
    Posts
    55

    Re: Checking / listening for headphone availability / (un)plugging from S60 3rd onwar

    Thank you for your answer!

    Making the class instance a member variable did the trick, so for newer devices (e.g. S60 5th and newer) this alternative ('CAccMonitor' class) works.

    If I am correct, then there is no working API for S60 3rd edition FP1 devices to listen for headset events?
    I haven't found any alternatives yet for those devices...


    Thanks again for the help.

    Thijs

  4. #4
    Regular Contributor
    Join Date
    Sep 2008
    Posts
    55

    Re: Checking / listening for headphone availability / (un)plugging from S60 3rd onwar

    Is there a possible alternative to just check if the headphone is connected, without the need of listening for those events?
    This functionality is only needed on S60 3rd edition (initial, FP1, FP2), as S60 5th edition and newer devices can use the 'AccMonitor' alternative.

    If anyone could provide a possible solution, I would be very grateful.

  5. #5
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,165

    Re: Checking / listening for headphone availability / (un)plugging from S60 3rd onwar

    if the API plug-in does not provide any alternative, then you could always try out paid technical support, they would investigate and if possible identify any API that could be used for your use case.

  6. #6
    Regular Contributor
    Join Date
    Sep 2008
    Posts
    55

    Re: Checking / listening for headphone availability / (un)plugging from S60 3rd onwar

    Ok, thanks for you help!

Similar Threads

  1. JNI in S60 3rd Edition FP2 onwards?
    By jellinek in forum Mobile Java Tools & SDKs
    Replies: 10
    Last Post: 2011-08-19, 11:01
  2. Listening for UN-installation
    By kingkiko in forum Symbian
    Replies: 4
    Last Post: 2010-03-02, 16:34
  3. Help. My n85 keeps on freezing/restarting when plugging in headphone jack.
    By illapino83 in forum General Development Questions
    Replies: 1
    Last Post: 2009-11-11, 05:59
  4. Replies: 3
    Last Post: 2009-06-21, 15:19
  5. Replies: 0
    Last Post: 2006-09-06, 05:47

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×