Office Hours — Today, December 14

Thursday, December 9

Mark M.
has entered the room
Mark M.
turned on guest access
Dec 14
8:00 PM
Bill W.
has entered the room
Mark M.
howdy, Bill!
Bill W.
hey Mark
dude... what is with the android MediaPlayer component? Do you have any light on some of the error codes that thing generates?
fitz
has entered the room
Bill W.
I'm trying to release a video-serving app to the market, and that component has become the bane of my existence
unexplained error codes, erratic behavior on different devices
unreliable results, etc
Mark M.
Bill: not really, particularly now that they changed to Stagefright from the original OpenCORE implementation
MediaPlayer is difficult unless you are controlling the content
(btw, howdy, fitz!)
Bill W.
how do you mean "controlling the content"?
fitz
Hello - just observing so no questions here
Bill W.
it's ours, in a sense, but it is being served up by our CDN
Mark M.
well, that should be OK
that's a far cry from "I'm trying to play this semi-random stream I found on the Intarweb"
but, from an error standpoint, MediaPlayer has been a problem for a long time
lots of cryptic warnings and stuff
Bill W.
is there a better implementation for streaming video from the internet that I don't know about?
8:05 PM
Bill W.
yeah, and unexplain errors like "UNKNOWN_ERROR -1004"
Mark M.
nothing in the OS
Bill W.
or -31
Mark M.
I haven't played with streaming video much in the past 15 months
Bill W.
okay... fair enough
Mark M.
hence, I have no idea what those error codes might mean
Bill W.
another question involves use of CWAC
fitz
Mark - when developing I have been using emulator only - should I get a Android cell to test against - I have read that live cell acts differently - using eclipse for Android etc.
Mark M.
fitz: you definitely want to test on hardware before releasing an app
Bill W.
i would strongly recommend it! :-)
fitz
ok - so if I want to also port to tablet when out then buy one EH!
Mark M.
I'd start with a phone, unless you're making an app targeted at tablets
you do not need one of everything
however, you really do need one of something
Bill W.
i'm using the CWAC list-related stuff in many places (task, adapter, thumbnail, endless), but I keep getting these exceptions reported to me from the field: java.lang.IllegalStateException: The content of the adapter has changed but ListView did not receive a notification. Make sure the content of your adapter is not modified from a background thread, but only from the UI thread
fitz
will cell carriers if selling phone now on 2.2 move to 2.3 or is that a wild card - as in I could expect to move up? reason I ask is maybe wait to get cell that has 2.3 on it
Bill W.
and I've checked every place i am modifying contents, and it's all on the UI thread
Mark M.
Bill W: tough to answer that in the abstract
8:10 PM
Mark M.
there may be spots where I am failing to chain notifyDataSetChanged() or something
I know I have that fixed in EndlessAdapter
might not in ThumbnailAdapter, since I haven't touched that in ages
Bill W.
okay...i may be using an older implementation of that, so I'll be sure to update
Mark M.
(it's overdue for a rewrite)
fitz: eventually, carriers will get 2.3 phones, it is merely a question of when
it is generally difficult to predict that sort of thing, except for what is announced
fitz
ok - you liking 2.3 yet or just a yawn version?
Bill W.
Mark, is there a place that gets updated if bugs like that get fixed? so I'll have an idea definitively, when I'm updating to a newer version, of whether that should get addressed? (I never see them while testing in house, FWIW)
Mark M.
Bill: you can follow the github repo
or keep tabs on the repo's home page
Bill W.
sorry... i should have been more specific... i didn't know if that was already assigned to a specific bug number, or if there is any way of tracking it
i guess I'll just diff the version comments though
Mark M.
oh, no
Bill W.
thanks
Mark M.
fitz: 2.3 is interesting, but most of the cool stuff is outside my areas of expertise (gaming) or requires hardware (NFC)
Bill: For recently-maintained stuff, the repo's home page has a changelog
things I haven't updated in ages (e.g., ThumbnailAdapter) don't
8:15 PM
Bill W.
cool cool...
Mark M.
any other questions?
Bill W.
any suggestions on the best way to investigate sporadic OutOfMemoryError reports from the field? (that can't be reproduced in house)
Mark M.
are you getting stack traces, at least?
8:20 PM
Mark M.
if you are not getting stack traces, use Flurry or ACRA or something
Bill W.
i am getting stacktraces...
Mark M.
if you are, the most likely OutOfMemoryError culprit seems to be bitmaps -- make sure you are aggressive about calling recycle() on those
Bill W.
they often occur when decoding Bitmaps from input streams, or trying to inflate a layout from an XML file
Mark M.
well, inflating a layout on its own is not very memory intensive
it's probably tied to bitmaps, then
Bill W.
interesting...
all of the images in our app are loaded remotely
Mark M.
one of the things I need to do with ThumbnailAdapter is take better care of the bitmaps
are you downloading thumbnail-sized images, or are they being resized on the device?
Bill W.
for the thumbnailadapters, they are mainly thumbnail sized when i download them
but the device may be trying to resize them
Mark M.
well, so long as they aren't huge images that are being scaled, that should not be a problem, I wouldn't think
but it doesn't take many full-size images to run you out of heap space on some devices
8:25 PM
Bill W.
yeah
so it may not be worth pursuing... if it's just a sporadic thing, and limitation of smaller slimmer implementations?
Mark M.
any patterns of what devices you get the error on
?
Bill W.
our remote stacktrace reporting tool isn't including that info...
i guess it probably should
maybe i'll look into ACRA
Mark M.
yeah, grabbing the android.os.Build values is probably a good idea
I haven't used it -- I just know it by name
8:30 PM
Bill W.
we're using remote-stacktrace
Mark M.
any other questions?
8:35 PM
fitz
nope I am gone cya
fitz
has left the room
8:40 PM
Bill W.
i'm looking into doing some last minute app features (namely "sharing on twitter/facebook/etc")
i saw in the books some references to JTwitter, etc.
Mark M.
that is one approach
Bill W.
should I rely on Android's intents system to handle this problem? what about people that don't have twitter clients installed?
Mark M.
I would just use ACTION_SEND
most bang for the buck
Bill W.
and they get a selection of recipient to receive that intent? (i.e. share on twitter? share on facebook? email?)
Mark M.
they get a selection of activities
they choose the activity, which lets them send/post/whatever
Bill W.
oh totally
Mark M.
twitter would tweet, gmail would send an email to selected addresses, etc.
Bill W.
awesome
Mark M.
see the Introspection and Integration chapter of the Advanced Android book for samples
8:55 PM
Julius
has entered the room
Mark M.
howdy, Julian!
Julius
hi Mark
Mark M.
only a few more minutes -- got a quick question?
Julius
Sorry to be so late - hopefully won't be late
yes
simple one
I have a Cursor which returns results from multiple tables
and each table has a column with the same column name eg. _id or title
is there a way to distingush between them in the Cursor or ask for the column names to be named differently on returning the Cursor?
Mark M.
rename them in the query
Julius
ah ok I'll look in SQLite
Mark M.
use the "AS alias" syntax
Julius
that's gonna save a world of pain
Mark M.
SELECT _ID AS Foo, ...
Julius
oh yeah.. I've seen that in EJBQL or soemthing
thank you!
Mark M.
of course, ideally, you know the order of your columns in the Cursor, and therefore do not care about the names, only the indices
Julius
that's what I've been doing
but it's hard to aintain the code
maintain
to return new columns...
anyhow you've solved it!
bfn
Julius
has left the room
Mark M.
any final question?
9:00 PM
Bill W.
has left the room
Mark M.
turned off guest access

Thursday, December 9

 

Office Hours

People in this transcript

  • Bill W
  • fitz
  • Julius
  • Mark Murphy