Office Hours — Today, April 15

Tuesday, April 13

Apr 15
9:25 AM
Mark M.
has entered the room
Mark M.
turned on guest access
9:35 AM
German
has entered the room
German
hello!
Mark M.
howdy!
German
nice to see you here
Mark M.
likewise!
German
i wanted to ask you a question last week but the time difference between spain and usa made it difficult :)
first, i'd like to congrat you for your book, it's very good
and now, my question
9:40 AM
German
the SAX xml parser in the dalvik vm is different from the one in the java desktop
so in a app i'm trying to make
Sebastian
has entered the room
German
i have encountered a problem
I'm making an app that connects to google analytics and retrieve some info
and when obtaining some feeds (in xml) some nice exceptions arise
(btw, sorry for any language problem, english is not my native language)
specificly, in a line like this: AccountFeed accountFeed = analyticsService.getFeed(queryUrl, AccountFeed.class);
nice exception of method not found, getSchema(), in SAX parser class (don't remember exactly the class)
do you know any work around in android?
i mean... what can i do?
parse the xml feed from google manually?
Mark M.
I have not had a problem using SAX
You also have the DOM and the XmlPullParser
German
yep, the problem is that the AnalyticsService class from the google data API uses sax, and specifically, that method not present in the dalvik api
would you say that my only chance is parse manually the xml?
Mark M.
Or find an Android-friendly GData library
9:45 AM
German
that's going to be painful, there isn't anyone: they have released a library, but it collects data from the cells
Mark M.
then don't use Google Analytics
German
must use it...
it's a kind of requirement
Mark M.
well, that I can't help with
you cannot assume arbitrary JARs will work with Android
German
yep, I know, I know
Mark M.
you cannot even assume arbitrary Java source will work with Android
German
yep, I know... :)
thanks, anyway
Mark M.
you may just be able to tweak the existing AnalyticsService code
for example, getSchema() fails because there's no schema support in Android
German
mmmm
Mark M.
that may or may not truly be required by AnalyticsService
try commenting out the call, recompile their code, and see if it blows up
German
google code is open source, isn't it?
ok, will try that
Mark M.
I think the GData APIs are open source
haven't used them, personally
German
in an issue in code.google.com they say that there is some specific code for google data
in android 1.5
Mark M.
that is not Android 1.5
that is Android M5
a beta
before Android 0.9
about two years old now
very out of date
9:50 AM
German
alright
so all the classes in that javadoc probably are unavailable now, right?
Mark M.
not in the SDK
German
well, thanks for the answers...
Mark M.
sorry I didn't have a better solution for you
Sebastian: did you have a question
?
Sebastian
yes. i have a performance problem starting an activity from a widget
basically the scenario is. on click onto the widget i start my activity. this usually opens up instantly ( basically the activity is a listview)
however,if i do this sequence: click onto widget, ( activty starts) and then i press the home button, and then click again onto my widget, the activty with the listview takes 4 seconds or so to show up
Mark M.
that sounds strange
anything unusual about what is being loaded into the ListView?
9:55 AM
Sebastian
it's using a contentprovider ( my own) to populate the listcursor
Mark M.
why?
why a ContentProvider?
Sebastian
if i just start the activty from the launcher, it doesn't matter if i backed out via "back" or "home" button
no reason, really. we made the choice earlier. doesn't really have a benefit for us.
Mark M.
actually, it has a cost
Sebastian
but it performs well usually
Mark M.
ContentProvider is designed for inter-process communication
I am not sure that is your problem, but I would strongly consider getting rid of the ContentProvider
As a quick test, comment out the population of your ListView, and try your launch-HOME-widget-click scenario again
If it is now fast, consider removing the ContentProvider layer
If it is still slow, then populating the ListView is not the source of your widget-related problem
Sebastian
ok, i will try that out
Mark M.
if it is still slow, add logging or something to figure out where your time is being taken up
10:00 AM
Sebastian
oh one more. relativelayout. I am not getting centerVerical to work on 1.5. i concluded for now relativelayout is buggy in 1.5 and avoid, but am not 100% sure
Mark M.
centerVertical worked for me
can you be more specific? where are you encountering the problem?
10:05 AM
Sebastian
it worked for me in 1.6 and higher. but it wouldn't center in 1.5 . trying to find the layout i used
Mark M.
if it is in a ListView row, be sure to use inflate(R.layout.whatever, parent, false), not inflate(R.layout.whatever, null)
10:10 AM
Sebastian
argh. sorry i can't find the relative layout now i used. it was not a list view
i will revisit it, i replaced it with a linearlayout, since i couldn't figure it out how to fix it
10:15 AM
Sebastian
i guess that's it for me. i will try to debug my activity and see if removing the contentprovider will solve my performance issue... thanks again for holding this chat
Mark M.
ok
German: do you have any questions?
Sebastian
and i'll try the relative layout again , if i find it. maybe next time i have a small sample, if i still can't figure it out... :-) cu
Mark M.
sounds good
German
has left the room
Sebastian
has left the room
10:25 AM
Mark M.
turned off guest access

Tuesday, April 13

 

Office Hours

People in this transcript

  • German
  • Mark Murphy
  • Sebastian