Discussion Forums  >  Uncategorized

Replies: 4    Views: 204

droids older brother
Aspiring developer
Profile
Posts: 2
Reg: Dec 29, 2010
Australia
20
03/28/11 04:55 AM (14 years ago)

hide url

Hi team. Is there a way to hide url when app can't connect to webpage? I don't want users knowing the webpage address where I'm storing the info. Rather than app saying can't connect to http://www.yadayada.... Is there a way to have it say display a connection error message?
 
David @ buzztouch
buzztouch Evangelist
Profile
Posts: 6866
Reg: Jan 01, 2010
Monterey, CA
78,840
like
03/28/11 07:43 AM (14 years ago)
Depends. The method will depend on what version you're using. v1.4, v1.5, Anroid? iOS? This is not as easy in Android. Super easy in iOS
 
droids older broth...
Aspiring developer
Profile
Posts: 2
Reg: Dec 29, 2010
Australia
20
like
03/28/11 07:43 PM (14 years ago)
Hi David, v1.4, Android... (the not as easy combination).
 
David @ buzztouch
buzztouch Evangelist
Profile
Posts: 6866
Reg: Jan 01, 2010
Monterey, CA
78,840
like
03/28/11 09:21 PM (14 years ago)
I'm guessing you're using a Custom URL screen. In this case, the file that handles these types of screens is Screen_CustomURL.java in the /src folder of the project. Have a look at this method: public void onReceivedError(WebView view, int errorCode, String description, String failingUrl); This shoud be the method that is 'fired' when an error occurs. I'm not exactly sure what message you're seeing. If it's a native Anroid error, that method should trigger when it cannot load the URL. I can look further if you send a screenshot (use the simualtor if you want) to info 'at' buzztouch.com Send an image of the error being displayed so I can see what type of message you're seeing.
 
AlmaR
Lost but trying
Profile
Posts: 73
Reg: Jun 13, 2011
location unknow...
5,630
like
03/20/13 04:07 PM (12 years ago)
Here is what I did for Android on BT v2.0 and it is working great: 1- Create a error.html file with the message that I want to display. Then go to Eclipse and add it to /assets 2- On BT_screen_customURL.java add one line and comment two: @Override public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) { webView.loadUrl("file:///android_asset/error.html"); // hideProgress(); // showAlert(getString(R.string.errorTitle), getString(R.string.errorLoadingScreen)); BT_debugger.showIt(activityName = ":onReceivedError ERROR loading url: " + failingUrl + " Description: " + description); } Good luck mate!
 

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.