×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Nov 2009
    Posts
    47

    Vibrate and Gauge problems - 6212

    Hi all,

    I looked up the function to make the phone vibrate. The code compiles and runs as expected on the emulator but does not function AT ALL on the physical phone. Here is the code used:

    Code:
    public void targetDetected(TargetProperties[] targetProperties)
    	{
    		//no targets found
    		if(targetProperties.length == 0)
    		{
                        welcomePage.append("No data stored.");
    			return;	//exit method as nothing found.
    		}
                    else
                    {
                        Thread thread = new Thread();
                        thread.start();
                    Display.getDisplay(this).vibrate(1000);
    I thought the issue might have been a concurrency problem so I created a new thread as you can see in the code above, still no success on the physical device.

    I also created a gauge to use as a progress bar. Once again it works as expected on the emulator but the bar only gets updated when all the data has been retrieved, which makes the loading screen obsolete. Similar issue to my vibrate problem, I thought creating a new thread may solve the problem but it didn't, everything is fine on the emulator but the physical phone is refusing to work as expected.

    Why am I having these issues with the physical device when the emulator works as expected? To clarify, I'm using NetBeans v 6.8 IDE and the Nokia 6212 NFC emulator and transferring the .jar onto the physical 6212 via Nokia PC Suite v 7.1.40.6.

    Thanks all.

  2. #2
    Super Contributor
    Join Date
    Mar 2008
    Location
    The Capital of INDIA
    Posts
    4,328

    Re: Vibrate and Gauge problems - 6212

    If this will go inside the else part then first the run() will execute and I have no idea that what are you doing inside the run().

    Why dont you just make a command like vibrate and in command action write this line
    Display.getDisplay(this).vibrate(800);
    You can make your phone migrate in J2ME by calling vibrate(int duration) method of javax.microedition.lcdui.Display class. The duration parameter is the number of milliseconds the vibrator should be run.

    Display.getDisplay(this).vibrate(800);

    Please do not start the similar threads
    http://discussion.forum.nokia.com/fo...d.php?t=198491
    Thanks with Regards,

    R a j - The K e r n e l


    Join Delhi-NCR Nokia Developer's Community,

  3. #3
    Nokia Developer Champion
    Join Date
    Feb 2009
    Location
    Noida, India
    Posts
    3,085

    Re: Vibrate and Gauge problems - 6212

    I also created a gauge to use as a progress bar. Once again it works as expected on the emulator but the bar only gets updated when all the data has been retrieved, which makes the loading screen obsolete.
    In the network layer, where you are actually read data in chuncks, you should update the UI gauge from only after to every chunck from the server. {Cut paste the code you use to retrive data from server & upadte the gague.}

    thanks,
    ~Amitabh

Posting Permissions

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