Android与Aftek AMF。为什么即使我编译代码没有错误并且应用程序加载正常,我的服务器也没有得到任何响应?

时间:2012-10-04 21:14:14

标签: android amf

我已经按照Aftek示例和应用加载,我输入一个名称和密码点击按钮发送,但得不到任何回报。没有任何错误或任何事情可以继续,我为此前对此主题缺乏了解而道歉。如果有人对Aftek的AMF库有任何经验,我会非常感谢您的意见。

package com.ryan.etrak2;

import com.al.amf.channels.AMFChannel;
import com.al.amf.events.ErrorEvent;
import com.al.amf.events.ResultEvent;
import com.al.amf.remoting.RemoteListener;
import com.al.amf.remoting.RemoteObject;
import flex.messaging.io.ArrayCollection;
import android.os.Bundle;
import android.app.Activity;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;


public class MainActivity extends Activity 
implements OnClickListener, RemoteListener 
{
public ArrayCollection resultarr;

public void onCreate(Bundle savedInstanceState) 
{
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Button button = (Button) findViewById(R.id.button1);
button.setOnClickListener(this);
}

public void onClick(View v) 
{
System.out.println(" button clicked");
EditText username=(EditText) findViewById(R.id.editText1);
EditText password=(EditText) findViewById(R.id.editText2);

try
{
AMFChannel channel = new AMFChannel("http://192.168.0.109/8084/default/servlet/AMFgateway", this);
    RemoteObject remoteObject = channel.getRemoteObject("messageBO");

    remoteObject.addRemoteListener(this);
    Object[] params = new Object[]{};
            RemoteObject client = null;
    client.call("login", params);
}
catch(Exception e)
{
    e.printStackTrace();
}
}

// Invoked on successful remote procedure call.
public void onResult(ResultEvent resultEvent)
{
System.out.println("success:" + resultEvent.getData());
}

// Invoked on remote procedure call failure.   
public void onError(ErrorEvent errorEvent)
{
System.out.println("Error occured:" + errorEvent.getData());
}
}

0 个答案:

没有答案