Office Hours — Today, June 8

Wednesday, June 2

Jun 8
7:55 PM
Mark M.
has entered the room
Mark M.
turned on guest access
8:00 PM
Julius
has entered the room
Julius
Hello
Mark M.
howdy, Julius!
Julius
I do have a question, ut first while no one is looing I have to say I am in awe of the posts and quality of your documents
looking
but
Mark M.
Thanks!
Julius
oh this keyboard
anywho....
I've read about 3 books other than your ones and yours are really good
so the question I have (today)
I have a bunch o things in a sqlite db
one of the attributes of these things is a url pointing towards a piture
\picture
you can see where this is heading
so I have some listviews in tabs at the moment
and I saw your cwac
but there's a gap briging how it all works
I'll explain what I know and maybe you can point me in the right direction
it seems like the LayoutInflater only inflates as you scroll
Mark M.
OK
8:05 PM
Mark M.
No
8:05 PM
Mark M.
just the opposite
Julius
oh dear
Mark M.
once you start scrolling, it starts recycling the rows you inflated earlier
Julius
right so I don't want to load all those images in a big list I guess
Mark M.
probably not, though it is difficult to say in the abstract
Julius
I guess I'm not sure how I should go about getting those images into the rows
Mark M.
you would attach the picture to the row's ImageView in bindView() of your CursorAdapter
Julius
(it looks nice in my contacts the way those images populate)
cool
Mark M.
the question then is: when do you download the pictures from the URL?
Julius
right
(good question :))
Mark M.
how many pictures?
and how big?
Julius
could be hundreds
oh and um... one sec
say up to 10kB
the example I have here is 8kB
Mark M.
OK, so pretty small
Julius
(each image)
Mark M.
next question: how frequently will they change?
Julius
I wouldn't think they ever change (album cobers)
covers
Mark M.
even better
Julius
I was thinking of caching to the SDCard
Mark M.
even better than better
I would download them when the record gets inserted into the database
Julius
right
Mark M.
then, you can just point the ImageView to the file on the SD card in bindView)
er, bindView()
8:10 PM
Khye k.
has entered the room
Mark M.
howdy, Khye!
Julius: that way, you don't have to worry about trying to download them on the fly
Julius
hi Khye
Mark M.
If you get to the point where you're talking tens of thousands of 10K images, then this plan might have problems
but for hundreds of 10K images, you should be OK
Julius
that can be version 2 :)
Khye k.
Hi Mark. Hi Julius.
Julius
sounds much more sensible than all that traffic
Mark M.
right, a 10K download on occasion should not be a problem
only potential issue is if they are offline at the time, and I don't know if that's even possible depending on what your app does
Khye k.
I have a few questions when you're available
Venu
has entered the room
Julius
yes if they're offline life can go on
Mark M.
Julius: are you set in terms of this question?
Julius
I will leave you to the questions
Venu
Hi Mark
Julius
yes thank you
Mark M.
Khye: you're up -- ask away! (and, hi, Venu!)
Julius
btw if you're ever wanting to play with OpenGL over the camera I posted some code although it may be bad (http://www.juliusspencer.co.nz/technology/…)
Venu
Thank you for such a awsome books and service
Julius
bfn thank you again.
Mark M.
Venu: you're welcome
Venu
I have few questions today
Julius
has left the room
Mark M.
Venu: hold on
Venu
ok
Mark M.
Khye: did you have a question?
Khye k.
I have roughly three questions. One is that I come from a Flex actionscript background and so am learning Java through Android, which hasn't been that difficult. But Flex is big on data binding from objects. Is there something like this in Java/Android or is it all done through functions and getters/setters
8:15 PM
Mark M.
There is no data binding framework like Flex's in Android, sorry
Khye k.
ie: I update an object and that is reflected to my UI autmoatically
OK, More specifically, I have an options menu. Suppose that I am choosing a shape such as Square, trapazoid, rhombus, rectangle
Mark M.
Again, sorry, there is nothing like that
NetApex
has entered the room
Khye k.
So if someone selects square I need to also check rhombus and rectangle, etc
Mark M.
What do you mean by "check rhombus and rectangle"?
(btw, howdy, NetApex!)
NetApex
Heya Mark
Khye k.
Say the menu was a check menu
Mark M.
OK
Khye k.
Suppose you had a check menu
and some of the menu options cascaded to other items
so if you checked the menu item Square, it would set the checked property of other items.
Mark M.
you are welcome to set something up like that by hand
frankly, off the cuff, I am not a fan of that UI design
Khye k.
Would it be better to do this by reading variable onPrepareMenu or better to handle it on the itemSelected event
Mark M.
well, take that back -- I can see some scenarios where that would make sense
8:20 PM
Mark M.
I would probably use onPrepareOptionMenu(), just so I do not need to hang onto the Menu object
but, either way should work
Khye k.
Alright, thanks for the book and service - I'll let others have their turn.
Mark M.
you're welcome!
Venu: you're up!
Venu
I have few questions 1. Is there any way to share data between two apps in a secure way, specifically is there a way to make a content provider secure 2. How to bring down a half screen activity like the one we get when we click on directions in maps app
Mark M.
taking #2 first, I'm not sure, but that might be a PopupWindow
it shows up as a separate entry in hierarchyviewer
Venu
ok
Mark M.
I haven't had a chance to use PopupWindow myself yet, so I don't know if that's what it's supposed to look like in hierarchyviewer or not
Venu
ok
Mark M.
there are ways to achieve a similar effect just within an activity's own layout, though
CalvinS
has entered the room
Mark M.
take a look at the Maps applications in the Advanced Android book
Venu
sure
Mark M.
you'll see where I have some popup panels in use, just as a widget floating above the rest in a RelativeLayout
Venu
ok
Mark M.
you could use that, plus a TranslateAnimation, to have something descend from the top of the screen
8:25 PM
Venu
yup will try that out
Mark M.
the only thing it won't give you is the modal effect -- you can't click on the map when the navigation panel is showing
that's another reason why I suspect that's a PopupWindow
(btw, howdy, CalvinS!)
in terms of your first question, there is no great way to secure that
first, anyone can root their phone, at which point all bets are off
CalvinS
Hi there
Venu
ok
Mark M.
if you are willing to live with that limitation, you might be able to rig up some sort of key exchange or something
pick a design like you might use between a REST Web service and its client
but, there's nothing really built into Android for it
Venu
ok got it
Mark M.
content providers are designed to be intrinsically public
Venu
ok
I have one last question
Mark M.
Venu: can we give some of the others a shot first?
Venu
sure
I will wait
Mark M.
we'll get back to you
NetApex: do you have a question?
Venu
thanks for the answers Mark
Mark M.
you're welcome!
NetApex
Nothing major right now, I think I figured out what I needed for the time being
Mark M.
OK
CalvinS: do you have a question?
OK, we'll come back to CalvinS later
Khye: did you have another question?
8:30 PM
Khye k.
Yeah
just some verification, really
I need to pass a custom object between activities. Currently I'm doing this by implementing Parceable in the object and passing that.
Is that the correct usage? There's no built in way to pass an Object
CalvinS
Sorry, I was AFK...is DroidDraw the fastest way to build GUI's out there now?
Mark M.
Khye: that's certainly one approach you can use, if the objects are small. Otherwise, consider having them be stored centrally, in a Service, custom Application, or static singleton
CalvinS: DroidDraw is massively out of date and probably no longer generates valid code
there are no GUI builders for Android that I am aware of
Venu: I believe you had another question?
Venu
yes
8:35 PM
CalvinS
Thanks...guess I'll stick with the text editor.
Venu
View paste
For streaming shoutcast i used ambient player (opensource project) where they buffer the content to a 
byte array and stream through a local server. 

The player gets stuck in preparing state for android 1.6 to 2.1 and that works perfect
for android 1.5 and 2.2


The issue is documented here
http://code.google.com/p/android/issues/detail?id=7186
Please let me know if you came across a way to get the player out of the preparing state
Mark M.
No, but I didn't look, either
Venu
ok
Mark M.
I helped Marc by testing some files
that's the total of my involvement with this issue
Venu
oh ok
thanks for the info
NetApex
I saw that the next Google I/O will be May 10-11, 2011. I am looking forward to getting to meet you in person if you are going Mark.
Mark M.
heh, I already blocked it off on my calendar
NetApex
lol, likewise
Venu
me too
Mark M.
I'm going to need to figure out some way to hold some separate event there -- it's too tough to meet people in and amongst 5,000 others
but, that's a year away
NetApex
I suppose there needs to be an app for that
8:40 PM
Mark M.
only if the app unlocks Hogwart's Room of Requirement
Venu
:)
Mark M.
anyway, any other questions?
NetApex
LOL
Venu
yup
NetApex
(After Venu) Have any quick places you can point me to set mediaplayer as a service?
Venu
in the maps tutorial you got a popup on the map
please suggest how to make it similar to the popup in google maps or like one in trapster
Mark M.
similar in terms of...what?
and what's a trapster?
Venu
it is an app
Mark M.
sounds like the part of my sink that gets clogged
Venu
similar in terms like with a small point out at the bottom attaching to the clicked area
Mark M.
oh, well, that's just a push-pin, like you'll see in the Maps applications in the Android book, or in NooYawkRedux in the Advanced Android book
their pin is fancier than mine, that's all
Venu
I want the width of it change dynamically with the content shown in that
8:45 PM
Venu
how could we achieve that
Mark M.
not sure
that's actually one of the things I wanted to see how the Twitter app handles
once they release that as open source
Venu
ok
thanks for the info
Mark M.
NetApex: I haven't played with MediaPlayer in a service, though it should work just like MediaPlayer in an activity
Venu
Yes, it is same as that
NetApex
ok maybe I should ask more of a, can you point me to a "this is how to make things a service"
Mark M.
ummmm...the services chapters in The Busy Coder's Guide to Android Development?
NetApex
ok coolio (just a matter of figuring out which book I needed to start in)
I tend to get side tracked pretty easily doing this lol. Started doing dynamic text views and then added some dynamic buttons and all that fun stuff... not needed at all, but like I said, I get side tracked
8:50 PM
CalvinS
Does the Android SDK come with icons or wallpapers I can reuse in my app?
Mark M.
not so much in the way of wallpapers
but lots of icons
$ANDROID_SDK/platforms/$VERSION/data/res
(where $ANDROID_SDK is where you have the SDK installed and $VERSION is one of the installed SDK versions)
CalvinS
How can I create Live Wallpapers?
Mark M.
that has tons of resources
I haven't created a Live Wallpaper
I think there's a sample app for that in $ANDROID_SDK/samples
CalvinS
k, thanks
Mark M.
yeah, CubeLiveWallpaper is available as a sample app
CalvinS
cool
Mark M.
any other questions?
Venu
no
NetApex
not right now, gonna read over those chapters and I may have some tomorrow
8:55 PM
Mark M.
actually, it's back to the regular Tuesday/Thursday split this week
last week, I had a consulting gig on Thursday, which is why I moved it to Wednesday
next week, they'll be Tuesday and Thursday, but both in the evening
NetApex
Ahh ok sounds good
Mark M.
my schedule is starting to get icky again
Khye k.
I have a quick question before you go
NetApex
More business = more money though right?
Mark M.
Khye: go ahead
Khye k.
What behavior does the back button have on an activity? Does it call it to be paused or destroyed? So I know where to save a persistent state when I return to the activity
Mark M.
pressing BACK causes the activity to be called with onPause(), onStop(), and onDestroy()
in that order
Khye k.
Ok, thanks for your help
9:00 PM
Mark M.
well, that's all the time we have for this evening
Venu
Thanks Mark
have a good night
Mark M.
Good night, all!
Khye k.
has left the room
Venu
has left the room
NetApex
has left the room
CalvinS
has left the room
Mark M.
turned off guest access

Wednesday, June 2

 

Office Hours

People in this transcript

  • CalvinS
  • Julius
  • Khye kading
  • Mark Murphy
  • NetApex
  • Venu