Silly Question about Websockets and Androids - AVS Forum | Home Theater Discussions And Reviews
Forum Jump: 
 
Thread Tools
post #1 of 8 Old 10-07-2014, 04:55 PM - Thread Starter
AVS Forum Special Member
 
Somewhatlost's Avatar
 
Join Date: Jul 2006
Location: some small blue-green planet thingy...
Posts: 1,784
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Quoted: 20 Post(s)
Liked: 25
Silly Question about Websockets and Androids

ok, so I am in no way even close to ever being a web developer... I have never played one (or anything else really...) on TV...
that said, I am trying to have a little internal webpage thingy that I can go to turn a light or two on/off...
to start with I am just using this sample/demo code and it works great... from a windows device... only from windows...
but my phone is an android, it does not run windows... (being all googly and such)
so what is different between windows and android in regards to how they handle websockets and such?

NOTE: As one wise professional something once stated, I am ignorant & childish, with a mindset comparable to 9/11 troofers and wackjob conspiracy theorists. so don't take anything I say as advice...
Somewhatlost is offline  
Sponsored Links
Advertisement
 
post #2 of 8 Old 10-07-2014, 11:05 PM
AVS Forum Special Member
 
Dark_Slayer's Avatar
 
Join Date: May 2012
Posts: 3,628
Mentioned: 11 Post(s)
Tagged: 0 Thread(s)
Quoted: 722 Post(s)
Liked: 451
Should be fine if your phone is running chrome. The default ICS and before android browser wouldnt handle websockets

http://caniuse.com/#feat=websockets

Also, 8080 is getting to be a crowded default port. Flexraid and Sabnzbd both want that by default as does whatever that link you posted. Only matters if you run those services on the same local ip
Dark_Slayer is offline  
post #3 of 8 Old 10-08-2014, 01:27 PM - Thread Starter
AVS Forum Special Member
 
Somewhatlost's Avatar
 
Join Date: Jul 2006
Location: some small blue-green planet thingy...
Posts: 1,784
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Quoted: 20 Post(s)
Liked: 25
Quote:
Originally Posted by Dark_Slayer View Post
Should be fine if your phone is running chrome.
that is what I thought... but unfortunately it is not... and I have no clue why not... going to http://www.websocket.org/echo.html from the phone, everything works as it should... but my phone does not seem to ack/respond/whatever to my demo page
Quote:
Originally Posted by Dark_Slayer View Post
Also, 8080 is getting to be a crowded default port. Flexraid and Sabnzbd both want that by default as does whatever that link you posted. Only matters if you run those services on the same local ip
this is my home automation server... while I am using port 80 for something, 8080 is open and clear...

NOTE: As one wise professional something once stated, I am ignorant & childish, with a mindset comparable to 9/11 troofers and wackjob conspiracy theorists. so don't take anything I say as advice...
Somewhatlost is offline  
 
post #4 of 8 Old 10-08-2014, 01:57 PM
Senior Member
 
NNate's Avatar
 
Join Date: Nov 2006
Location: Minneapolis, MN
Posts: 357
Mentioned: 1 Post(s)
Tagged: 0 Thread(s)
Quoted: 57 Post(s)
Liked: 28
FYI - This seems like a better question to put on StackOverflow. I'd help if I could here, but I know nothing about WebSockets.
NNate is offline  
post #5 of 8 Old 10-09-2014, 12:47 PM
AVS Forum Addicted Member
 
Foxbat121's Avatar
 
Join Date: Jul 2003
Location: VA
Posts: 11,413
Mentioned: 7 Post(s)
Tagged: 0 Thread(s)
Quoted: 698 Post(s)
Liked: 416
Sounds like you simply have a networking confusing if your phone actually works fine running the above echo test.

If your phone is connected to your local wifi network, you need to use the local IP address of your web server to test it, not the machine name (because your phone most likely can't resolve the name). If your phone is using cell network instead of wifi, you will need to create a port forwarding on your router and use your external IP (from your ISP) to connect and pray that your ISP doesn't block port 8080 (most ISPs will block common server port like port 80).
Foxbat121 is online now  
post #6 of 8 Old 10-10-2014, 09:17 AM - Thread Starter
AVS Forum Special Member
 
Somewhatlost's Avatar
 
Join Date: Jul 2006
Location: some small blue-green planet thingy...
Posts: 1,784
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Quoted: 20 Post(s)
Liked: 25
I have tried using both internal and external networks, using IP address and name on internal, and it works great from any windows device, and not so good on the android. fwiw, I do see the website/graphics on both. it is just when I press the light bulp picture on the android nothing happens, press (on my win8 tablet) (or click on my PC win7 PC) the light both on the web page and the actual light, change states (ie On to Off or Off to On) so it seems everything, except for the actual control from an android device, works fine... just why wont the android cause a change of states?

this shouldn't be so hard...
according to the websocket test page says websockets work...
the html web page code isn't at all fancy
the little bit of java code from the demo does not seem all that special either...
I am confused...
it seems like it should work, but it just doesn't?

edit: why is AVS now reformatting my post and taking out all the line feeds and making it one big impossible to read jumble?????? has AVS banned LF's now? what next a ban on CR's?

edit2: seems AVS does not like being NOSCRIPT'ed... temp allowed AVS now I can stick CR/LC in and they seem to 'stick'

NOTE: As one wise professional something once stated, I am ignorant & childish, with a mindset comparable to 9/11 troofers and wackjob conspiracy theorists. so don't take anything I say as advice...

Last edited by Somewhatlost; 10-10-2014 at 09:23 AM.
Somewhatlost is offline  
post #7 of 8 Old 10-10-2014, 10:10 AM
AVS Forum Addicted Member
 
Foxbat121's Avatar
 
Join Date: Jul 2003
Location: VA
Posts: 11,413
Mentioned: 7 Post(s)
Tagged: 0 Thread(s)
Quoted: 698 Post(s)
Liked: 416
The demo code relies on javascript, not Java, code to call the websockets, as most web pages will. If you disabled scripting on your phone's browser (as you indicated you likely do on the above post) as well, it will not work. Internet without scripting will be a very boring place.
Foxbat121 is online now  
post #8 of 8 Old 10-10-2014, 10:29 AM - Thread Starter
AVS Forum Special Member
 
Somewhatlost's Avatar
 
Join Date: Jul 2006
Location: some small blue-green planet thingy...
Posts: 1,784
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Quoted: 20 Post(s)
Liked: 25
Quote:
Originally Posted by Foxbat121 View Post
The demo code relies on javascript, not Java, code to call the websockets, as most web pages will. If you disabled scripting on your phone's browser (as you indicated you likely do on the above post) as well, it will not work. Internet without scripting will be a very boring place.
as far as I know, I have not installed noscript on my phone, pretty much only go to forums on PC's...

NOTE: As one wise professional something once stated, I am ignorant & childish, with a mindset comparable to 9/11 troofers and wackjob conspiracy theorists. so don't take anything I say as advice...
Somewhatlost is offline  
Sponsored Links
Advertisement
 
Reply Home Theater Computers

Thread Tools
Show Printable Version Show Printable Version
Email this Page Email this Page


Forum Jump: 

Posting Rules  
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off