• 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
  • Ron McLeod
  • Tim Cooke
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Jeanne Boyarsky
Saloon Keepers:
  • Stephan van Hulst
  • Carey Brown
  • Tim Holloway
  • Piet Souris
Bartenders:

WebView not displaying some components of the site

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm trying to build an Android app that controls music with WebView, the music controls in the site doesn't show correctly.
http://i.imgur.com/l4wH8R1.png
 this is how it looks like in a normal web browser http://i.imgur.com/6B8xRec.png and this is how it looks like in my app, the album art, track position etc does not show correctly
Is there anything I need to add in Android Studio to make this work?
 
Bartender
Posts: 7488
171
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
A few questions:

1) is there anything in the logcat related to this?

2) what is the HTML for the page, particularly the problematic part?

3) what Android version is this? WebView got an update in 4.4
 
Yu-Quan Lim
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for replying.  
1. As far as I'm concern, I don't think there is anything related (I may be wrong, still pretty new to this)  
2. I'm not getting what you meant (sorry still noob), it's a site served from a raspberry pi to control my stored music by using the Pi's IP. (the program is called Mopidy)  
3. I've read about this, I'm running 6.0, nothing I know that will affect this  

I appreciate your help a lot, if you need me to attach my code please let me know, thanks again!
 
Tim Moores
Bartender
Posts: 7488
171
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

1. As far as I'm concern, I don't think there is anything related (I may be wrong, still pretty new to this)  


Post everything from before the page starts to load until it is done loading.

2. I'm not getting what you meant (sorry still noob), it's a site served from a raspberry pi to control my stored music by using the Pi's IP. (the program is called Mopidy)


I meant the HTML source code of the page in question, to see what it is trying to render that the standard browser can display, but the WebView can't. That part may use JavaScript - make sure that's enabled in the WebView, because by default JavaScript is turned off.
 
Yu-Quan Lim
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for your help, I hope I attached the right stuff (lol), this is the first time I'm dealing with Android Studio

10-18 00:59:50.245 3291-3291/com.taruc.web W/BindingManager: Cannot call determinedVisibility() - never saw a connection for the pid: 3291
10-18 00:59:50.270 3291-3291/com.taruc.web I/chromium: [INFO:CONSOLE(5)] "The key "shrink-to-fit" is not recognized and ignored.", source: http://192.168.0.40:6680/moped/ (5)
10-18 00:59:51.958 3291-3291/com.taruc.web I/chromium: [INFO:CONSOLE(14)] "TypeError: Cannot read property 'stations' of null
                                                          at c (http://192.168.0.40:6680/moped/assets/moped-0.6.4.js:19:30827)
                                                          at Object.getRadioStations (http://192.168.0.40:6680/moped/assets/moped-0.6.4.js:19:31048)
                                                          at new <anonymous> (http://192.168.0.40:6680/moped/assets/moped-0.6.4.js:19:31996)
                                                          at Object.e [as invoke] (http://192.168.0.40:6680/moped/assets/moped-0.6.4.js:13:8512)
                                                          at l.instance (http://192.168.0.40:6680/moped/assets/moped-0.6.4.js:13:30635)
                                                          at q (http://192.168.0.40:6680/moped/assets/moped-0.6.4.js:13:20214)
                                                          at h (http://192.168.0.40:6680/moped/assets/moped-0.6.4.js:13:16673)
                                                          at http://192.168.0.40:6680/moped/assets/moped-0.6.4.js:13:16114
                                                          at link (http://192.168.0.40:6680/moped/assets/moped-0.6.4.js:16:28262)
                                                          at eb (http://192.168.0.40:6680/moped/assets/moped-0.6.4.js:13:26582)", source: http://192.168.0.40:6680/moped/assets/moped-0.6.4.js (14)
10-18 00:59:52.063 3291-3291/com.taruc.web I/chromium: [INFO:CONSOLE(14)] "TypeError: Cannot read property 'getObject' of null
                                                          at new LastFMCache (http://192.168.0.40:6680/moped/assets/moped-0.6.4.js:8:104)
                                                          at Object.<anonymous> (http://192.168.0.40:6680/moped/assets/moped-0.6.4.js:20:3211)
                                                          at Object.e [as invoke] (http://192.168.0.40:6680/moped/assets/moped-0.6.4.js:13:8512)
                                                          at Object.$get (http://192.168.0.40:6680/moped/assets/moped-0.6.4.js:13:6902)
                                                          at Object.e [as invoke] (http://192.168.0.40:6680/moped/assets/moped-0.6.4.js:13:8512)
                                                          at http://192.168.0.40:6680/moped/assets/moped-0.6.4.js:13:9089
                                                          at d (http://192.168.0.40:6680/moped/assets/moped-0.6.4.js:13:8142)
                                                          at Object.e [as invoke] (http://192.168.0.40:6680/moped/assets/moped-0.6.4.js:13:8479)
                                                          at l.instance (http://192.168.0.40:6680/moped/assets/moped-0.6.4.js:13:30635)
                                                          at q (http://192.168.0.40:6680/moped/assets/moped-0.6.4.js:13:20214)", source: http://192.168.0.40:6680/moped/assets/moped-0.6.4.js (14)
10-18 00:59:52.313 3291-3291/com.taruc.web W/BindingManager: Cannot call determinedVisibility() - never saw a connection for the pid: 3291
10-18 01:00:01.029 1552-1580/system_process I/ActivityManager: Start proc 5527:com.android.deskclock/u0a24 for broadcast com.android.deskclock/com.android.alarmclock.DigitalAppWidgetProvider
10-18 01:00:01.135 5527-5527/com.android.deskclock W/System: ClassLoader referenced unknown path: /system/app/DeskClock/lib/x86
 
Tim Moores
Bartender
Posts: 7488
171
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
So there is indeed Javascript involved; have you enabled that in your code?
 
Yu-Quan Lim
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Tim Moores wrote:So there is indeed Javascript involved; have you enabled that in your code?

 
All I need to do is adding this line right?  
myWebView.getSettings().setJavaScriptEnabled(true);  
I've added it since the beginning, it didn't help, without this line the page won't load at all.
 
This tiny ad is suggesting that maybe she should go play in traffic.
The Low Tech Laboratory Movie Kickstarter is LIVE NOW!
https://www.kickstarter.com/projects/paulwheaton/low-tech
reply
    Bookmark Topic Watch Topic
  • New Topic