startAudio works on a simulator, not on the device

I've got and 8310 and 8100 and none of them will play any audio device.  This works very well in the Simulator. Probably something stupid I do because I'm new to the development of BB, but I am simply not see:

final class AudioHelper {
    private static final int VOLUME = 100;
    private static final int FAILED = 2;
    private static final int SUCCESS = 1;

    private static short[] failedAudio =
    {
        100, 50, 200, 50, 200, 50, 100, 50, 200, 50
    };       

    private static short[] successAudio =
    {
        500, 300, 500, 300, 500, 300, 500, 300, 500, 50
    };

    public static void Play(int noise) {
        short[] tune = noise == SUCCESS ? successAudio : failedAudio;
        if (Alert.isBuzzerSupported())
            Alert.startBuzzer(tune, VOLUME);
        else if ( Alert.isAudioSupported())
            Alert.startAudio(tune, VOLUME);
    }
}

Please note that the setVolume method only accepts values in increments of 10.  A value greater than this is ignored.  You must gradually increase the volume to make sure that it is set at a level you can hear.

Tags: BlackBerry Developers

Similar Questions

  • Event Swipe works in the Simulator, but not on the device

    I'm using panels on my 9900 and I have 4 panels that the user will slide back and forth similar functioning BB app world, changing the summary of comments on signs etc..

    My expection who was up and down for scanning of touch screen functions and the touchpad has the same function by default, that is to the left and right slide on the screen should also be identical to forehand and left on the block to tack. But it does nothing for the panels when you use the trackpad.

    So I replace NavigationMovement and and can see the touchscreen and the track pad to generate a NavigationMovement event with +/-x according to the direction slide. So I'm first puzzled why hit swiping the trackpad on the left and right triggers not the same behavior by hitting swiping left and right on the touch screen.

    Accept that as a limitation of the API, I added my own features to NavigationMovement to inject a key event when user left or right on the trackpad moves. As follows:

    EventInjector.TouchEvent [] moveEvents = new EventInjector.TouchEvent [7];

    moveEvents [0] = new EventInjector.TouchEvent (TouchEvent.MOVE, 420, -1, -1, 60-1);
    moveEvents [1] = new EventInjector.TouchEvent (TouchEvent.MOVE, 360, 60,-1, -1, -1);
    moveEvents [2] = new EventInjector.TouchEvent (TouchEvent.MOVE, 300, 60,-1, -1, -1);
    moveEvents [3] = new EventInjector.TouchEvent (TouchEvent.MOVE, 240, 60,-1, -1, -1);
    moveEvents [4] = new EventInjector.TouchEvent (TouchEvent.MOVE, 180, 60,-1, -1, -1);
    moveEvents [5] = new EventInjector.TouchEvent (TouchEvent.MOVE, 120, 60,-1, -1, -1);
    moveEvents [6] = new EventInjector.TouchEvent (TouchEvent.MOVE, 60, 60,-1, -1, -1);
    EventInjector.TouchEvent.injectSwipeGesture (480, 60, moveEvents);

    It works perfectly in the Simulator, but on the device, there is no movement at all. So I thought that maybe the touchpad on the Simulator is more sensitive than on the real device, so I added a menu item to perform the injection above. Again, this works perfectly on the Simulator, but nothing on the device.

    Has anyone tried this brain left and just before the injection?  Up and down the injection works perfectly on the device.

    Have you enabled event injection in request permission settings for your application?  It is disabled by default.  You can do so by going to Options-> Application, select your application and click on change permissions.  You can also request these permissions programmatically using the class ApplicationPermission.

  • I've updated the motherboard (Asus) and now Nvidia card beats nice work my PC do not play the .mp4 files

    I've updated the motherboard (Asus) and now Nvidia card beats nice work my PC do not play the .mp4 (with VLC, Quick time player ect..) files

    And what about the Windows Media Player12?

    You must uninstall and reinstall VLC Media Player, it seems codecs has been corrupted. You can also download and install ffdshow

  • Mobile: The spark fade effect works is not on the device

    Hello:

    I have a TabbedViewNavigatorApplication with Flex SDK 4.6 that has four ViewNavigator (tabs). In the first, his original point of view has a list of spark with custom IconItemRenderer and by clicking on an element, the browser pushes another opinion. I applied a spark effect to make a fade on the current view before pushing a new (on the EFFECT_END event).

    It's the definition of the effect:

    < fx:Declarations >

    < s: Fade duration = "{ParamsModel.timeoutFadeOut}" id = "fadeOutEffect" alphaFrom = alphaTo "1.0" = "0" / > "

    < / fx:Declarations >

    And that is launched when the user clicks on an item in the list:

    public void loadView(view:*,_data:Object):void

    {

    Avoid the transition between slides by default between views

    tabbedNavigator.activeView.navigator.defaultPushTransition = null;

    Add listener to detect the end of the fade effect

    fadeOutEffect.addEventListener (EffectEvent.EFFECT_END, function(event:EffectEvent):void

    {

    Delete this listener until the next call to 'loadView() '.

    IEventDispatcher (event.currentTarget) .removeEventListener (event.type, arguments.callee);

    After erasing is completed, press the new view

    tabbedNavigator.activeView.navigator.pushView (display, data);

    }

    Play the fade on the current active view effect

    fadeOutEffect.play ([tabbedNavigator.activeView]);

    }

    In fact, this short code smooth on the emulator, but I can´t see no fade effect on the device. I mean, it s not that the effect works buggy or slow. He doesn´t bland at all. West a time (exactly the duration of the effect) where nothing happens, and then the new view load without any effect. What Miss me? I really miss a kind of "emulated hardware installation" on the emulator definitely know if what I see on the computer will work (in terms of performance) on the device... I easily spend 50% the time coding and 50% this kind of continuous performance of fixing problems.

    EDIT: In one of the tabs, a custom list has a gradient background. I Don t know why, but this background is the only element that seems to be affected by the fade effect. Gently, she turns to alpha: 0, but his Don t containing elements.

    Thanks in advance!

    I can´t believe it... While writing the previous post, I thought of a really simple solution and compiled to give it a try. It works perfectly!

    As simple as setting the property "cacheAsBitmap" to "true" on the spark lists points of view!

  • Hello my MacBook Pro model (MacBook Pro (15 inch, early 2011 am Dubai bought the Sryalsh C02FD2CPDF8 number and I am in Iran that MacBook Pro not enter the device screen when I turned on the pink vertical lines can be seen, the problem is restless))

    Hello my MacBook Pro model (MacBook Pro (15 inch, early 2011 am Dubai bought the Sryalsh C02FD2CPDF8 number and I am in Iran that MacBook Pro not enter the device screen when I turned on the pink vertical lines can be seen, the problem is agitated and it is not difficult to work with him because I like and what I should I do?))

    Serial number C02FD2CPDF8V

  • Windows controllers USB 8 not on the Device Manager list

    Bus controllers series not on the Device Manager list. USB ports not working do not. I tried equipment difficulty and said could not find drivers for multifunction device clicked on fix not found the drivers for it. could use a little help with that.

    USB windows 8

    Hello

    Sounds like hardware and you cannot resolve hardware with the software. Check with the system
    Manufacturer of support, their books online, the diagnosis and ask in their forums (if
    There are). Or check with a real computer store (one who does on its own in-store service
    This brand and model of laptop).

    Remember that you can not resolve hardware with the software.

    =====================================================

    Troubleshooting you can try:

    Note the use of Win Key + X and Win Key + W (to go on the Control Panel, Run and parameters
    According to needs). Win + D key calls the office and using Win Key active / disable the Office
    and the splash screen.

    Follow these steps to remove corruption and missing/damaged file system repair or replacement.

    Windows key + X (or right click in the lower left corner) - (Admin) command prompt

    C:\Windows\System32\ >

    At the prompt, type in SFC/scannow above
    (There is a space between C and /)

    How to run the command "SFC/scannow" at startup or in Windows 8
    http://www.eightforums.com/tutorials/3047-sfc-scannow-command-run-Windows-8-a.html

    -----

    Then run CheckDisk (chkfdsk/f/r)

    File (formerly Windows Explorer)

    Right click on drive C: - Properties - tab tools - error checking - Check

    Windows 8/8.1 - improve performance by optimizing your hard drive - see "to repair a drive:
    http://Windows.Microsoft.com/en-us/Windows-8/improve-performance-optimizing-hard-drive

    How to check a drive for errors with "chkdsk" in Windows 8/8.1
    http://www.eightforums.com/tutorials/6221-chkdsk-check-drive-errors-Windows-8-a.html

    -----------------------------------------------

    Then lets refresh the USB stack

    Control the click Control Panel - Device Manager - no matter where in the box of white/white - then the VIEW - see the
    Devices disabled - look around (with the exception of USB controllers) for your devices (can have
    zero or more than one) and top - right click UNINSTALL.

    Control Panel right CLICK on EVERYTHING - Serial USB controllers - device configuration-manager and
    UNINSTALL all but the category itself - REBOOT - it refreshes the driver and battery USB

    This KB shows XP how to and methods of Vista and Windows 7 are identical (and
    Windows 8/8.1)
    http://support.Microsoft.com/kb/310575

    This is a utility to help you, but do 1 above.

    USBDeview is a small utility that lists all USB devices currently connected to your computer.
    as well as all USB devices that you previously used. Run Options and tick three 1
    are there choices to see if any.

    http://www.NirSoft.NET/utils/usb_devices_view.html

    You must remove all instances of the devices and restart.

    ------------------------------------------------------------------------------------------------

    Install USB 3.0 and other USB devices
    http://Windows.Microsoft.com/en-us/Windows-8/install-USB-3-USB-devices

    Hardware and drivers
    http://Windows.Microsoft.com/en-us/Windows/hardware-drivers-help#hardware-drivers-help=Windows-8

    Set up your PC - configure your devices
    http://Windows.Microsoft.com/en-us/Windows-8/set-up-devices#1TC=T1

    Why Windows is not find my device?
    http://Windows.Microsoft.com/en-us/Windows-8/why-isn ' t-windows-conclusion-device

    What happens if a device is not installed correctly
    http://Windows.Microsoft.com/en-us/Windows-8/what-device-isn ' t-installed-correctly

    ===================================================

    If necessary:

    Try to do a "Refresh you PC without affecting your files" (or modification of your personal data
    settings) or even a restore.

    Windows 8/8.1 includes special discount methods (keep files and settings) or a reset
    (new installation remove all).

    How to restore, refresh or reset your PC
    http://Windows.Microsoft.com/en-us/Windows-8/restore-refresh-reset-PC

    How to create a system image to refresh your PC in Windows 8
    http://support.Microsoft.com/kb/2748351

    How to update Windows 8/8.1
    http://www.eightforums.com/tutorials/2293-refresh-Windows-8-a.html

    How to reset Windows 8/8.1
    http://www.eightforums.com/tutorials/2302-reset-Windows-8-a.html

    I hope this helps.

    Rob Brown - Microsoft MVP<- profile="" -="" windows="" expert="" -="" consumer="" :="" bicycle=""><- mark="" twain="" said="" it="">

  • How to activate bluetooth Qualcomm Atheros AR3012 on laptop Asus when "Windows could not activate the device (the function of bluetooth?

    airplance mode: off

    WiFi: connected.
    Bluetooth: off
    Ultrabook ASUS, bought on 14 April 2013
    Qualcomm-Atheros Bluetooth 4.0 AR3012 + HS
    Unable to activate the device.
    Basic troubleshooting done:
    1. reboot the PC
    2. activate and deactivate the airplance mode
    3. put updated driver
    Impossible to activate bluetooth
    error message: windows could not activate the device.
    tried steps 1-3 again me. same message showed.
    no other device is connected via USB when trying to enable bluetooth.
    known issue after removing antivirus software and install another antivirus software. but now I'm running on windows Defender.

    Hello

    Thank you for the update.

    As none of the above suggestions work, I suggest you to contact the Asus support for any future reference.

    http://support.ASUS.com/ServiceHome.aspx?SLanguage=en

    Feel free to contact us for any other questions related to Windows.

  • Someone at - he had problems with 9.2.1 and pairing Bluetooth devices?  My iPhone will not be connected or pair of devices.  Devices to recognize the iPhone 6, but the will of the iPhone 6 does not recognize the device.  Is there a problem with 9.2.1?

    Someone at - he had problems with 9.2.1 and pairing Bluetooth devices?  My iPhone will not be connected or pair of devices.  Devices to recognize the iPhone 6, but the will of the iPhone 6 does not recognize the device.  Is there a problem with 9.2.1?

    Kev2012 wrote:

    Someone at - he had problems with 9.2.1 and pairing Bluetooth devices?  My iPhone will not be connected or pair of devices.  Devices to recognize the iPhone 6, but the will of the iPhone 6 does not recognize the device.  Is there a problem with 9.2.1?

    It would depend on what you're trying to link to?

    Here are the supported Bluetooth profiles an Apple device can connect to iOS: Bluetooth profiles supported - Apple Support

  • Is there anyway that I can update all my devices. I do not use the Device Manager by clicking one at a time.

    Is there anyway that I can update all my devices. I do not use the Device Manager by clicking one at a time.

    I have windows vista 32 bit.
    -------------------------------------------------------------------------------------------------
    Re-edit:-I do not use the Device Manager to find all my drivers and by clicking on each of them... one at a time update.
    Y at - it another way to find and update the drivers at the same time and for free.

    Your question is too terse and contains too little information for anyone to
    help you.  Read this article and try again:

    http://support.Microsoft.com/kb/555375

  • my computer does not recognize the Device Manager cd/dvd/rom drive says corrupted or missing code 39

    my computer does not recognize the Device Manager cd/dvd/rom drive says corrupted or missing code 39

    Try following the steps under "Windows 7 or Windows Vista" in the MS KB article:

    http://support.Microsoft.com/kb/982116

    These measures, to remove the UpperFilters and LowerFilters, values if they exist, in the registry key named can help.

    Create a System Restore Point beforehand and restart the computer later.

  • WINDOWS MEDIA PLAYER SYNC ALWAYS SAYS "ALREADY ON THE DEVICE" WHEN HE IS NOT ON THE DEVICE.

    I went on wmp to sync mp3 files on my Creative Zen MP3, but when I try and synchronize it always already says "on the currency." But when I check my mp3 songs are not on the device. If anyone has a solution please tell me.

    Hi QALY,

    Formatting the player Creative Zen MP3 should help you solve the problem of synchronization.

    Note: Formatting the player Creative Zen MP3 will delete all the data on the MP3 player. Make sure to save your songs before formatting the MP3 player.

    After formatting the MP3 Player try to check if you can sync without any problems.

    I hope this helps. Let us know the results.

    Thank you and best regards,

     

    Srinivas R

    Microsoft technical support.

    Visit ourMicrosoft answers feedback Forum and let us know what you think.

  • When I try to view my devices to Control Panel/hardware and Sound/devices and printers, he treats forever and does not show the devices.

    When I try to view my devices to Control Panel/hardware and Sound/devices and printers.  It treats forever and does not show the devices.  I need help!


    Original title: device and Printers window
    There could be various reasons why the window devices and printers stalls. All the control points are listed here.
  • How to create images that react to the size of the browser (and not to the device)?

    How to create images that react to the size of the browser (and not to the device)?

    Hello

    Please try this widget.

    http://widgets-musethemes.BusinessCatalyst.com/tb032.html

    Concerning

    Vivek

  • my world event working on the Simulator, but not on the device

    Hi guys,.

    I'm using BB bold 9000. I have attached directly to the device and debugging. I'm getting "background switch detected for myapp (261) that does NOT have the tunnels open - defocus is NOT called" on the device debugging. but it works fine on the Simulator (my ultimate task is slaughtering an application from another application) any idea?

    Thank you

    Thank you guys, it's worked.

  • App works on the Simulator, but not on the device

    Just try to run the helloworlddemo app compiles fine and works on the Simulator without problem. All I get on the device is an icon of the application that does nothing when clicked.

    I had read this might have to do with the version of the JDE is high for the operating system on the device, but I'm running JDE 6.0.0.37 and the operating system on the device is 6.0.0.666

    I tried with my own app first, compiled, signed it and get the same result as helloworld, then its certainly some mounted sort of question but I have no idea of what

    Thank you

    Sheldon

    Thought of it - was to set the permission of application so that all 3 items were "allow."

Maybe you are looking for

  • Suggestions to reduce the sunscreen on macbook air?

    I have the luxury of working out often, but it is impossible to do under the Sun, because I can't see the content on the screen. Movies, apps or tips to solve this problem? Thank you

  • My iMac is very slow

    How can I make the system more effective and faster? I have 4 * 2 GB DDR3 1333 Mhz memory cards installed (improved 2 * 2 GB about 18 months ago). After the upgrade, the iMac has worked well, until she is considerably slowed down recently. I called A

  • Microsoft network wireless base station

    I just buy Apple I Pad from the United States and have microsoft Broadband Networking Wireless base station. I live in India, I also have the connection MTNL broadband. How to get both connected so that I can work on my I Pad?

  • Windows 7 - error Code: 80000004 (cannot install updates)

    Up to this point, I never had problems with Windows Update, but over the last week have not constantly of my updates. At the beginning, I had about ten or fifteen years updates that all has failed. All but two, updates failed with Code 800F0826, incl

  • Failed to connect

    When I try and connect to my laptop it comes up with "the user profile service service has no logon. User profile cannot be loaded" its been doing this for a few days now and I am unable to get on anything.