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
|
Mark M. |
you need to use ActionBarActivity
|
Mark M. |
whether that uses a ListFragment or just a ListView is up to you
|
Guy |
OK
|
Guy |
thanks thought that. thats what came up in my search :-)
|
Nov 27 | 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
|
Jose L. |
I have a couple of questions related to webviews
|
Jose L. |
first: if I open an mp4 url with chrome, chrome shows a built-in video player
|
Jose L. |
is it possible to achieve that behaviour using android's webview?
|
Mark M. |
some WebView versions on newer devices may support HTML5 inline video
|
Mark M. |
I have never tried it
|
Mark M. |
but based upon StackOverflow chatter, it would appear to be a source of difficulty
|
Mark M. |
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
|
Nov 27 | 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
|
Nov 27 | 10:10 AM |
Jose L. |
and we control the devices so that's not an issue
|
Mark M. |
then give <video> a try
|
Mark M. |
note that WebView itself is using the Chrome engine on API Level 19
|
Mark M. |
that will help with HTML5 compatibility over the long haul
|
Mark M. |
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
|
Jose L. |
ok, I'll wait
|
Guy |
not really. thanks
|
Mark M. |
OK
|
Mark M. |
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
|
Nov 27 | 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
|
Jose L. |
like a pdf
|
Jose L. |
or a mp3
|
Jose L. |
load or display
|
Jose L. |
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
|
Jose L. |
yeah I know
|
Mark M. |
setDownloadListener()
|
Mark M. | |
Jose L. |
what I would expect is
|
Jose L. |
is I click in something the webview does not know how to handle
|
Jose L. |
launch the intent
|
Jose L. |
and open it with chrome, adobe reader, google music
|
Jose L. |
or whatever
|
Jose L. |
I know how to filter every resource that ends in *.mp3
|
Jose L. |
or something like that
|
Jose L. |
but the url might not end in something like that
|
Jose L. |
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
|
Jose L. |
aaaah
|
Mark M. |
how you handle the download request is up to you
|
Jose L. |
I got that wrong
|
Jose L. |
thanks
|
Jose L. |
yes
|
Jose L. |
now I got it
|
Jose L. |
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
|
Mark M. |
now, one can argue that there should be a better default DownloadListener -- I haven't looked into this much
|
Mark M. |
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)
|
Nov 27 | 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...
|
Mark M. | |
Mark M. |
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 | |
Mark M. |
that's ADT
|
Mark M. |
in the SDK Manager, I'm referring to "Android SDK Build-tools"
|
Nov 27 | 10:25 AM |
Guy |
thanks
|
Guy |
doing that.
|
Mark M. |
if either of you have any questions, go ahead
|
Nov 27 | 10:30 AM |
Guy |
I had probs. with installing the ActionBarSherlock, I gave up and used the ActionBarCompat.
|
Guy |
it is compiling
|
Guy |
now I have to write the actionbar menu stuff
|
Guy |
:-)
|
Guy |
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
|
Mark M. |
if your minSdkVersion is 13 or higher, use android-support-v13.jar
|
Mark M. |
if your minSdkVersion is 12 or lower, use android-support-v4.jar
|
Guy |
cool.
|
Nov 27 | 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 :-)
|
Guy |
gingerbread rules :-)
|
Mark M. |
yes, but Cupcake is stale
|
Nov 27 | 10:40 AM |
Guy |
see you soon
|
Mark M. |
have a nice day!
|
Nov 27 | 11:00 AM |
Mark M. |
that's the end of today's chat
|
Mark M. |
the chat transcript will be posted to http://commonsware.com/office-hours/ shortly
|
Mark M. |
the next chat is Tuesday at 7:30pm Eastern
|
Mark M. |
have a pleasant day!
|
Guy | has left the room |
Jose L. | has left the room |
Mark M. | turned off guest access |