>
how to get trackball movement in blackberry
Welcome, Guest

by aniket on Thursday, 09 April 2009
how to get trackball movement in blackberry


import net.rim.device.api.system.Bitmap;
import net.rim.device.api.system.Display;
import net.rim.device.api.ui.Color;
import net.rim.device.api.ui.Graphics;
import net.rim.device.api.ui.Trackball;
import net.rim.device.api.ui.component.Dialog;
import net.rim.device.api.ui.container.MainScreen;


public class Navigationmovement extends MainScreen {
    
    int width = Display.getWidth();
    int height = Display.getHeight();
    int z=0,w=0;


    /*initialize an image to img*/
   Bitmap img = Bitmap.getBitmapResource("friend.png");
    
   

    public void paint(Graphics g)
    {
        g.drawBitmap(z, w, img.getWidth(), img.getHeight(), img, 0, 0);
    }


    /*This method Checks for the track ball click*/


    protected boolean navigationClick(int status, int time) {
        
        Dialog.alert("coordinates= "+z+"     "+w);
        System.out.println(" coordinates= "+z+"            "+w);
        invalidate();        
        return true;
    }
   

/*This method counts the track ball movement dx,dy(movement right & down are positive,left & up are negative */ 

     protected boolean navigationMovement(int dx,int dy,int status,int time){

         z=z+dx;
         w=w+dy;
         if(z<0)z=0;
         if(z>width)z=width;        
       if(w<0)w=0;
         if(w>height)w=height;
        return true;
         
     }
}



Blogger Image
My Blog Title

Product Engineering, software engineering company, Product Development, Product Migration, Product Re-engineering, Product Maintenance, Product Testing Commercial Application Development, Business Software development, commercial software for startups, Application Support and Maintenance, software testing Product Maintenance, Outsource product maintenance, product support and maintenance Product Migration, Product Re-engineering, product re-engineering services Product Research, Product Engineering, UI Prototyping Services Software Testing Services, Quality Assurance services, professional software testers, Load Testing, Functional Testing, Cross Platform, Browser Testing, Test Automation, Testing Tools, software quality analysis Functional Testing Services, software quality analysis, Software Testing Services, Application Testing Services, Functional Testing Types Automated Testing, Automated Testing Services, automation testing, test script development, Automation Test Tools, outsource automation testing Load Testing, Performance Testing Services, Load Testing Tools Offshore Software Development, Outsource software services, offshore outsourcing services, offshore software development services, IT outsourcing services, software quality assurance services, Offshore IT services, Custom Application Development Services, Offshore Product Engineering Benefits of IT Outsourcing, Offshore Software Development companies, offshore software development firms Outsource planning, IT outsourcing, IT development services, offshore IT companies, offshore software development Offshore Software Development, Outsource software services, offshore outsourcing services, offshore software development services, IT outsourcing services, software quality assurance services, Offshore IT services, Custom Application Development Services, Offshore Product Engineering Offshore Software Development, Outsource software services, offshore outsourcing services, offshore software development services, IT outsourcing services, software quality assurance services, Offshore IT services, Custom Application Development Services, Offshore Product Engineering