Office Hours — Today, February 1

Thursday, January 20

Mark M.
has entered the room
Mark M.
turned on guest access
Prasanna P.
has entered the room
Prasanna P.
Hi Mark!
Mark M.
howdy Prasanna!@
er, ignore that @
Prasanna P.
no prob
Here are 3 questions:
View paste
1. Thoughts about using PullXMLParser vs SAX?  What is bettor.
2. Client wants us to return XML document in method of the ContentProvider.  Isn't this a bad idea? ie returning a XML document.
3. Will an AppWidgetProvider be able to access the interface exposed by a ContentProvider?
Mark M.
1. Speed-wise, they're roughly equivalent, so I'd lean towards SAX, as more Java developers will be familiar with it
Prasanna P.
but isn't
Mark M.
2. There is no "method of the ContentProvider" that can return a Document
Prasanna P.
xml pull parser easier to use?
Feb 1
8:00 PM
Mark M.
3. Probably, but I haven't tried that combination
In terms of ease of use, you say "to-MAY-toe", I say "to-MAH-toe"
IOW, ease of use is in the eye of the beholder
if the development team vastly prefers the pull parser, feel free to use it
Prasanna P.
ok. got it for 1
In terms of 2, I think I did not write this properly ..
they want us to return an xml document. ie a string that is an xml document ...
Mark M.
OK
Prasanna P.
this may be about 15 lines of code
Mark M.
where is the XML coming from?
Prasanna P.
i meant lines of xml lines
it is store in the sd card
Mark M.
OK
what specifically is your concern?
Prasanna P.
instead of returning a whole xml document as a string shouldn't we be sending the path to the document in the sd card
Mark M.
I can't answer that in the abstract
either approach could be valid
Prasanna P.
ok got it for 2
Mark M.
downside of returning the path is leaking of implementation-specific information (e.g., path structure)
Prasanna P.
ok
In terms of 3, the interface exposed by a ContentProvider can be accessed by an app. Right?
So, I do not see why the there would
8:05 PM
Prasanna P.
be any issues with the AppWidgetProvider being able to use
the interface exposed by the ContentProvider. Do you agree?
Mark M.
so long as you aren't trying anything asynchronous, yes
that's the downside of doing the work in an AppWidgetProvider directly
and, since your ContentProvider is apparently doing flash I/O, doing that in the AppWidgetProvider is not a good idea
but it is technically possible
I would have the AppWidgetProvider delegate the work to an IntentService, which communicates with the ContentProvider
Prasanna P.
ok ....
so I am assuming that the AppWidgetProvider would call the IntentService with different Intents corresponding to the ...
different interface methods ... does this make sense?
Mark M.
No
Your AppWidgetProvider is probably about six or seven lines of code
It calls startService() from onUpdate()
and that's it
Oh, wait
8:10 PM
Mark M.
if by "interface methods", you mean onUpdate(), onDisabled(), and the other methods *on* the AppWidgetProvider, then yes
things that don't do anything slow could be implemented on the AppWidgetProvider directly if you choose
but anything that involves flash or network I/O should have their AppWidgetProvider method (e.g., onUpdate()) call startService() to send the command to the IntentService, with enough details in the Intent to let the service know what needs to be done
Prasanna P.
ok.
and what would be a good way to return the results back to the AppWidgetProvider in a situation like this - a message?
Mark M.
ideally, there are no "results" that the AppWidgetProvider needs
just update the app widget from the IntentService
it is impossible to "return the results" in any case
8:15 PM
Prasanna P.
Trying to pass "it is impossible to "return the results" in any case"
Mark M.
the AppWidgetProvider will be destroyed in microseconds, after the startService() call
hence, there is nothing to "return the results" to
think of AppWidgetProvider as a facade, with the IntentService as being the true implementation of the "app widget"
Prasanna P.
ok
So ...
In the IntentService we create a WidgetManager and update the Widget. Right?
Mark M.
AppWidgetManager
but otherwise yes
Prasanna P.
Yes. Meant AppWidgetManager
OK. Mark. Got it.
8:20 PM
Prasanna P.
Thanks! Is it ok if I head out.
Mark M.
sure
don't hang around here on my account!
Prasanna P.
I am sure someone will come by soon. Bye
Mark M.
have a pleasant evening!
Prasanna P.
you too. Have a pleasant evening!
Prasanna P.
has left the room
8:35 PM
Prasanna P.
has entered the room
Prasanna P.
Mark, Here is a question that just came up
Mark M.
hello again
Prasanna P.
I was just trying to build a project using honeybomb
and Eclipse wanted me to use honeybomb as the min sdk
I was not able to use a 2.3 as the min sdk. Why is this?
Mark M.
1. I don't use Eclipse
2. I haven't used Eclipse with the HC Preview SDK
Prasanna P.
ok
Mark M.
3. I haven't done anything with the HC Preview SDK yet, as I have a cold and feel lousy
in short, I haven't a clue, sorry
Prasanna P.
so ok :)
i meant oh ok :)
but in general if i have to use min sdk as 'honeybomb' then it will only run on devices that are running on ...
'honeycomb'. Right?
Mark M.
correct
as I understand it, you're supposed to use "Honeycomb" for the targetSdkVersion
that will get you Holographic theme support and such
8:40 PM
Mark M.
in fact, the SDK docs specifically discuss having minSdkVersion="9" or lower
so it should work
Prasanna P.
ok ....
Mark M.
when you say "I was not able to use a 2.3 as the min sdk", what do you mean?
Julius
has entered the room
Prasanna P.
Tried again and I get same message from Eclipse
'The SDK target is a preview. Min SDK Version must be set to 'Honeycomb'.'
Mark M.
beats me
(btw, howdy, Julius!)
feels like a bug in the ADT, but I can't say for certain
Julius
hi all
Mark M.
Julius: do you have a question?
Prasanna P.
Yes, feels like a bug to me also. Hi Julius. Thanks again Mark! Heading out.
Prasanna P.
has left the room
Julius
oh yes
I have a memory leak in my application and have finally figured out how to reprodue it
basically I start the activity and rotate the screen about 18 tiems
tiems
times
I understand I must have passed the activity or context to soemthing which isn't eing released
(at least that's my guess)
8:45 PM
Julius
have you an idea how I might go about debugging this?
Mark M.
Use DDMS
rotate the screen a bunch of times
in DDMS, punch the GC toolbar button a few times
then, in DDMS, punch the "Dump HPROF file" button
load that into the Eclipse MAT (Memory Analysis Tool?) utility
use that to try to figure out what's holding onto what
Julius
: / ah yeah I haven't quite got MAT figured out yet... I have it loaded though
thanks I'll give that a go
will lurk in the mean time if that's ok
Mark M.
there's nobody else here
not much lurking to do
Julius
:)
I've been stuck on this for weeks...
that said I now have super efficient lists as I thought that was the problem
SoftReferences all over the show :)
fitz
has entered the room
Mark M.
howdy, fitz!
fitz: do you have a question?
8:50 PM
fitz
Mark will you auto e-mail transcripts - do they only get emailed if you join office hours?
Mark M.
they get emailed to the cw-android Google Group
if you subscribe to the Group, you get the transcripts, along with everything else on there
fitz
I ready them after to mark sense of questions :) not as fast as most users yet
Mark M.
I don't email empty transcripts (nobody showed), and occasionally I forget
fitz
ya think I get group info - is Google groups going away or was that just a roomer
Mark M.
Google Groups isn't going away, but they are dropping some features
nothing too major for what I've been using them for
fitz
ok - so do you know of an free SW that will convert MDB to SQLite?
need to get c# filled DB over to phone
Mark M.
no, sorry
fitz
any paid SW?
and this DB updates every 12 hrs or so - so I would need it auto converted - easy or should I look for another option
Mark M.
I haven't touched MDB in about 15 years
fitz
access
Mark M.
MS Access is *so* not my area of expertise
8:55 PM
fitz
ok - need to jet thanks
Julius
(excuse me: huge Thank You Mark!)
fitz
1 more question
Julius
(I haven't been sleeping well because of this)
Mark M.
fitz: go ahead
fitz
will ask next time
thanks need to jet
Mark M.
uh, ok
fitz
has left the room
Julius
thank you so much - I guess I get pretty involved with these things. I really appreciate it. Have a cracker of a morning/day/evening.
bfn
Mark M.
see ya
Julius
has left the room

Thursday, January 20

 

Office Hours

People in this transcript

  • fitz
  • Julius
  • Mark Murphy
  • Prasanna Perera