wayne piekarski: hi, there. it's time to start writingapplications for android auto. i'm wayne piekarski from google. and today, i'm goingto show you how easy it is to extend yourexisting messaging
Android auto, application tosupport android auto. the android auto softwareruns on your phone and is responsible for drawingthe user interface that appears on thevehicle's display here.
so the phone connects tothe vehicle via usb cable. and if you want to learnmore about how this works, you should check out our"introduction to android auto" devbyte. android auto providesextensions that allow you to easily integrateit with your existing messaging application. these extensions allowyou to use a voice control interface optimizedfor use in a car.
you can use voice controls toreply to message notifications without having totype on your phone. this is great, becausethe user's driving a car, and they needminimal distractions, and they need to keeptheir eyes on the road. and best of all,android auto takes care of all the hard parts ofspeech recognition for you. you just need to add afew extra lines of code. oh, look.
here's a message frommy colleague brian. let's see what he has to say. [bing] android: here's the message. "you're late for the studio." wayne piekarski:reply to message. android: say your message. wayne piekarski: i'll bethere in five minutes, brian. android: here's your message.
"i'll be there infive minutes, brian." do you want to send it? wayne piekarski: yes. android: sending message. wayne piekarski: all right. well, let's headoff to the studio. right now, your existingmessaging application will use notificationobjects to tell the user when a message has arrived.
so the notification is going tocontain the text of the message and providing an intent torun when the notification is selected on the user's phone. so this is whatyou already have. now, what i'm goingto show you now is how to add some simplenotification extensions to your notification objects toget android auto functionality. to enable the ability to replyto messages from the car, the first thingyou need to do is
to create aremoteinput instance. and this is going to beresponsible for receiving and processing audioinput from android auto. a speech recognizer isused on the spoken audio, and the notificationsystem will then deliver this as a plain stringto an intent that we provide. if you've ever done anyandroid wear extensions before, you'll notice thisis very similar. next, we need toprovide to android auto
the contents of anyunread messages, so that it can readthem out to the user and possibly take a reply back. to do this, you firstly createa new unreadconversation object from the carextender classand provide four pieces of information-- thename of the person who sent the message,a time stamp, an intent to indicate whena message is read, and a reply action usingthe previous remote input.
your messagingapplication will right now contain an array or alist of existing messages. and you'll writea full loop that traverses through everyunread message from the sender and add them to thisunreadconversation object. now you need to take yourexisting notification code and add the carextender andunreadconversation objects, and then issue the notificationas you would have done before. and that's basicallyit from the java side.
so you can takeyour existing code, and by adding a fewextra lines, you get android autofunctionality as well. so to finish up,your application needs to tell android autothat it supports notifications via carextender. so to do this, you will need toset up your androidmanifest.xml to reference an xml filewith an automotiveapp tag along with anotification attribute.
now, to test yourapplication, we provide a messagingsimulator that looks very similar tothe car experience. so you can run thesimulator on your phone or in the androidemulator to test that you're usingthe api correctly. it captures the notificationsand supports the carextender extensions. and this is great fortesting at your desk
while you're doingthe development cycle. as you can see, thefundamentals of your application remain the same here, butyou added some very simple extensions to yournotification objects to get android auto features. this means it'll be reallyeasy to extend your existing messaging application andto get it out to your users. and what's great aboutthis is that the same style of extensions used in androidauto are used for android wear
as well, which shows youhow extendable the android notification system is andhow easy it is to get started. so let's get back out tothe car and finish up. you can find out more aboutandroid auto by visiting the documentation site and alsojoining the google+ community,
where you can share yourideas with everybody else. i'm wayne piekarski, and thanksvery much for joining me. i'll see you next time. navigate to the googleplex.