Office Hours — Today, November 23

Tuesday, November 16

Nov 23
3:50 PM
Mark M.
has entered the room
Mark M.
turned on guest access
4:00 PM
Suzanne A.
has entered the room
Mark M.
howdy, Suzanne!
Suzanne A.
hi mark
Am I the only one here, other than you?
Mark M.
presently, yes
that might change
Suzanne A.
ok. may I ask a question from our dev forums?
ok :)
Mark M.
sure
if you want, just paste in a link
Suzanne A.
It's on Contacts. Is the issue on our side, or his?
Mark M.
well, I haven't tried ACTION_PICK with a content type instead of a Uri
4:05 PM
Mark M.
didn't know that worked
4:05 PM
Mark M.
in fact, the more I ponder, I'm a bit surprised it does
Suzanne A.
yes, I wasn't sure either
it's on the data level, right?
Mark M.
not sure I understand that question
Suzanne A.
In 2.0+, Contacts has 3 levels ... data, raw, and contact
at least, according to the Android docs
Mark M.
oh, yeah, well, you just blew past my limited comprehension of the new Contacts system
the old system was bad enough
the new one gives me a headache just thinking about it
Suzanne A.
I know :-)
Me too :-)
I think what he's trying to do is display only contacts with a phone number
Is there a new/old way that works?
Mark M.
via ACTION_PICK, not sure
if you have the READ_CONTACTS permission, then definitely
Suzanne A.
So maybe that's our suggestion to him ...
Mark M.
the Contacts/Spinners sample out of the Advanced Android book demonstrates it, for old and new APIs
Suzanne A.
right, and I ran it on a DROID X, and it was fine
Mark M.
the real question is: is what he's trying to do actually supposed to work?
Suzanne A.
My guess is that our Blur syncs are changing IDs, and that's why he's getting a null back
Mark M.
his phrasing suggests that he has an app on the Market, and that it's working for other devices
Suzanne A.
I haven't seen it in any docs, articles, or samples
Yes, but developers tell us that all the time, to get us to debug their apps
Mark M.
oh, that's likely
Suzanne A.
"My app works on all devices except Motorola X .. "
I mean, who do they think I am? You?
Mark M.
heh
Suzanne A.
yeah
4:10 PM
Mark M.
the last entry on there suggests a private message to you
did he send you an APK?
Suzanne A.
Yes, he sent me a pm, but no apk yet
Most I can do is run his APK on two devices and if needed, file a bug
But our Contacts has gone into maintenance ..
so it's unlikely to be fixed
so I'm looking for a coding technique for him
Mark M.
ah
here, somebody is using an Intent with that MIME type
but they also set a Uri
Suzanne A.
oh, so it is okay
right !!
you're a genius ..
so I'll refer him to that
Mark M.
here's another reference to the same concept: http://groups.google.com/group/android-dev…
Suzanne A.
ok, thanks
Mark M.
I just Googled on setType(ContactsContract.CommonDataKinds.Phone.CONTENT_TYPE);
those links and others showed up
Suzanne A.
ok
I'll google that too and see what else is there
I think we should just refer these devs directly to you
Mark M.
oy
Suzanne A.
To buy WareScriptions and use your chats. Yes?
oh?
Mark M.
sorry, I thought you meant direct emails
Suzanne A.
no, I want them to pay you :-)
Mark M.
Motorola is certainly welcome to refer people my way, and I certainly would appreciate such referrals
if I were in Motorola's shoes...well, I'd want to ponder that approach
Suzanne A.
why so?
Mark M.
I suppose it's better than just having threads tail off and moulder
Suzanne A.
Well, our direction is not to do 1-1 consulting, because our support is free
Mark M.
understood
4:15 PM
Mark M.
perhaps it's just a matter of messaging
Suzanne A.
yes
So I'll refer him to those links, thanks so very much
Mark M.
no problem
Suzanne A.
And I'll mention to Lisa that we might to message what we do/don't do on forums
And/or refer devs to you, for WareScriptions, not direct email
Mark M.
yeah
Suzanne A.
I once spent 12+ hours debugging some guy's widget ..
He claimed it worked on all devices but DROID 2
Man, what a lesson
Mark M.
the key really is getting the developers to demonstrate that the problem exists on some MOTODEVICE but works fine on others, and that would typically require an APK
Suzanne A.
Right
Only thing is, if they do send it, and we do reproduce ..
We can't always get a fix anyway
Mark M.
true, but it gets back to messaging
Suzanne A.
Yes, entirely right
Mark M.
if the problem truly exists on a MOTODEVICE, then you're in normal MOTODEV support territory
if the problem exists on other hardware, you can steer them to StackOverflow or me or [android-developers] or wherever
Suzanne A.
Right
Mark M.
and, if they do not supply an APK, that's their own fault
Suzanne A.
I'm leaning how to handle these
Yes, I agree
Mark M.
it's why I always recommend attaching a project to an issue on b.android.com
same sort of thing applies here
Suzanne A.
b.android.com? bug site?
Mark M.
yes
issues seem to get incrementally more love if they are replicable
Suzanne A.
yes, that's the way of software engineering
4:20 PM
Mark M.
alas, "software engineering" is a foreign concept to many developers
Suzanne A.
yes, especially those who build consumer apps, right?
Mark M.
for me, it seems more a question of background and scope
firms tend to be pretty decent
Suzanne A.
right, but individuals?
Mark M.
that depends on where they've worked and how much they internalized the process
or, whether they had to respond to public issue trackers... :-)
Suzanne A.
right
Mark M.
on the whole, at least in Android, a lot of the solo developers are pretty new to all of this
Sean S.
has entered the room
Suzanne A.
So the second link you sent
Mark M.
howdy, Sean!
Suzanne A.
Doesn't have a URI? Is that recommended?
Sean S.
Hi Mark!
Mark M.
Suzanne: oh, you're right
never mind that
sorry
Suzanne A.
Ok. You've been a great help
Have a wonderful holiday, talk soon
Mark M.
Sean: do you have a question?
you too!
Sean S.
Yes, I do, just a sec
It's about what the best practice would be to accomplish a particular task in Android.
Mark M.
um, ok
got a task in mind?
or can I pick one? :-)
Sean S.
I'm starting an app which will access information on my car's computer
4:25 PM
Sean S.
It will have a lot of different functions
let's take one, a map for example.
I may display the car's location on the map on the phone.
Suzanne A.
has left the room
Sean S.
I have an icon on the map representing the car.
I want to click on the icon and let the user choose from many Tasks (to use an Android term I've found in the documentation)
Mark M.
I really doubt you want to choose from Android tasks, but go on
Sean S.
so, each item in the list that the icon pops up will let the user perform a specific Task
for example, tasks might be, "find nearest" or "unlock doors" or whatever
but I decide to release this app and only some of the tasks are done.
brack
has entered the room
Sean S.
I am thinking of writing each "task" as a separate application, with no icon
Mark M.
(btw, howdy, brack!)
Sean S.
An intent will launch the Activity for that "task"
brack
(hello again, Mark!)
Mark M.
Sean: so far, that all sounds reasonable
Sean S.
So when the user starts the app, the app that shows the map goes to the web and discovers that "unlock doors" is now complete and ready as an app
and at this point I'd love to have my app start a download in the background and install that app but I know that is not possible yet.
4:30 PM
Mark M.
well, you can do the download and kick off an install, but it won't install "quietly"
the user will still go through the permission check and such
Sean S.
Right, and it annoys the user.
Mark M.
:: shrug ::
only if they are not expecting it
that's a question of messaging
Sean S.
so I would wait until the user clicks the icon and I would display, "unlock doors"
but when the user clicks that, I would say, "hey, this feature is available, but will take a few clicks to install, wanna do that now?"
basically, what I'm trying to do is extend my app as features become available, rather than constantly bug a user to install a new version, for a feature they might not even care about.
Mark M.
that sounds great
Sean S.
Where is Android as far as making this kind of use case possible/?
Mark M.
in fact, in 2011, if nobody else solves it, I have plans on tackling this very problem
well, it's mostly there
you need to call out to a Web service or download a page or something to determine which of your plugins are ready
that will drive your list which has the "unlock doors" option
Sean S.
I think we're talking about a module system. hate to reinvent something.
Mark M.
sorta
these are all really standalone apps
they're just not designed for independent distribution on the Android Market
by "standalone", I mean they are APK files
Sean S.
there is no concept for a "plug-in" for android yet, is there? all have to be standalone?
Mark M.
well, the easy path is standalone
there are some hooks in there to download what amount to JARs of Dalvik bytecode
haven't tried them
Sean S.
I assume they are in the proprietary API
Mark M.
no
Sean S.
really!
4:35 PM
Mark M.
dalvik.system.DexClassLoader
again, though, I haven't tried it
your kilometerage may vary
Sean S.
I will have to look at that one and see what restrictions there are
Mark M.
yeah, classloaders are tricky, even in regular Java
I can't imagine it is somehow easier on Android
anyway, let me take a question from brack, and we can swing back to you for followup if needed
brack: do you have a question?
Sean S.
and the other option would be to have that feature sit there on the Android market as an application that one can purchase. The problem is that as a "plug-in" it would not have a visible icon; if people bought it I suppose the first thing it would do when run (if the user figured out how to start it) would be to tell them to download the rest of the app
OK, go ahead. I'll stand by
brack
yep, quick one, hopefully
right now I have a service that uses a MediaPlayer. the big issue right now is that when i scroll, say, a listview, it lags the audio very badly
i'm assuming the service isn't getting enough cpu resource
Mark M.
that's very possible
are you using startForeground()?
brack
that's in the service, right?
Mark M.
yes
brack
i don't know if i actually added that, no.
damn, i looked at that too. you think that'll do it?
Mark M.
I *think* that might keep your service in foreground priority
brack
wasn't sure if it was that or threading, or if i needed to create a remote service and run it in a separate process
4:40 PM
Mark M.
hopefully neither of those
brack
yeah heh
Mark M.
try startForeground()
brack
thanks- will lurk for a bit while i try this. appreciate it
Mark M.
no problem
Sean: there's a middle ground between DexClassLoader and APK-on-the-Market
you can always download and kick off the installs of APKs yourself
this still puts an icon in their Settings > Applications > Manage Applications screen
Sean S.
I'm OK with the icon in settings, just not in the main app list
Mark M.
just don't create an Activity with a LAUNCHER <intent-filter>
Sean S.
when you say "you can download" do you mean "you" as the user or "you" as the application?
Mark M.
"you" as the application
Sean S.
How would my app do that?
Mark M.
ummm...HTTP GET, presumably
Sean S.
because that sounds good enough. my app will look to see if the plug-in is installed, and if not, install it
Mark M.
then an ACTION_VIEW Intent with the APK MIME type
you could do an ACTION_VIEW on the APK URL directly, but I think the user needs to do an additional step as part of the install
Sean S.
That sounds very promising, I will give that a shot
4:45 PM
Mark M.
you will have to deal with updates yourself
brack: do you have another question?
brack
yeah, i was generally curious about the seekbar and if you can disable trackpad interaction
Mark M.
usually, no
either it is enabled (touch plus d-pad/trackball/whatever) or it is not
brack
roger. main issue is that it's hooked up to a media player, and the movements with the trackpad seem to lag it out
Mark M.
you could subclass it and try to eat the events
brack
nah, i'll just put a limiter on the callback for adjusting the seek position
thanks, that answers that one. appreciate it. how long are you online? till 5?
Mark M.
yes
Sean: got another question?
Sean S.
yes
4:50 PM
Sean S.
let's say I use the "plug-in" approach to sell a feature at the point it is needed. The user is directed to the market to install the plug-in. I see several problems with this: (1) the plugin has no LAUNCHER, so if someone buys it wituout the app they will not be happy and (2) how to return to the app once the plug-in is installed
Mark M.
(2) is the user pressing BACK
(1) is indubitably a problem
which is why I am hoping we in the community can work out a plugin mechanism, with an update manager, for this sort of thing
Sean S.
both significant user experience problems
I am looking for a project just like that!
where is this being discussed?
I guess I mean, is the community already discussing this, and if so, where?
Mark M.
by the voices inside my head
:-)
it's an itch I will need to scratch at some point, if nobody else scratches it
I am not aware of anyone working on something quite like this, though it's a big community
brack
that actually sounds really interesting, a plugin updating manager (if I've been reading correctly)
Sean S.
Well, I will put it on my own short list of things to research.
yes
I believe OSGi is meant to do this
Mark M.
my personal itch will be for more of a general non-Market-APK updating manager, but it could be applied for plugins as well
4:55 PM
Mark M.
I know some people have been poking at Apache Felix vis-a-vis Android
4:55 PM
Mark M.
however, OSGi feels like engineering-by-committee
Sean S.
right, that is my concern too
it would need to be something that can be done in pieces or it will be too big and never get done
Mark M.
OK, our time is running out -- any last questions?
brack
one quick one if you have a sec: does it matter where i call startforeground?
anywhere in the service OK, or does it have to be in startCommand
Mark M.
sometime before you need foreground priority
brack
gotcha; great, thanks!
Mark M.
since it puts an icon in the launcher, I'd do it at the point the user did whatever it was that caused your service to need foreground priority
that way, user sees cause-and-effect
versus an icon appearing out of proverbial nowhere
er, not icon in the launcher
icon in the *taskbar*
wow, I need sleep
brack
right- yeah. that's what i'm doing now
haha
Sean S.
if brack has no others I might ask: I'm on the Java ME executive committee for the JCP, watching the SE/EE vote on SE7/SE8; do you have any opinions on Java's future with Oracle? anywhere you'd prefer it to go?
brack
i was curious because it didn't help, but i'm wondering if i need to call that out before I do the media player initialization, etc
but that's all for now, I may check in for tomorrow's hours once i play with threading and separate processes
Mark M.
brack: sounds good!
Sean: my arms are too short to box with Oracle
brack
thanks again. cya later guys
Sean S.
thanks! bye!
brack
has left the room
Sean S.
a great answer to my last question. I need to realize that myself. take care.
5:00 PM
Mark M.
see ya!
Sean S.
has left the room
Mark M.
turned off guest access

Tuesday, November 16

 

Office Hours

People in this transcript

  • brack
  • Mark Murphy
  • Sean Sheedy
  • Suzanne Alexandra