Office Hours — Today, March 11

Yesterday, March 10

Mar 11
3:55 PM
Mark M.
has entered the room
Mark M.
turned on guest access
4:05 PM
Tejas (.
has entered the room
Tejas (.
Hello !
scottt
has entered the room
Mark M.
howdy Tejas & Scottt!
Tejas (.
Hi Mark ! I'm awesome. Just had couple of fundamental questions
scottt
hello
Mark M.
Tejas: go ahead
Tejas (.
View paste
A service also runs on the main or the UI thread. Right ? So, if a service executes a blocking operation without a worker thread (and when no other components are running), would it throw the ANR dialog ?
Mark M.
hang on...
Tejas (.
sure
4:10 PM
Mark M.
sigh, phone call came in moments after I opened the chat room...
anyway, I'm back now
Tejas: the lifecycle methods of a service (onCreate(), onStartCommand(), etc.) are called on the main application thread
whether or not you'll get an ANR dialog will be determined whether there's an activity of yours on-screen at the time, I think
if the service is purely in the background, I suspect it will just log to LogCat
I know that's how it works for manifest-registered BroadcastReceivers
I am guessing a service will work the same
Scottt: do you have a question?
scottt
how are your other books, "Beginning Android X" etc, positioned relative to the BCG ones?
Tejas (.
ok so an application has a service only (no activity) then there shouldn't be any need to spawn a worker thread to perform long tasks.
Mark M.
scottt: Beginning Android 2 = The Busy Coder's Guide to Android Development Version 2.9
same content, different cover
Tejas: I'd still use an IntentService and get the work in a background thread. Calls on the main application thread execute at foreground priority, and so you will tie up the CPU.
scottt
gotcha, thanks
Mark M.
hence, you might slow down the frame rate of the game the user is playing at the time
4:15 PM
Tejas (.
ok. I get it
Mark M.
scottt: do you have another question?
scottt
mostly using your book(s), i have my first mini app about to publish (mostly just some help/about content left to do)...
Mark M.
cool!
scottt
but if i open up the running apps subdialog, i notice my app is stil listed there
Mark M.
are you referring to in the Settings app?
scottt
yes
Mark M.
let me run a test...give me a moment...
scottt
i dont have any app-launched services and i remove my timer (Handle) callbacks and shutdown my TTS "connection"
4:20 PM
Mark M.
what does it have listed underneath your app name?
for example "1 process and 1 service"
?
scottt
checking...
listed where? there's nothing like that in the running app screen or the running services screen
Mark M.
there is on my Nexus S
maybe it's a 2.3 thing
what are you using for this test?
scottt
htc EVO 4G running stock 2.2
Mark M.
hold on while I boot my EVO
scottt
perhaps there's something relevant in DDMS that will give me more info?
Mark M.
not that I am aware of
yeah, OK, what I want is only on 2.3
scottt
do i need to delete the saved state data manually?
4:25 PM
Mark M.
what "saved state data"?
scottt
i havent tried leaving it to see if its just a matter of waiting for the GC to run
a few vars saved in onSaveInstanceState()
Mark M.
no, that Bundle gets cleaned up for you
frankly, I think the EVO's Running Applications tab is just borked
getting strange results on mine
you might try running your app on the 2.3 emulator and see what happen
er, happens
scottt
i notice other things seem to be listed as running but shouldnt be. often with 0 ram etc
Mark M.
right
scottt
ok. i'll try that
Mark M.
Tejas: do you have another question?
Tejas (.
I'll sneak in one quicky : Apart from IntentService and AsyncTasks, does android provide any other thread related construct ? [apart from manually using the Thread class]
scottt
its probaby not an actual issue, but i worry that there'd be a bad perception issue with users
go ahead tejas
Mark M.
Tejas: well, there are a variety of things that will do stuff asynchronously for you (sensors, locations, MediaPlayer's prepareAsync(), etc.)
in terms of a thread-like construct that you manage yourself, Android specifically has IntentService, AsyncTask, and HandlerThread
Tejas (.
yes, but those are for specific purposes right
Mark M.
plus, there's the thread pool stuff in java.util.concurrent, though that is not unique to Android
well, it depends on how you define "specific purposes"
4:30 PM
Tejas (.
Also, for AsynTask I see the limitation that one instance of AsyncTask can only be executed once. What if I need to call the task multiple times ?
Mark M.
You don't
you create new instances of your AsyncTask subclass
Tejas (.
yup. got it
Mark M.
scottt: do you have another question?
scottt
not at the moment
Tejas (.
something non-technical. Mark, you may not have an answer, but may be able to provide some insight or just discuss !
Mark M.
um, ok
Tejas (.
I see that there is no Intent documented to receive SMS
Mark M.
correct
Tejas (.
but still there is a permission documented for it
Mark M.
also correct
I'm guessing that you're not quite sure how we wound up in that state
Tejas (.
this confuses me ! have they missed on documenting the receive SMS Intent
Mark M.
not exactly
see, way back in the dawn of time, otherwise known as 2006 and early 2007, there was no Android SDK
4:35 PM
Mark M.
they weren't thinking of third-party apps at first
when they decided to add support for third-party apps, they needed to come up with a dividing line between what was part of the SDK and what wasn't
some of that worked out reasonably cleanly
sometimes, they made odd decisions
Tejas (.
ok, but should we be using the undocumented Intent or not !
Mark M.
um
Tejas (.
if not, why is the permission still there !
Mark M.
well, there are lots of permissions in the system, even the SDK, that are not relevant for SDK apps (e.g., BRICK)
in terms of whether you should use that undocumented Intent, it is probably the safest undocumented item in all of Android
using undocumented stuff is never a good idea, but receiving SMSes is unlikely to change
that's why I cover it in the SMS chapter of the Advanced Android book
Tejas (.
ok thanks
scottt
<suggestion> perhaps a page on TTS would be a good addition to the books. its easy to use and has a bit of a "wow factor" </suggestion>
Mark M.
TTS is on my list of things to write about someday
it's a long list
right now, it's all about Honeycomb
scottt
i imagine it is
Mark M.
any other questions?
scottt
meh. i plan to ignore 3.0 for a while. i dont think the numbers will be there in 2011
Mark M.
I wouldn't rush, but starting to think about fragments is not a bad idea
with the Android Compatibility Library, they work back to 1.6
4:40 PM
Mark M.
bear in mind that some of the Honeycomb UI stuff may wind up on phones as part of Ice Cream Sandwich
Tejas (.
not from me.
Mark M.
if so, 3.x UIs will sell in some quantity in the second half of 2011
scottt
yeah. as the hw races forward, the platform sw can do more
and there'll probably be a need to compete again webos more as hp starts pushing it
against
Mark M.
I'm still fairly skeptical on the WebOS front, if only because HP doesn't have a great track record of pushing phones
we'll see how their tablet does
while WebOS may get loaded on HP PCs next year, it's unclear what that will mean, exactly
Windows Phone 7 is probably the more immediate challenger to the iOS/Android smartphone momentum
Tejas (.
what do you think of the Chrome OS
Mark M.
haven't played with it
Tejas (.
i got the CR48 last month
Mark M.
been using it for much?
scottt
true. IMO hp has been a lot like motorola. outstanding hw, but lack-luster sw. but with the purchase of palm and staff, perhaps...
Tejas (.
I'm still not able have an opinion yet !
yes, at least use it once daily
4:45 PM
Tejas (.
the only value I find it (as of now) is that if you loose it, you are worry free of any data
otherwise its just a Hardware Browser :)
Mark M.
right
Tejas (.
i cannot imagine myself going out just with that book. I need my laptop
Mark M.
one possible interesting use case for Chrome OS would be in the way Motorola is handling the ATRIX and its "Lap Dock"
Tejas (.
as an external Keyboard ?
Mark M.
the lap dock gives you desktop Firefox alongside what amounts to a VNC client of your phone
Tejas (.
and a bigger screen
oh.. ok
Mark M.
that could, in theory, be Chrome OS alongside the phone
scottt
i find myself moving more and more to phone use versus lap/desktop. mostly cuz i nearly always have it on my person
and it's hard to fit any bigger in my pocket
Mark M.
clearly, you just need bigger pockets
:-)
Tejas (.
:)
scottt
lol. i havent even been able to justify (to myself) getting a tablet. unless i plan to dev for it, then heck yeah
Mark M.
the XOOM is nice but presently pricey
by the latter half of the year, I would expect more Android tablets to be lower in price
scottt
very pricey. and it cant make ph calls
Mark M.
not sure how many Honeycomb tablets will have telephony
4:50 PM
Mark M.
now, you don't need to be a phone to have Android Market
even the Samsung Galaxy Tab technically was a phone, just missing the dialer
Tejas (.
does the Xoom sync with any Android phone
Mark M.
XOOM syncs with the cloud
scottt
i'm thinking there's a niche for a ph dock that gives kb and larger screen (is that what the atrix is?)
Mark M.
Android phones sync with the cloud
yes, that's the ATRIX and the Lap Dock
Tejas (.
i know, but what about SMSs
Mark M.
netbook-sized keyboard/screen
Tejas: no Messenger client on the XOOM, since it does not receive or send SMS
hence, that would remain on your phone only
Tejas (.
the WebOS presentation showed that the tablet and the phone sync messages and even make calls from tablets
Mark M.
ah, probably via some Bluetooth connection or something
scottt
what ever happened to the virtual keyboards that used laser (?) projection?
Tejas (.
I guess even the Blackberry PLaybook is doing the same
Mark M.
scottt: I know what you mean, haven't seen one in action
Tejas: it's a reasonable move, and there's not much stopping Android from offering that, but I don't think it's in Honeycomb right now
Tejas (.
may be we can write app that syncs SMSs ! :)
scottt
why wouldnt it be in honeycomb? wouldnt the ph stuff still be in there waiting for hw?
Mark M.
scottt: routing calls/SMSes to some other device (e.g., phone) via Bluetooth or something is what's not there
4:55 PM
Mark M.
a Honeycomb tablet presumably could do telephony natively via the GSM/CDMA chipset
however, since it's no longer a requirement to get the Android Market, fewer than 100% of tablets will offer it
Tejas (.
anyways ! Thanks Mark. I'm calling it a day ! Have a nice weekend
Mark M.
you too!
Tejas (.
signing out
Tejas (.
has left the room
scottt
yeah, i'd just have the ph stuff builtin. and ship a cheapo wired headset wwith it. most users would prob add on a bt one
i suppose this stuff will come with competition
look ma -- my phone is as large as a textbook
5:00 PM
Mark M.
well, that's a wrap for today's chat
two scheduled for next week
scottt
ok. thanks. have a good we
Mark M.
including another one at the 4pm Eastern time slot, Tuesday
have a pleasant weekend!
scottt
has left the room
Mark M.
turned off guest access

Yesterday, March 10

 

Office Hours

People in this transcript

  • Mark Murphy
  • scottt
  • Tejas (advantej)