Office Hours — Today, May 5

Yesterday, May 4

Mark M.
has entered the room
Mark M.
turned on guest access
May 5
2:30 PM
amb
has entered the room
Mark M.
howdy, amb!
amb
Hi Mark
Are you open for questions?
Mark M.
absolutely!
amb
cool (and thanks!)
i'm having some trouble with a MediaPlayer for a simple game
fitz
has entered the room
amb
once in a while it will throw an "illegalstate" excp
i'm playing the sound from "R.raw.file"
Mark M.
(btw, howdy, fitz!)
amb
my question is...do i have to catch the end of the sound (its short) and do anything special before calling start again?
fitz
hello
Mark M.
you have to prepare() or prepareAsync(), and you have to seekTo(0)
you'll see that in the Media/Audio sample project in the Advanced Android book
if you want it to immediately restart, or be in position to be started, after completion, you can register an OnCompletionListener
amb
ok...what about orientation changes?
2:35 PM
Mark M.
what about them?
amb
do you need to do anything special if the sound happens to be playing when android restarts you?
Mark M.
um
you will either need to create a new MediaPlayer in the new activity instance, or you can try to create your MediaPlayer using the Application context and pass it from old to new via onRetainNonConfigurationInstance()
I haven't tried the later
er, latter
amb
ok...i'll play around
THANKS!
Mark M.
happy to help!
fitz: do you have a question?
fitz
hang on - on phone
Mark M.
amb: if you have another question, go ahead
amb
ok, thanks...
i'm concerned about how my layout will look on different devices...
2:40 PM
amb
i'm worried that all my controls won't be displayed. should i make emulators with diff sized displays/dpi config?
Mark M.
absolutely
amb
is there a few setups that are good to test for?
Mark M.
those tell you what is in use, based on requests to the Android Market
amb
yep, should've remembered that...thanks!
Mark M.
beyond that, it depends on what you're all trying to target (e.g., if you're aiming to be an early winner on tablets, you'll want to test on a tablet)
amb
my friend has a xoom and i have a droid...
but in a standard emulator, my stuff ran off the bottom
fitz
ok in Advanced - you have Local Search (think it is lesson 17-19) and you have contact lookup by name, name and email etc. - question is I would like to tie local search to look into contacts only as a test - is this doable
Mark M.
fitz: presumably, though I haven't tried that particular mashup
fitz
basically tie local search to contacts on device
Mark M.
amb: if "standard emulator" is HVGA, that's not surprising
fitz
ok - will spend more time digging into it
2:45 PM
amb
right again (emulator was HVGA)
Mark M.
that'd be devices like the T-Mobile G1
they exist, but more devices are higher density/larger resolution nowadays
unfortunately, the screen sizes chart is old -- August 2010
amb
i shrunk my font a little and it fits in HVGA, so i should be ok
i'm good question-wise...thanks for the help Mark
Mark M.
sure, no problem
fitz
can I use the search to look for calendar stuff - google calendar or does google calendar not actually reside on device?
Mark M.
there is no documented and supported API for accessing any local calendar data
you'll find some folk using an undocumented/unsupported/not-recommended content provider for the AOSP Calendar app
fitz
the google calendar is not considered local right?
Mark M.
however, that provider is subject to change (and has)
and it might not exist on any given device
"the google calendar" is a Web site
local calendar apps may be syncing with "the google calendar" via GData APIs
the AOSP Calendar app is one that does
2:50 PM
fitz
so the icon for GMAIL on a droid is only bringing up a web interface?
Mark M.
no
no more than the AOSP calendar app is
Gmail is a Web site
the Gmail app is an app
the Gmail app gets data from the Gmail Web site via something or another
"the google calendar" is a Web site
the AOSP Calendar app is an app
the AOSP Calendar app syncs data with "the google calendar" via Google Calendar GData APIs
it may be that you and I are using "the google calendar" to mean different things, though
fitz
hmmm - confused a bit - so when you get a new phone in the set up if you enter in your gmail info it ties email icons to gmail - the screen that shows your email is a browser or an app - if app your saying google does not have an api for that correct?
Mark M.
the Gmail icon on the phone is an app
I am not aware of an API to access Gmail, besides IMAP and similar standard mail protocols
fitz
ok thanks
2:55 PM
amb
see you Mark (and thanks!)
Mark M.
see ya!
amb
has left the room
fitz
wonder if I should be doing major lifting of app on PC java app that comunicates with droid - hmmmm will need to think on it more
Mark M.
you lost me there
3:00 PM
fitz
forget andriod for a min - I can build java app that goes in PC that can does searchs into google api's - then package the data and send to android device. Would rather do it all on Android device but it sounds like we do not have access for gdata from device
can do search...
Mark M.
well, there's a whole conference session at I|O for accessing GData on the device, so one presumes it is possible
fitz
for example from android your saying gmail is locked down right
Mark M.
I'm saying that I'm not aware of an API other than standard mail protocols
it's not like I've done an exhaustive search on the subject
and that will be the same for the PC and the phone
GData APIs are Web services
if there is one for Gmail, you'd be able to use it from wherever, given the right credentials
if there is none for Gmail, you will be unable to use one from anywhere
fitz
ok - well we have done the gdata stuff already in c# and have app already - it is just android that makes it different :)
ok thanks
Mark M.
maybe chillax a bit on those features until the Google presentation hits YouTube
3:05 PM
fitz
ya I am sure it is a lack of my knowledge that is the problem :)
ok have a great day
fitz
has left the room
fitz
has entered the room
3:10 PM
Mark M.
hello again!
cactusmitch
has entered the room
Mark M.
howdy, cactusmitch!
cactusmitch
hello?
Mark M.
how can I help you today?
3:15 PM
Mark M.
cactusmitch: how can I help you today?
3:20 PM
cactusmitch
I'll dig into your books before I ask my dumb questions. I use Eclipse too much. I haven't found "activityCreator.py" (page 27) in my android-sdk-windows directory tree yet.
Mark M.
what version of what book are you referring to?
activityCreator.py is not in any of the current books AFAIK
that has been out of date for nearly two years, IIRC
3:25 PM
Julius
has entered the room
Mark M.
howdy, Julius!
Julius
hi
last minute
Mark M.
the chat is about to end -- do you have a quick question?
Julius
just woke up
sorta
3:30 PM
Julius
just having trouble with an app widget
the problem is sening a broadcast from tha appwidget
when a utton is clicked
fitz
has left the room
Julius
I have set up the PendingIntent and I can supply it an Intent
but I'm not sure how to make it send a broadcast
(if there isn't time no problem)
View paste
	Intent pli = new Intent(context, MyService.class);
		pli.setAction(MyService.SERVICECMD);
		pli.putExtra(MyService.CMDNAME, SDIPlayerService.CMDPAUSE);
		PendingIntent plpi = PendingIntent.getBroadcast(context, 0, pli, PendingIntent.FLAG_UPDATE_CURRENT);
oops SDIPlayer should be My :)
cactusmitch
I'm hoping for a way to use a big sqlite3 database in an app without having to enter data with "INSERTS," or "put.values" when the app is first onCreated. But that may be for another day when I have the vocabulary to ask an intelligible question
Julius
updateViews.setOnClickPendingIntent(R.id.my_imagebutton, ppi);
Mark M.
Julius: if MyService is a Service, that's not a BroadcastReceiver, so it can't receive a broadcast
Julius
can it not register to receive.. oh so maybe better to make a separate BR
Mark M.
cactusmitch: shipping a big database with an app is troublesome -- better to download it on first run
Julius: right
Julius
I set up aBRin the Service with an IntentFilter
ok I'll give that a shot
Mark M.
each channel of the Intent system (activity, service, broadcast) is separate and distinct
one cannot receive events from the other
Julius
ah
Mark M.
OK, that's it for today's chat
Julius
thank you!
nf
bfn
Julius
has left the room
cactusmitch
The one I downloaded in PDF form yesterday? Time's up for today?
Mark M.
cactusmitch: You did not download that PDF from the Warescription site. The public site, perhaps, for the free Creative Commons editions
the chat was for 2:30-3:30pm Eastern
3:35 PM
Mark M.
two more next ewek
er, week
10am Eastern Monday
4pm Eastern Friday
as I'll be attending Google I|O in between
have a pleasant day!
cactusmitch
has left the room
Mark M.
turned off guest access

Yesterday, May 4

 

Office Hours

People in this transcript

  • amb
  • cactusmitch
  • fitz
  • Julius
  • Mark Murphy