[rabbitmq-discuss] Android: unable to open stack traces error

Kamran muhammad.kamrana at gmail.com
Mon Feb 20 19:52:44 GMT 2012


 I hope I am not bothering you too much. Actually the following code
also gives the same error, my question is there any sample code where
java client on android is publishing?

public class ActivityHome extends Activity {
	private MessageConsumer mConsumer;
	private TextView mOutput;
    private final static String QUEUE_NAME = "hello";
    private final static String EXCHANGE_NAME = "logs";

    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        mOutput.append("Kamran");
      ConnectionFactory factory = new ConnectionFactory();
        factory.setHost("sethost");
        try{
        	mOutput.append("Sending");
        Connection connection = factory.newConnection();
        Channel channel = connection.createChannel();
        channel.queueDeclare(QUEUE_NAME, false, false, false, null);
        String message = "Kamran Android E";
        channel.basicPublish(EXCHANGE_NAME, "", null,
message.getBytes());
        System.out.println(" [x] Sent '" + message + "'");
        }
        catch (Exception e) {
			// TODO: handle exception
		e.printStackTrace();
        }
       mOutput.append("\nSent");
    }

    @Override
	protected void onResume() {
		super.onPause();
		mConsumer.connectToRabbitMQ();
	}

	@Override
	protected void onPause() {
		super.onPause();
		mConsumer.dispose();
	}
}

On Feb 20, 6:28 pm, Emile Joubert <em... at rabbitmq.com> wrote:
> Hi,
>
> On 20/02/12 16:56, Kamran wrote:
>
> > The following code gives "unable to open stack traces error"
>
> That sounds like a problem in your development environment. I don't know
> how many Android experts are on this list but you might not get a reply
> to that issue here.
>
> If your error is associated with an entry in the broker logfile, or if
> the error originates in the RabbitMQ client or broker then we'll be
> better able to help you. You should narrow down the scope of the issue
> until it is clearer where the problem lies.
>
> -Emile
> _______________________________________________
> rabbitmq-discuss mailing list
> rabbitmq-disc... at lists.rabbitmq.comhttps://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss


More information about the rabbitmq-discuss mailing list