Apr 15 | 9:25 AM |
Mark M. | has entered the room |
Mark M. | turned on guest access |
Apr 15 | 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 :)
|
German |
first, i'd like to congrat you for your book, it's very good
|
German |
and now, my question
|
Apr 15 | 9:40 AM |
German |
the SAX xml parser in the dalvik vm is different from the one in the java desktop
|
German |
so in a app i'm trying to make
|
Sebastian | has entered the room |
German |
i have encountered a problem
|
German |
I'm making an app that connects to google analytics and retrieve some info
|
German |
and when obtaining some feeds (in xml) some nice exceptions arise
|
German |
(btw, sorry for any language problem, english is not my native language)
|
German |
specificly, in a line like this: AccountFeed accountFeed = analyticsService.getFeed(queryUrl, AccountFeed.class);
|
German |
nice exception of method not found, getSchema(), in SAX parser class (don't remember exactly the class)
|
German |
do you know any work around in android?
|
German |
i mean... what can i do?
|
German |
parse the xml feed from google manually?
|
Mark M. |
I have not had a problem using SAX
|
Mark M. |
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
|
German |
would you say that my only chance is parse manually the xml?
|
Mark M. |
Or find an Android-friendly GData library
|
Apr 15 | 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...
|
German |
it's a kind of requirement
|
Mark M. |
well, that I can't help with
|
Mark M. |
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... :)
|
German |
thanks, anyway
|
Mark M. |
you may just be able to tweak the existing AnalyticsService code
|
Mark M. |
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
|
Mark M. |
try commenting out the call, recompile their code, and see if it blows up
|
German |
google code is open source, isn't it?
|
German |
ok, will try that
|
Mark M. |
I think the GData APIs are open source
|
Mark M. |
haven't used them, personally
|
German |
in an issue in code.google.com they say that there is some specific code for google data
|
German |
in android 1.5
|
German |
and they link to http://www.androidjavadoc.com/m5-rc15/index.html
|
Mark M. |
that is not Android 1.5
|
Mark M. |
that is Android M5
|
Mark M. |
a beta
|
Mark M. |
before Android 0.9
|
Mark M. |
about two years old now
|
Mark M. |
very out of date
|
Apr 15 | 9:50 AM |
German |
alright
|
German |
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
|
Mark M. |
Sebastian: did you have a question
|
Mark M. |
?
|
Sebastian |
yes. i have a performance problem starting an activity from a widget
|
Sebastian |
basically
the scenario is. on click onto the widget i start my activity. this
usually opens up instantly ( basically the activity is a listview)
|
Sebastian |
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
|
Mark M. |
anything unusual about what is being loaded into the ListView?
|
Apr 15 | 9:55 AM |
Sebastian |
it's using a contentprovider ( my own) to populate the listcursor
|
Mark M. |
why?
|
Mark M. |
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
|
Sebastian |
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
|
Mark M. |
I am not sure that is your problem, but I would strongly consider getting rid of the ContentProvider
|
Mark M. |
As a quick test, comment out the population of your ListView, and try your launch-HOME-widget-click scenario again
|
Mark M. |
If it is now fast, consider removing the ContentProvider layer
|
Mark M. |
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
|
Apr 15 | 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
|
Mark M. |
can you be more specific? where are you encountering the problem?
|
Apr 15 | 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)
|
Apr 15 | 10:10 AM |
Sebastian |
argh. sorry i can't find the relative layout now i used. it was not a list view
|
Sebastian |
i will revisit it, i replaced it with a linearlayout, since i couldn't figure it out how to fix it
|
Apr 15 | 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
|
Mark M. |
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 |
Apr 15 | 10:25 AM |
Mark M. | turned off guest access |