Discussion Forums  >  Plugins, Customizing, Source Code

Replies: 18    Views: 118

Cyrus_8888
I hate code!
Profile
Posts: 151
Reg: Dec 24, 2011
Sydney
1,610
01/07/13 04:47 AM (11 years ago)

custom url freeze on android

I attempted to load custom url with jquery embedded on my android device and emulator. It seems the custom url plugin freezes with spinning circle continuously keeps loading and never ends. I did uncomment showProgress(null, null); on line 128 in BT_screen_customURL.java. But still with no luck. Does anyone here have the similar problem? Testing platform: BT self-hosted 2.17 Kind Regards Cyrus
 
Paul Rogers
Android Fan
Profile
Posts: 2524
Reg: May 30, 2011
UK
35,740
like
01/07/13 05:51 AM (11 years ago)
Does the url load ok in a regular browser and a device browser?
 
Cyrus_8888
I hate code!
Profile
Posts: 151
Reg: Dec 24, 2011
Sydney
1,610
like
01/07/13 05:57 AM (11 years ago)
Hi Raveyd, Yes it does, it loads ok on regular browser and android device browser. It also works fine on iOS. Cheers Cyrus
 
Paul Rogers
Android Fan
Profile
Posts: 2524
Reg: May 30, 2011
UK
35,740
like
01/07/13 05:59 AM (11 years ago)
Do you have javascript enabled in the webView settings? Around line 114 of the customURL.java file: webView = (WebView) thisScreensView.findViewById(R.id.webView); webView.setBackgroundColor(0); webView.setInitialScale(0); webView.getSettings().setJavaScriptEnabled(true); webView.getSettings().setSupportZoom(true); webView.getSettings().setBuiltInZoomControls(true); webView.getSettings().setPluginsEnabled(true); webView.getSettings().setPluginState(WebSettings.PluginState.ON); webView.getSettings().setAllowFileAccess(true); webView.setPictureListener(new MyPictureListener()); webView.setWebViewClient(new WebViewClient(){
 
Cyrus_8888
I hate code!
Profile
Posts: 151
Reg: Dec 24, 2011
Sydney
1,610
like
01/07/13 06:54 AM (11 years ago)
Hi Raveyd, The default Javascript enabled was set to true. Does it need to be change? Running some errors: WebSettings cannot be resolved to a variable. Any ideas? http://dl.dropbox.com/u/20163884/customURL.jpg Cheers Cyrus
 
Paul Rogers
Android Fan
Profile
Posts: 2524
Reg: May 30, 2011
UK
35,740
like
01/07/13 07:02 AM (11 years ago)
Set to true is correct. That error, hover over the error and there should be a fix to add an import, just add the import and it'll be fine after a project > clean.
 
Paul Rogers
Android Fan
Profile
Posts: 2524
Reg: May 30, 2011
UK
35,740
like
01/07/13 07:04 AM (11 years ago)
or just add: import android.webkit.WebSettings; to the imports
 
Cyrus_8888
I hate code!
Profile
Posts: 151
Reg: Dec 24, 2011
Sydney
1,610
like
01/07/13 07:32 AM (11 years ago)
Thanks so much Raveyd, but I couldn't find an import option for this. Kind Regards Cyrus http://dl.dropbox.com/u/20163884/customURL2.jpg
 
Paul Rogers
Android Fan
Profile
Posts: 2524
Reg: May 30, 2011
UK
35,740
like
01/07/13 07:38 AM (11 years ago)
Strange. Ok then, just paste the import that I posted above with all the other imports at the top of the file. Not saying this will work of course! Do you have any logcat output or anything in the problems pane, or is it even just a dodgy internet connection? JQuery should be fine with bt, I use it a lot with no (well, hardly any..) problems.
 
Cyrus_8888
I hate code!
Profile
Posts: 151
Reg: Dec 24, 2011
Sydney
1,610
like
01/07/13 07:46 AM (11 years ago)
Thanks Raveyd, Still no luck to get this custom URL to work. The screen still keeps spinning circle with loading. Is it okay to PM you with my BT raw file? Kind Regards, Cyrus
 
Paul Rogers
Android Fan
Profile
Posts: 2524
Reg: May 30, 2011
UK
35,740
like
01/07/13 07:51 AM (11 years ago)
Yes, no problem. The whole project would be better though. paul9qr @ btinternet dot com
 
Cyrus_8888
I hate code!
Profile
Posts: 151
Reg: Dec 24, 2011
Sydney
1,610
like
01/07/13 07:53 AM (11 years ago)
Thanks Champ!!
 
ATRAIN53
Code is Art
Profile
Posts: 1755
Reg: Nov 17, 2011
Chicago
26,450
like
01/07/13 08:18 AM (11 years ago)
I feel like David recently discussed this again- https://www.buzztouch.com/forum/thread.php?tid=E72D00A88A63EA1375BAF5D&command=isSearching&currentPage=2&topicTitle=android&createdBy=&repliedBy=&minViews=-1&maxViews=-1&minReplies=-1&maxReplies=-1&forumCategory= In his post here he points out that a .css or .js file you may be trying to access remotely could be part of them problem. I've only used local .css and .js in Android so far. But jquery is essential stuff so that needs to work from CDN.
 
Cyrus_8888
I hate code!
Profile
Posts: 151
Reg: Dec 24, 2011
Sydney
1,610
like
01/07/13 08:32 AM (11 years ago)
Hi ATRAIN53, Thanks for sharing. It makes sense now. You have mentioned you used local .css and .js. Do you mean by instead of use custom URL, but choose custom HTML and import all the relavent files into BT_Docs? Cheers Cyrus
 
Paul Rogers
Android Fan
Profile
Posts: 2524
Reg: May 30, 2011
UK
35,740
like
01/07/13 08:34 AM (11 years ago)
I think this issue is to do with the webpage using html5 local storage, the webView settings need to enable DOM storage.
 
Paul Rogers
Android Fan
Profile
Posts: 2524
Reg: May 30, 2011
UK
35,740
like
01/07/13 08:51 AM (11 years ago)
Fixed. Email on its way. For local storage on webpage, add: webView.getSettings().setDomStorageEnabled(true); to the web settings around line 109.
 
Cyrus_8888
I hate code!
Profile
Posts: 151
Reg: Dec 24, 2011
Sydney
1,610
like
01/07/13 04:07 PM (11 years ago)
THANK YOU RAVEYD!!!!! You are one of the best code killer. Problem resolved. Cheers Cyrus
 
Paul Rogers
Android Fan
Profile
Posts: 2524
Reg: May 30, 2011
UK
35,740
like
01/07/13 04:14 PM (11 years ago)
haha! Thanks very much @Cyrus_8888. It was an interesting problem. Will hopefully solve some problems if people find this thread.
 
Cyrus_8888
I hate code!
Profile
Posts: 151
Reg: Dec 24, 2011
Sydney
1,610
like
01/07/13 04:24 PM (11 years ago)
Absolutely!! Cheers man Cyrus
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.