On Aug 30, 2012, at 9:41 PM, balivo <[email protected]> wrote:
> Hi! I need use a Bluetooth Printer (DATECS DPP-250). But, I'm having a 
> serious problems...
...
> And don't work. Some helpe? 

Can you elaborate on "doesn't work"? Do you get any error messages/exception 
stack traces in the Android Debug Log?

        http://docs.xamarin.com/android/advanced_topics/android_debug_log

That said, this looks mighty suspicious:

> RunOnUiThread(delegate  { 
>       IAsyncResult xpto = s.OutputStream.BeginWrite(buffer, 0, buffer.Length, 
> new AsyncCallback(delegate { }), State.On); 
>       s.Close(); 
> });


Won't that possibly result in Close()ing your BluetoothSocket instance before 
you finish Write()ing your message? You might want to make that synchronous.

Also, I suspect that you don't need to perform the 
BluetoothSocket.OutputStream.Write() call from the UI thread; in general, 
Android doesn't like you performing file/network operations from the UI thread:

        
http://developer.android.com/reference/android/os/NetworkOnMainThreadException.html
        http://developer.android.com/guide/practices/responsiveness.html

Thanks,
 - Jon

_______________________________________________
Monodroid mailing list
[email protected]

UNSUBSCRIBE INFORMATION:
http://lists.ximian.com/mailman/listinfo/monodroid

Reply via email to