Click here to Skip to main content
13,043,491 members (52,670 online)
Rate this:
Please Sign up or sign in to vote.
I am building an application that controls a computer through an Android device till now I have finished the computer Java side and i have finished most of the android code that receives the image stream in ImageView .
So i made EnumCommands as following :
public enum EnumCommands {
    private int abbrev;
    EnumCommands(int abbrev){
        this.abbrev = abbrev;
    public int getAbbrev(){
        return abbrev;

then in the main activity i tried to make the touch listeners to the ImageView
as MotionEvent.ACTION_DOWN , MotionEvent.ACTION_MOVE ,
case MotionEvent.ACTION_MOVE:
				int x_cord = (int) event.getRawX();
				int y_cord = (int) event.getRawY();
				if (x_cord > windowwidth) {
					x_cord = windowwidth;
				if (y_cord > windowheight) {
					y_cord = windowheight;
				layoutParams.leftMargin = x_cord - 25;
				layoutParams.topMargin = y_cord - 75;

So what i need is code for all the touch and motion events and the EnumCommands for my this project.
I really tried hard for searching the answer and failed
thanks in advance.
Posted 21-Apr-13 11:48am

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170713.1 | Last Updated 21 Apr 2013
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100