Office Hours — Today, June 29

Thursday, June 24

Jun 29
3:50 PM
Mark M.
has entered the room
3:55 PM
Mark M.
turned on guest access
Mark J.
has entered the room
Mark M.
howdy, Mark!
Mark J.
howdy howdy
4:00 PM
Mark M.
how can I help you?
Mark J.
I got a question for you, not programming/java related.
Mark M.
no, I don't know why they picked that color green for Android
oh, wait, that probably wasn't the questoin
:-)
Mark J.
Damn, I was hoping for tha cyanogen blue
:)
How many, and which, Android devices do you have?
Mark M.
let's see...in rough chronological order...
T-Mobile G-1
Google Ion (a.k.a., HTC Magic)
Motorola CLIQ
two HTC Heroes
two Motorola DROIDs
HTC Tattoo
HTC EVO 4G
Nexus One
HTC Incredible
that makes 11.5
and the ARCHOS 5 Android tablet, which I list separately because it's only a sorta-Android device, IMHO
not counting the nook, which is powered by Android, not that you'd ever know
Mark J.
Is it really?
Mark M.
is what really?
Mark J.
the nook, Android powered
Mark M.
yes
already been rooted and stuff
4:05 PM
Mark J.
Well, damn, I guess missed that news.
Mark M.
quirky when you try running regular Android apps on it, IIRC
Mark J.
So, which device would you say is your favorite?
Mark M.
that depends on whether you take carriers into account, and the uses of the device
my day to day phone is the Nexus One, because it runs on T-Mobile
Bonnie C.
has entered the room
Mark J.
Okay, so it gets the most use?
Bonnie C.
Hello
Mark M.
as a quasi-tablet, the EVO 4G has a pretty slick screen, though the battery life leaves something to be desired
for personal stuff, yes
howdy, Bonnie!
Danny B.
has entered the room
Mark M.
and, howdy, Danny!
Danny B.
Hi there.
Bonnie C.
Hi everyone :)
Mark M.
Mark: did that answer your question?
Mark J.
Yeah :P, I will keep myself quiet for a little bit
GO ahead and move one :)
Mark M.
OK, Bonnie, did you have a question?
Bonnie C.
Yes, although it's probably very basic. I'm sort of learning Java as I'm learning Android.
I'm doing one of the tutorials right now.
Brian C.
has entered the room
Bonnie C.
It's page 19-20 in the Tutorial book.
I'm not sure why but the code doesn't run because there's an error with onSave
Mike R.
has entered the room
Mark M.
first, which version of the book do you have? check the cover page
Mike R.
Hi
Mark M.
(btw, howdy, Brian and Mike!)
Brian C.
Hi, everyone.
Bonnie C.
Version 2.8
4:10 PM
Mark M.
OK
Bonnie C.
Is it because it's for Android 2.2 and I'm using 2.1 because my phone's got the 2.1 OS and I'm testing on it?
Mark M.
No, the tutorials all work with 2.1 -- I recommend 2.1 for this edition of the book
Bonnie C.
Ok
Mark M.
when you say "there's an error with onSave", what is the error?
Bonnie C.
onSave cannot be Resolved
Mark M.
that means you do not have onSave in your source code
Mike R.
has left the room
Mark M.
onSave is defined in the box at the top of page 20
you can also see the whole project in its entirety on github
Bonnie C.
Ok
Mark M.
Let me take some questions from the others, then I can circle back to you if you are still having trouble
Danny: do you have a question?
Danny B.
I have a nonstandard question. I'm porting an application called RoadMap. It's already a multiplatform app - several unixes, Windows CE, iphone, .. - and I'd like it on Android too. Written in C so I'm using the NDK and rewriting the portability layer. It's well written but Android is somewhat different, and I'm still learning about Android :-)
Bonnie C.
Ok
4:15 PM
Danny B.
So let me cut it into something you might want to think about.
I have a periodic event that I'm causing to happen by using sendMessageDelayed, and then sending it again from the handler.
Inside the handler I'm (re)drawing stuff, and they appear only partially; it looks like during the (re)draw, part of the previous drawing remains, then it gets erased, and then only half of the drawing is visible until the next handler call.
And I am wondering what's causing this :-)
Mark M.
well, I have not done anything with low-level drawing primitives
hence, I haven't a clue
Danny B.
Fair enough. Thanks. On to the next, I'd say.
Mark M.
bear in mind that drawing events, like anything else, wind up as messages on the message queue
Danny B.
Yes...
Mark M.
hence, it may be that not enough of your drawing events get processed before your next sendMessageDelayed() is triggered to run
you might want to look at how games are written (e.g., the LunarLander sample app)
4:20 PM
Danny B.
I would be able to eliminate that by lowering the frequency, right ?
Mark M.
in principle, yes
OK...Brian, did you have a question?
Danny B.
Already tried that, it doesn't :-( I did browse the LunarLander, but your suggestion may be a good one - I'll disect it more, and one or two other tutorials. Again, thanks.
Brian C.
yes, need some advice
If I have a series of listviews, and the selcetion from the last is ultimately the value I want to return to the activity that started the selection, would you do that in a viewpflipper or as a series of startActivityForResult calls?
Mark M.
um
Brian C.
like, say I want to select a city from somewhere in the US for use in my app, and I start with a listview of regions, then use that to determine which data to present in a listview of states
then drill down to city
get my drift?
4:25 PM
Mark M.
yes, I get your drift
Danny B.
has left the room
Mark M.
my gut is to use activities
I am somewhat nervous about too deep of a chain of startActivityForResult() calls
however, I have never tried that
Brian C.
so, I'd like to have the back button work to back up if the selection was a mistouch, which would work well as a series of activities, then I guess I'd just need to finish() each activity in the onResult method?
Mark M.
onActivityResult(), yes
Brian C.
or, I could use a ViewFlipper and intercept the back key event was my other thought
Mark M.
with the ViewFlipper, you'd override the BACK button with onBackPressed() (or onKeyDown() for Android x.1)
and have it flip you back a level, or do the real BACK processing if you're at the top
my concern there is having a very fat activity, in terms of heap space
Brian C.
Yes. It could potentially be quite large with all the cities loaded in the one activity
Mark M.
I'd probably start with the chained set of activities, then look to coalesce into one if that causes problems
Brian C.
OK, thanks for the advice
Mark M.
and on a completely unrelated note, ESP 1, POR 0 in Whirled Cup, meaning my current host country is in a state of mourning right now
OK...Mark, do you have a question?
Mark J.
Nope, just trying to figure out AsyncTask, I will let you know if I do.
4:30 PM
Mark M.
just be sure to let me know from onPostExecute()
Bonnie: did you solve your onSave problem?
:-)
Mark J.
If I can make it that far :)
Bonnie C.
Yes, I just copied and pasted. My problem must have been a simple typo on my part :)
Mark M.
ah, OK. Any other questions, while it is your turn?
Bonnie C.
Nothing for now. I'm just absorbing all the tutorials.
Mark M.
OK...Brian, any questions?
Brian C.
No, I'm good, thanks
Mark J.
I have one: Favorite Applications?
Mark M.
OK, well, if any of you come up with a question, chime in!
well, I'm not the most typical Android user
Bonnie C.
I just got my phone and am having trouble getting data through Fido.
4:35 PM
Bonnie C.
From what I gather online, it could be something to do with the Rogers update.
Mark M.
notables on my Nexus One beyond the typical apps: Ambling BookPlayer (excellent audiobook app), KeePassDroid (password safe), Remember the Milk, StreamFurious Pro, and the TripIt client
Bonnie: sorry to hear that!
Bonnie C.
I might be simply forced to download and install the Rogers update (Rogers owns Fido).
I'm going to ask next time I'm in the store.
I have a question/suggestion about the game Replica Island.
The source has been put online.
I'm trying to learn game development. Mark, if you can, would you be able to go through the code and explain/document it for training purposes?
Mark M.
Not a chance
Bonnie C.
Aww ok :)
Mark M.
I haven't done 2D game development in about two decads
at least, not until 2011 sometime
er, decades
suffice it to say, I'm a wee bit out of date on the subject
Bonnie C.
That's alright, it was worth a shot. I hope someone doe sit.
*does it
4:40 PM
Mark M.
you'll find bits and pieces of info on the author's blog: http://replicaisland.blogspot.com/
however, it looks reasonably advanced, in terms of subject matter
Bonnie C.
Yeah, I checked it out.
Brian C.
You might reach out to Leigh McRae from lonedwarfgames.com also, Bonnie.
Bonnie C.
I'm looking for a book or mentor that will bring someone from a beginner to the advanced level.
Thanks
Mark M.
I have not read _Pro Android Games_, though I seem to recall it getting some favorable reviews
Bonnie C.
I just ordered that.
But according to the review, the author assumes the reader has experience developing games.
While I could read books on game development, I heard you need to design games with Android in mind from the very start, or you'll need massive redesign.
So I'm looking for reading material (beginner level) that does both.
Mark M.
ah
Bonnie C.
I'll see if I can contact Leigh McRae
Thanks for the tip :)
4:45 PM
Mark J.
Alright well, I have a question, it may take a minute to explain though
Well actually it's a few questions.
Mark M.
fire away
Mark J.
Alright well, as I said, I was looking at AsyncTask, Do you that this would be an okay solution for RSS? So it does not lock up the UI Thread?
Or should I try a service?
Mark M.
bot
er, both
4:50 PM
Mark M.
Services are "background" in that they do not have a UI
Services are not "background" from a threading standpoint -- they run on the main application thread by default
Using an AsyncTask invoked by a Service to fetch your feeds is a fine strategy
It is similar to the Service/WeatherPlus sample in The Busy Coder's Guide to Android Development
Mark J.
Alrighty, I will take a look at that, I will update you if I have more questions :)
4:55 PM
Mark M.
any last questions?
Bonnie C.
I have another tutorial question
Mark J.
What color is the Android logo?!?! :P
Bonnie C.
lol
Mark M.
#A4C639
Bonnie: go ahead
Bonnie C.
In the Busy Coder's book, I was doing the tutorial named 'Now' with the button that updates the date.
In the last line of the book's code, there's nothing in the constructor for Date()
This brings up an error in my compiler. It expects an int.
5:00 PM
Mark M.
There are six possible Date constructors
One takes no parameters, and results in a Date object representing the current date/time
Make sure you are using java.util.Date and not java.sql.Date
Bonnie C.
Ah, that's probably it
Mark M.
yeah, I wish the Java folk had not created two Date classes
a long time annoyance
Bonnie C.
Hehe :)
Thanks, that fixed the problem.
Mark M.
and that wraps today's chat
Mark J.
Alright, Seeya next time Mark
Mark M.
Thursday will have another chat at the same time -- 4pm US Eastern, 1pm US Pacific, 9pm Portugal
Bonnie C.
I only took one community college class of C++ a couple of years ago.
Mark M.
have a pleasant evening, everyone!
Bonnie C.
Thanks :)
Mark J.
has left the room
Bonnie C.
has left the room
Brian C.
has left the room
Mark M.
turned off guest access

Thursday, June 24

 

Office Hours

People in this transcript

  • Bonnie Cheung
  • Brian Cooley
  • Danny Backx
  • Mark Johnston
  • Mark Murphy
  • Mike Renda