1

我遵循了 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());
}
}
4

0 回答 0