10-07-2011 10:23 AM
Hello happyfull of beauty world !
There are some times ago, i did post a subject like "Push, but Pull ?"
It was difficult for me to retrieve the informations in the doc, and i did a mistake between the stream of data and a method relative to a byte array used for the answer of the device. So, i was very confused !!!!
The answer is so easy (well, i trust, but i didn't try for now) :
You can find in documentation a method
this.connect = (HttpURLConnection) this.pushUrl.openConnection();
after come some properties of your choice for the connection, and :
this.fluxOut = this.connect.getOutputStream(); DataOutputStream fluxDonneesOut = new DataOutputStream (this.fluxOut); this.fluxDonneesOut.write(); /* for an int this.fluxDonneesOut.writeUTF() /* for a String
So what is more simple to receive data that :
this.fluxIn = this.connect.getInputStream(); DataInputStream fluxDonneesIn = new DataInputStream (this.fluxIn); this.fluxDonneesIn.read(); this.fluxDonneesIn.readUTF();
So client side :
socket = (StreamConnectionNotifier) Connector.open(URL + "deviceside=false"); fluxEntree = fluxConnection.openDataInputStream(); fluxSortie = fluxConnection.openDataOutputStream();
You **bleep** !! i didn't see so simple solution !!!
Hope it can help anybody so srupid than me