Office Hours — Today, October 11

Tuesday, October 9

Oct 11
9:55 AM
Mark M.
has entered the room
Mark M.
turned on guest access
Gabriele
has entered the room
Mark M.
howdy, Gabriele!
how can I help you today?
10:00 AM
Gabriele
Hi :)
10:00 AM
Gabriele
I've moved as you told me the webview things to webviewhelper and it looks much better, logically talking!
View paste
Anyway now, from myAdapter I istantiate myWebViewHelper, MyWebViewHelper contains all realted thinghs of the WebView I'm using, inclusing overrides.
I'd need myAdapter to be aware when WebView onFinishedPage is fired. How can I do that and which is the "best" way to accomplish it? (with "best" I'm referring to respecting the object oriented paradigm)
Mark M.
I cannot tell you what is "best"
if your adapter needs to know when onPageFinished() is invoked, either it needs to be the WebViewClient (and therefore implements the method) or it needs to be called by something else that is the WebViewClient
Gabriele
Hm, which is a good way to implement something that, when onPageFinished is fired inside MyWebViewClient, it sends a "signal" to the adapter?
Mark M.
I cannot tell you "which is a good way"
Gabriele
A way* :P
Mark M.
either MyWebViewClient holds onto the adapter, or it holds onto something that holds onto the adapter
if you wish, define a custom interface for your event, have the adapter implement that interface
10:05 AM
Mark M.
and have MyWebViewClient call methods on that interface
Gabriele
Ah, ok. I will try with interfaces, thank you.
For some reason, after I moved the webview to the new class, I've implemented methods to get the current title and the current url (getTitle and getUrl)
But getTitle is working and getUrl is returning null! Have you an idea of why this is happening?
I'm calling getTitle and getUrl together, in the same method.
View paste
public String getURL() {
		return webView.getUrl();
	}
Mark M.
are you loading the content into the WebView from loadUrl()?
Gabriele
View paste
String sTitle = webViewHelper.getTitle();
String sURL = webViewHelper.getUrl();
One is working and one not. TT
10:10 AM
Mark M.
are you loading the content into the WebView from loadUrl()?
Gabriele
yes
Mark M.
are there any redirects, or JavaScript code, that might change what the content is?
(in a way that might mess up the URL the WebView thinks the content is coming from)
also, when are you calling getUrl()? from onPageFinished(), or earlier?
Gabriele
I've tried calling it after onPageFinished(), (async from it, anyway); there are not redirects, some js code, but it is from wikipedia
Mark M.
then I do not know why it might be null
OTOH, if there are no redirects, it should be the same value you passed to loadUrl()
so you should already have that data
Gabriele
Yes, exactly
I've also tried tapping on a link inside wikipedia, but it's returning null, too. Maybe some stupid error in my code
10:15 AM
Mark M.
possibly, but IMHO it is more likely something odd with WebView
Gabriele
Oh, ok thank you. I will do some try! :P
10:20 AM
Mark M.
if you have another question, feel free to ask
Gabriele
Ok, thank you.
10:55 AM
Roy
has entered the room
Mark M.
howdy, Roy!
the chat is nearly over -- do you have a quick question?
Roy
Hi I had a quick question on SQl Cipher
Mark M.
go ahead
Roy
Can I have a database without the cipher with a db for a cipher. I just need to put the usernames password in encrypted mode but others as open
Mark M.
the encryption is at the database level, not by table
you are welcome to use two databases, though, one using SQLCipher and one note
er, not
Roy
ok
Thanks
Roy
has left the room
11:00 AM
Mark M.
and, with that, today's chat is over
next one is 4pm Eastern on Tuesday
have a pleasant day!
Gabriele
has left the room
Mark M.
turned off guest access

Tuesday, October 9

 

Office Hours

People in this transcript

  • Gabriele
  • Mark Murphy
  • Roy