[android-developers] Re: question on reading from socket in android ...
Hi Marc, Thanks for your prompt response. Here is the code that I have: InetAddress addr = InetAddress.getByAddress(hostIp); socket = new Socket(addr, portNumber); socket.setKeepAlive(true); DataInputStream dis = new DataInputStream(new BufferedInputStream (socket.getInputStream())); DataOutputStream dos = new DataOutputStream(new BufferedOutputStream(socket.getOutputStream())); byte[] intBytes = convertToBytes(data.length); byte[] strMsgLengthBytes = convertToBytes(strMsgSize); dos.write(intBytes, 0, intBytes.length); dos.write(strMsgLengthBytes, 0, strMsgLengthBytes.length); dos.write(data, 0, data.length); dos.flush(); ObjectInputStream ois = new ObjectInputStream(dis); // Here is the place where an EOFException is being thrown List> returnObject = (List>) ois.readObject(); In the above code, the line "ois = new ObjectInputStream(dis);" is the place where an EOFException is being thrown. In my server, I have checked that it has received the data successfully. By the time the server tries to write to the socket, the server is getting the following exception when it tries to get an OutputStream from the socket: java.net.SocketException: Socket is closed at java.net.Socket.getOutputStream(Socket.java:814) I would appreciate any advice. Regards, Antonio. On Jan 18, 3:15 am, Marc Reichelt wrote: > Hi Antonio, > > it would be much easier if you would provide a small piece of example > code. Otherwise we can only guess what your problem is. > > Regards > > Marc Reichelt || http://www.marcreichelt.de/ > > On 18 Jan., 09:16, Antonio Si wrote:> Hi, > > > I have a background thread in my android client which sends a request > > to a server using a > > socket and then tries to read the data back from the socket. > > > The data sending part works fine, but when I try to read from the > > inputStream of the socket, > > I am getting a EOFException. > > > Any suggestions or advice would be highly appreciated. > > > Thanks very much. > > > Antonio. -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] question on reading from socket in android ...
Hi, I have a background thread in my android client which sends a request to a server using a socket and then tries to read the data back from the socket. The data sending part works fine, but when I try to read from the inputStream of the socket, I am getting a EOFException. Any suggestions or advice would be highly appreciated. Thanks very much. Antonio. -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] adb cannot find my dev phone
Hi, I just got my android dev phone, but when I invoke "adb devices", it only shows: List of devices attached no permissions What does it mean? What is the problem and how should I fix it? Would appreciate any input. Thanks. Antonio. -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: how to update the dev phone to 2.0?
Thanks. Any idea when will it be available? Also, what is the version of android that comes with the dev phone? Thanks very much for your help. Antonio. On Nov 13, 9:10 pm, Romain Guy wrote: > 2.0 is not available for ADP1 at this time. > > On Fri, Nov 13, 2009 at 9:08 PM, Antonio Si wrote: > > Hi, > > > Is Android 2.0 supported on the dev phone? I do not see any image > > packages available for 2.0 inhttp://developer.htc.com/adp.html? > > > Thanks very much. > > > Antonio. > > > -- > > You received this message because you are subscribed to the Google > > Groups "Android Developers" group. > > To post to this group, send email to android-developers@googlegroups.com > > To unsubscribe from this group, send email to > > android-developers+unsubscr...@googlegroups.com > > For more options, visit this group at > >http://groups.google.com/group/android-developers?hl=en > > -- > Romain Guy > Android framework engineer > romain...@android.com > > Note: please don't send private questions to me, as I don't have time > to provide private support. All such questions should be posted on > public forums, where I and others can see and answer them -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] how to update the dev phone to 2.0?
Hi, Is Android 2.0 supported on the dev phone? I do not see any image packages available for 2.0 in http://developer.htc.com/adp.html ? Thanks very much. Antonio. -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: intercept SMS inbound message
I am having a similar problem and would appreciate any pointers in this problem. Thanks. Antonio. On Nov 11, 4:44 pm, Sean Liao wrote: > Hi, > I got a sample code how to intercept SMS inbound message. It is > really simple, and I really admire android make it so easy: > > // declare the intercepter > > > > "android.provider.Telephony.SMS_RECEIVED" /> > > > > public class SmsReceiver extends BroadcastReceiver > { > @Override > public void onReceive(Context context, Intent intent) > { > } > > } > > However, there is a problem. The message also shows in the system > inbox. Is there a way really to intercept it (not let the system > receive it)? Or is there any API I can remove it from system inbox as > soon as I read it from my program? > > Thanks in advance. > Sean -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] question on WAP Push support on Android
Hi, I have search through the group and does not seem to find a solution to this problem. I have setup a WAP Push gateway. How can I setup my Android phone to connect to the gateway? Or does WAP Push support in Android? Or what would be a best way to send data from a server to a Android device? Any pointers will be highly appreciated. Thanks in advance. Antonio. -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] question on Android dev phone
Hi, I am new to Android development, so perhaps this is a stupid question. I understand the Android dev phone cannot download apps from the Marketplace if the app is copy protected? Is there any way around this limitation? But I suppose other Google apps like the barcode scanner (http:// googlemobile.blogspot.com/2009/05/google-product-search-for-android- now.html) should work, right? Antonio. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---