我想在SIP和Android上工作.我应该让两个用户可以使用iptel.org互相呼叫.一种方法,我可以使用2.3提供的演示,但它需要一个真正的设备.由于我没有真正的设备,我不想在2.1平台上工作.我是初学者,所以我需要一个良好的步骤才能开始,这样我就可以很容易地完成它.
我使用以下类(android中的简单2D图形)在视图上创建了两个位图,并徘徊以实现该位图可以独立移动。我正在为此调用motionevent方法。
当前问题,我不明白为什么下面的代码中只有一个对象向右移动。例如,使用此代码,仅“非”位图被移动,我希望两个位图彼此独立地移动。
scenrio:我可以用我的两个手指,每个对象一个,独立移动位图。但我不知道如何实现这一目标。
public class TouchView extends View {
private Drawable cross;
private Rect crossBounds = null;
private Drawable not;
private Rect notBounds = null;
private int x1, y1, x2, y2 ;
boolean flag = true;
private void intialize ()
{
int w1 = cross.getIntrinsicWidth();
int h1 = cross.getIntrinsicHeight();
x1 = 100;
y1 = 100;
crossBounds = new Rect(x1-w1/2, y1-w1/2, x1+w1/2, y1+h1/2);
int w = not.getIntrinsicWidth();
int h = not.getIntrinsicHeight();
x2 = 300;
y2 = 300;
notBounds = new Rect(x2-w/2, …Run Code Online (Sandbox Code Playgroud)