• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

where to set data received from wifi hotspot server

 
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello JavaRanch,

Here Scenario is I'm able to establish communication with WiFi Hotspot server with my android client application,if I'm sending data to server it's getting received by server,
But server sent data not showing inside the text(txtrecv)I've tried to set received data from server inside the method onProgressUpdate()

Here is the code what I'm have tried,


1.


2.


3.xml file

Please give some idea or correct me ,Thanks in Advance.
ScreenTest.PNG
[Thumbnail for ScreenTest.PNG]
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Make sure you're not running into this problem: Don't println to a Socket (no, it's not Mac-specific). Using println and readLine would trigger it.
 
NeelNisha Singh
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Ulf,
Thanks for your reply,I'm not getting what exactly I need to do,I'm new to android technology,

Problem is server sent data or message i'm getting into
in = new BufferedReader(new InputStreamReader(socket.getInputStream()));



Have tried to set received data like this


@Override
protected void onProgressUpdate(String... values) {
super.onProgressUpdate(values);

StringBuilder sb = new StringBuilder();

for (int i = 0; i < values.length; i++) {
sb.append(values[i]);

}

txtRecMsg.setText(sb);
sb = null;
}

But txtRecMsg is still blank
Please Help
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
A sufficient solution would be not to use Readers and Writers with sockets.

There could be other problems, though - I have not looked through the entire code.
 
NeelNisha Singh
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the reply

I have tried if I'm saving content in some text file and then if sending to android application client app,then it received content/data and shows also in txtRecv,
But,why not in normal case its showing data
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In that case, start by investigating what is different between both scenarios.
 
NeelNisha Singh
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have tried alot from yesterday and thought may be data was not trim so used

but still while receiving at android client inside onprogressupdate method not getting data inside txtRecv



Please help


 
Get out of my mind! Look! A tiny ad!
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic