关于android获取非本应用触摸坐标

我想实现如图功能:在一个悬浮窗(已实现)上显示用户在任意软件(界面)点击的坐标
问题如下:
在何处重写onTouchEvent,若是activity,应该无法获取别的应用点
击事件,若是service,应该添加一个怎样的view获取
或者别的获取方法
设想:
在一个充满屏幕的透明悬浮窗(在所有应用最顶)可以正常获取坐标,但屏蔽了原应用(界面)的事件,无法正常操作图片

getevent 触屏事件的获取 :http://download.csdn.net/detail/ryan_lyo/4550312,这是 CSDN 的一个链接,不过下载是城要3个下载积分的。
方法,是通过 getevent,你可以再查找一下它的用法。

摸事件顾名思义就是触摸手机屏幕触发的事件,当用户触摸添加了触摸事件的View时,就是执行OnTouch()方法进行处理,下面通过一个动态获取坐标的例子来学习OnTouchListener事件,效果如下:

main.xml:

[html] view plaincopy
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"

xmlns:tools="http://schemas.android.com/tools"

android:id="@+id/LinearLayout1"

android:layout_width="match_parent"

android:layout_height="match_parent"

android:orientation="vertical">

<</span>TextView  
    android:id="@+id/show"  
    android:layout_width="fill_parent"  
    android:layout_height="wrap_content"  
    android:textColor="#ff00ff"  
    android:textSize="20sp"  
    android:text="实时显示坐标" />  

</LinearLayout>

MainActivity.java:

[java] view plaincopy
package com.example.onkeylistenerdemo;

import android.app.Activity;

import android.os.Bundle;

import android.util.EventLog.Event;

import android.view.MotionEvent;

import android.view.View;

import android.widget.LinearLayout;

import android.widget.TextView;

public class MainActivity extends Activity {

private TextView show = null;  
private LinearLayout linearLayout = null;  
@Override  
protected void onCreate(Bundle savedInstanceState) {  
    super.onCreate(savedInstanceState);  
    setContentView(R.layout.activity_main);  
    initView();  
}  

private void initView(){  
    show = (TextView)super.findViewById(R.id.show);  
    linearLayout = (LinearLayout)super.findViewById(R.id.LinearLayout1);  
    linearLayout.setOnTouchListener(new View.OnTouchListener() {  

        @Override  
        public boolean onTouch(View v, MotionEvent event) {  
            // TODO Auto-generated method stub  
            switch(event.getAction()){  
            case MotionEvent.ACTION_DOWN:  
                System.out.println("---action down-----");  
                show.setText("起始位置为:"+"("+event.getX()+" , "+event.getY()+")");  
                break;  
            case MotionEvent.ACTION_MOVE:  
                System.out.println("---action move-----");  
                show.setText("移动中坐标为:"+"("+event.getX()+" , "+event.getY()+")");  
                break;  
            case MotionEvent.ACTION_UP:  
                System.out.println("---action up-----");  
                show.setText("最后位置为:"+"("+event.getX()+" , "+event.getY()+")");  
            }  
            return true;  
        }  
    });  
}  

}