Office Hours — Today, November 27

Yesterday, November 26

Mark M.
has entered the room
Mark M.
turned on guest access
Nov 27
10:00 AM
Guy
has entered the room
Mark M.
hello, Guy
Guy
Hello :-)
Mark M.
how can I help you today?
Guy
ActionBarCompat with ListActivity
Mark M.
um, could you phrase that in the form of a question? :-)
Guy
How do I implement the ActionBar?
Mark M.
technically, you can't
you need to use ActionBarActivity
whether that uses a ListFragment or just a ListView is up to you
Guy
OK
thanks thought that. thats what came up in my search :-)
10:05 AM
Mark M.
if you have another question, go ahead -- it's a quiet chat room
Jose L.
has entered the room
Mark M.
hello, Jose
Jose L.
hi there Mark
Mark M.
Jose: it's your turn -- do you have a question?
Jose L.
actually I do, yes
I have a couple of questions related to webviews
first: if I open an mp4 url with chrome, chrome shows a built-in video player
is it possible to achieve that behaviour using android's webview?
Mark M.
some WebView versions on newer devices may support HTML5 inline video
I have never tried it
but based upon StackOverflow chatter, it would appear to be a source of difficulty
and, I don't think it is available reliably before API Level 14
Jose L.
but it's not the <video /> tag in html
Mark M.
actually, I think HTML5 inline video *is* the <video> tag
10:10 AM
Jose L.
that's no problem, I can target 18 or 19, this app is for tablets and will be released in one year time
10:10 AM
Jose L.
and we control the devices so that's not an issue
Mark M.
then give <video> a try
note that WebView itself is using the Chrome engine on API Level 19
that will help with HTML5 compatibility over the long haul
but it may exacerbate the differences between the classic WebView behavior and what you get with it on API Level 19+
Jose L.
ok I will try that
Mark M.
Guy: do you have another question, before we move to Jose's second?
Jose L.
and the second question, might be a bit silly but I couldn't find it in stackoverflow
ok, I'll wait
Guy
not really. thanks
Mark M.
OK
Jose: what's your next question?
Jose L.
the question is also about webviews, if I place a webview with no webviewclient or webchromeclient I can load an url but as soon as I click on something the link is opened outside of the app, that's ok but
10:15 AM
Jose L.
if I use webviewclient and/or webchromeclient, I load everything inside the webview, which is ok too. The problem comes when I click in something the webview cannot load
like a pdf
or a mp3
load or display
so how do I make to load everything that can be displayed inside the webview inside the webview
Mark M.
well, a WebView cannot display a PDF or an MP3
Jose L.
and get notified when it's trying to load something
yeah I know
Mark M.
setDownloadListener()
Jose L.
what I would expect is
is I click in something the webview does not know how to handle
launch the intent
and open it with chrome, adobe reader, google music
or whatever
I know how to filter every resource that ends in *.mp3
or something like that
but the url might not end in something like that
even if it's an mp3 or pdf
Mark M.
that's why I would suggest trying setDownloadListener()
Jose L.
but I don't want to download, need to be displayed, streamed
Mark M.
doesn't matter
Jose L.
ah
aaaah
Mark M.
how you handle the download request is up to you
Jose L.
I got that wrong
thanks
yes
now I got it
I'll try
Mark M.
basically, AFAIK, WebView does an HTTP HEAD, and if it does not recognize the MIME type, routes it through the DownloadListener
now, one can argue that there should be a better default DownloadListener -- I haven't looked into this much
and it may be that you wind up having to do more of the downloading yourself, as another app may not be capable of reproducing the download (e.g., requires a session cookie)
10:20 AM
Guy
after adding a support lib to my app, I'm getting this error: "Conversion to Dalvik format failed: Unable to execute dex: java.nio.BufferOverflowException. Check the Eclipse log for stack trace."
Mark M.
Guy: ah, hang on, I recognize that one...
very popular issue
Guy
checking.
Mark M.
there are a few workarounds posted there, but I just downgraded to the 18.1.1 version of the build tools
Guy
View paste
Android Developer Tools Build: v22.3.0-887826
Mark M.
that's ADT
in the SDK Manager, I'm referring to "Android SDK Build-tools"
10:25 AM
Guy
thanks
doing that.
Mark M.
if either of you have any questions, go ahead
10:30 AM
Guy
I had probs. with installing the ActionBarSherlock, I gave up and used the ActionBarCompat.
it is compiling
now I have to write the actionbar menu stuff
:-)
if I'm using the Support Library v7 for android. do I need to have seperate version for 3.0 and above?
Mark M.
no
if your minSdkVersion is 13 or higher, use android-support-v13.jar
if your minSdkVersion is 12 or lower, use android-support-v4.jar
Guy
cool.
10:35 AM
Mark M.
if your minSdkVersion is 3 or lower, you're nuts :-)
Guy
I think of my mothers basic LG android phone. she needs to be happy :-)
gingerbread rules :-)
Mark M.
yes, but Cupcake is stale
10:40 AM
Guy
see you soon
Mark M.
have a nice day!
11:00 AM
Mark M.
that's the end of today's chat
the chat transcript will be posted to http://commonsware.com/office-hours/ shortly
the next chat is Tuesday at 7:30pm Eastern
have a pleasant day!
Guy
has left the room
Jose L.
has left the room
Mark M.
turned off guest access

Yesterday, November 26

 

Office Hours

People in this transcript

  • Guy
  • Jose Luis
  • Mark Murphy