Monday 30 January 2012

How cursor moves in your mobile screen .

Hello friends these days i am working or dealing with mobile application development , so i found something typical but it is very easy , now first why it is typical , because when for this i read some articles but if i say a term that google has nothing for J2ME so you have to create your own things .

when i found this article "http://www.java-samples.com/showtutorial.php?tutorialid=727" i am happy that some one is in net who can help developers , thanks to JAVA-SAMPLES , but i am not satisfied with their example , if you are a developer and you need something special than scratch your itch and seriously after scratching you will found that you have something different .

lets have a look of ma code ,  


now we have handleAction( ) , in our code  and now main task is started  , means thats what i want to explain

now here is something interesting , interesting in terms means x and y variables these two variables are used for increasing mouse speed now how x and y variables are used for increasing cursor speed .

now what is the use of drawline ( ) , see draw line is used for drawing the cursor , now drawing means every time you press your key for moving cursor and for this we are using x and y variables and after setting your next postion using x and y we are drawing image or cursor at that place .

now other two variables x_axis and y_axis . i have used these two variables in selecting some icon , means i have displayed a image in , and with the help of x_axis and y_axis variable i can easily select any portion of ma mobile with the cursor .



No comments: