
DOWNLOAD FILE via Mediafire HERE
DOWNLOAD FILE via Googledrive HERE
brad abrams: good afternoon. thank you for coming. in this talk, we're goingto show you how to build backends, cloud-based backendsin for your amazing android applications. i'm brad abrams. i'm a product manageron the cloud team. david chandler: and i'mdavid chandler, an android developer advocate.
brad abrams: so david, i haven'tseen you in a while. how are you enjoying io? david chandler: it's great. it's great. love to be here and meetup with geeks from all around the world. you know, the only thing that ithink we need for io is, we need a way to find geeks. because there's lots of themaround, but i don't know what
everybody's interest is, andwhen people scatter out at the city at night. brad abrams: you know, i thinkthere's an app for that. we've got a couple of hours. we've got-- not a couple-- we've got 39 minutes. we could probably build acloud-connected android app to solve just that problem. david chandler: i thinkyou're right.
brad abrams: what wouldbe on your wish list? david chandler: i'd probablywant a map display. and it would show me whereother geeks are. they'd have a way to registerwhat they're interested in-- android, chrome, cloud,et cetera. and then maybe color code themarkers by their interests and show them on the map. brad abrams: yes. so david, you really, theyshortened the session length
this year, so there's onlylike 40 minutes. i don't know if we're going tohave time to build all that. but luckily, we launched a newmember of the cloud platform family, the mobilebackend starter. and what this does is, it's ano code server solution to build a highly scalable,cloud-based backend in for your mobile applications. it's built on app engine,so it was born to scale. we've got built-in googleauthentication, built-in
google cloud messaging, and avery cool continuous query feature that we'llshow you about. the mobile backend starterhas two parts to it. the first part is on the serverside with app engine. we define a few cloud endpointsexposed over rest apis to do generic data storageand access from there. and then it integrates withgoogle cloud messaging to send tickles down to the device. and then on the device side,we have a client library
that's tailored to that backend,and then a place to put your own application. so with this david, how doyou think that would look for your app? david chandler: well, we need tocome up with a map display, so we could use the newandroid maps v2 api. and then use the mobile backendstarter to make our queries to the cloud, and getthe locations of geeks, and report our own locationup as well.
brad abrams: sounds good. so should we get started? david chandler: absolutely. brad abrams: ok. let's go. so our story begins here atthe new cloud console. this is the new integratedexperience for all the cloud features. so if you might have been usedto using api console in the
past, and eventually this willalso replace the app engine admin console. but for now, both exist inparallel until we get this one all the way there. so on this site, and i inviteyou if you're watching this online, to play alongwith us here. if you want to follow thesteps that i'm saying. the eng team would love it ifyou just really slammed our servers right now.
so you just go tocloud.google.com/console and create an app. and then click on thisget started button. there's a few sampleshere to choose from. one of them is this newmobile backend. now for the sake of appeasingthe demo gods, i have already deployed this a littleearlier this morning. but the way this works is, youjust click on deploy here. and notice i can download--
all the backend source codefor this is available. i can download that and dowhatever i want to with it. or i can just deploy that. and this, without having toinstall any app engine sdk, any tools on the client. it deploys a fully-functionalapp engine app. everything we're going toshow you in this demo is already in that app. and that's deployed for you.
once that deployment finishes,you can click on the settings link there. and that will open up the adminexperience for this mobile backend. in it's actually part ofthe app engine app that we've just deployed. and you can see here, westart locked down. it is locked down by default. and the messaging is disabledby default.
so it's locked down so no onecan access your server. so what we want to do fordevelopment mode is flip this to open access. and that means everybody canaccess your endpoint. the next step we need to do,we come back over here. we did step one, step two. step three is to downloadan android client. so we have all of the sourcecode available for an android client.
that works super well in theandroid ide or in eclipse. so we're going to use eclipsewith adt, the latest android development tools installed. and i've actually alreadydownloaded that and have the project here in eclipse,so you can see what you're getting. there's the base files thathandle accessing the server. and then there's a sample thatcomes with it with this guest book example, which we'lltake a look at.
and then the main configurationplace to look at is this cons.java file. and we'll look at thisa little bit over the course of the talk. but there is a few constantshere that you fill in to be able to wire thesethings together. so what we need to do is wireup our client to our server, just so they can talk. if you're familiar with appengine, it has a url format
that matches the projectid that we gave it. and then we just givethe project id in the cons file here. i've actually already gotthat up and running. i've already deployed that. so if we just switch over tothe camera, which is here. so here we have, this isthe guest book app. this is what comes by defaultwith the project. and we can just senda message here, "hi
io." and i click send. when i click send, what it'sgoing to do is send a rest request up to the server. the server will store that datain app engine's nosql data store. and then we'll get a ack backon the client here. and just to show that,let me switch back. i am-- david chandler: four.
brad abrams: i'm four. sorry about that. ok. we'll just switch back here. and let me show you in thenew cloud console. so if we switch up here, youcan see our beautiful new cloud data store explorer. and we click on queries. and we can see that entitythat we [inaudible].
notice there's thatguest book entity. you can create yourown entities. and they can have any fieldsthat you want them to have. and you can see, here's ourguest book entity and there's the "hi io." so in about fiveminutes, we've already built a cloud-connected android app. but i think there'smore we can do. i think for the geek serendipityapp david's going to build, he's going to wantmore than just storing the
state in the cloud. he's going to want to be sittingat a coffee shop and just see geeks pop in on hismobile device, without having to refresh the application. david chandler: in case i can'trecognize them when they walk with their google apps. brad abrams: right. exactly. so there's a couple ofapproaches to this.
this is not the right slide. there's a couple of approachesto this. and we don't have our-- anyway, yes. one would be polling. we could, from the client ofthe app, we could every few minutes, we could go upto the server and say, is anybody new? is anything new?
and get the resultsback there. but that would be bad. that would be expensive inbattery life, expensive in network resources, and would usea lot of server resources. so rather than that,we're going to use google cloud messaging. it's the same technology thatgoogle uses to power gmail on android or google chat. there's a persisted connectionthat's maintained between
google's data centers and allthe phones that have those google experienceapps on them. and your code, your applicationscan use that same channel to be able tosend notifications. so we're going to use that. so there's really twosteps to doing that. the, first step is we need toknow who is sending the notifications. and in our case, it's going tobe the mobile backend starter
that we just deployed is goingto send those notifications. so the way we do that is, let'scome back to our app here and click on apis. and you can see, i've alreadyahead of time turned on the google cloud messagingfor android. so you have to enablethis api. and then, we go into the mobilebackend starter, and we need to give it the api key. this is where we're going to usethat to pass along to say,
here's who's sending thepush notification. so in order to do that, in orderto get that key, we'll go into the new cloud consoleand we'll register a new application. and we'll just call thisour mobile backend. and it's just a genericweb app. and we'll register it. and we'll actually use this acouple of times when we do auth as well.
but for this time, all it asksfor is that server key. so we just grab that serverkey and put it in here. and we've done everything weneed to enable our server side for push notification. the last bit is just toput the project id that cons.jafa file. once we've done that and deploy,then we get the same guest book application. but now if david were to send ussome messages, david's got
that same app runningover there. oh, and we need to switch toit, so you can see it. so what david's going to do ishe's going to find the app. and then he's going to startsending us messages. when he sends a message from hisphone, that's going to do a rest request up to the server,going to store that data in data store. and then there's a technologycalled perspective search that is looking at changesin the data store.
and when it sees a change,it's going to send a notification over to googlecloud messaging. google cloud messaging will thenfind the subscribers and send a message downto my phone. and you can see, david's usingall his creativity at this point to come up with verycreative things. and you can see sort of handsfree, we're getting so just a few minutes in, andwe've already got a pretty functional applicationwith just setting a
few variables there. so at this point, david, i thinkwe're probably ready for you to start putting somemap goodness on here. david chandler: ok. excellent. so i have started project basedon the cloud backend that brad has on his machine. and i've put on a map activityin it using the new maps api v2.
so there's just a map fragmentand a very simple activity, which i'll show you here. and you have to paste yourapi key into your android manifest as well. don't forget that if you'resetting up maps. let me zoom in on this code alittle bit so you can see a little bit about it. we just have a setup methodwhere we obtain the reference to the map.
and then we enable our location,which makes the location services work. so that gives you the locatorbutton in the upper right in the app. and that's really about allthere is to it for getting the basic map up. so what we want to do is, assoon as we launch the app with the map, we want tofind our location. and we're going to use theintegrated google location
services that workwith the maps v2. and then we want to do somethingwhenever it comes back and notifies us it hasa good location for us. so there is a listener called onmy location change listener that we can set. and that will allow us acton that information. so what we'll set that-- set on my locationchange listener. and i'm going to just letthis class implement it.
let me blow this up againa little bit. so we're getting an error therebecause we need to let this class implementthat method. so we'll go aheadand add that. and then, oops-- scroll back. we need to add theactual method. so i've got a little code herei'm going to paste in from the snippet on my location changehandler and we'll fixed
imports here. zoom back in on it. and you can see, it's doingsend my location. and then we've got a little codefurther down to do that. and it's not implemented yet,so let's go ahead and implement this method as well. so to send our location to theserver, we're going to use the cloud's backend samplecode that's here. and it's really prettystraightforward.
we just create a generic entity,that's the way the cloud, the mobile backendstarter works, is it gives you generic cloud services that youcan send and receive these generic cloud entities. we're just creating anew cloud entity. and we're making ofkind of geek. this works really well withthe app engine data store because it is schemaless. so you can create anynumber of kinds and
properties on the fly. that makes it actually it veryeasy for us write this kind of application right now. so we'll put in a few things. our interest is cloud. our location is what wejust got from the location change handler. and then we callgetcloudbackend.update, and this is one of the built-inmethods that's available to us
as part of the mobilebackend starter. and because in androideverything should be asynchronous, we pass it acallback handler that will get called when the requestcompletes. and when the request completes,then we draw a marker on the map. the reason getcloudbackend isin red is because i need to let this activity extend cloudbackend activity now, instead of fragment activity.
so there we go. now all those featuresare available to me. you can look here and see thatmethod should be ok. so let's take this andrun it on the phone. it'll take just a second here. let me get the phoneplugged in. and a little trick i learnedjust this morning actually, is that if you want to install anapp on your phone but not run it yet-- which i'm going todo because of the ethernet
situation here-- you can just change your runconfiguration and tell it to do nothing on launch. and that will build and installthe app on the phone, but it won't actually launchthe activity yet. so we're going to go aheadand do that now. run as android application. see it's building. we'll wait for it tocome over here.
and then we'll go plug the phoneinto the ethernet and show the map on the camera. it looks like it'salready there. i'll grab this. brad abrams: not that we'reparanoid about the network. david chandler: yeah. these galaxy nexus phones havethe capability to do usb to ethernet, which works verywell for us here. so here is our app--
comes up with our basicmap display. we have location servicesavailable. and then when we touch that,we should see that it will locate us. brad abrams: you should see. david chandler: veryinteresting. it doesn't seem to be able tofind a location for us. let's see if we scroll the mapover and zoom in a little bit. well, something newevery demo.
brad abrams: awesome. brad abrams: so david'sgoing to debug that. i think, i think maybe not. david chandler: i think we'llgo to the next stage. great. yeah. yeah, so david's going todebug that while i go-- so david is now theoreticallysending our location up to the server.
david chandler: yes. brad abrams: yeah. david is now sending ourlocation up to the server. and i have the digeratifollowing me all the time. and i think with our serverbeing open and my location being sent up there, that'ssort of a bad combination. so what we want to do islock down our server. we're going to lock it down soonly our android client can call our server.
just because there's restendpoints out there, doesn't mean we want everybodyelse to call them. we only want our client appto call those endpoints. now there's a number of optionsfor how to go do this. some people have been putsecrets in their android app-- some token that they generatethat's in their app. and they send that upon each request. but that has a obvious problem,because how many of you have ever unzippedan apk before?
right. and so if you can doit, a lot of people could probably do that. and so those secretsare discoverable. so rather than using some secretthat we put into the apk, we're going to use amechanism that's built right into the android os. and that's, all androidapps are signed. there's a digitalsignature that's
cryptographically strong. and we're going to usethat signature. that signature is actually whatthe google play store uses when it is updating apps. when it's finding which app toupdate, it uses that signature to ensure that you'rethe same publisher. so what we're goingto do is use that signature on the client. and we're going to give thata token generated from that
signature up to the server. and that'll be surethe requests only come from our app. so to do that, what we'll dois come back over to the mobile backend settings page. and then, it's asking for anandroid client id that i've already filled in. so the way you get that androidclient id is back in the cloud console, youregister a new app.
so click on register app. i've called it androidclient-- client. and then you just give it thepackage name and the sha1 fingerprint. the sha1 fingerprint is theinteresting one to get. that you run the keytoolcommand over your debug.keystore file ifyou're in debug mode. and that keystore fileis generated for you
automatically by theandroid adt. and it's in the-- it's usually in your rootdirectory in dot android. so anyway, we generate that. and then once we have that,we have a client id that's all wired up. so we just take that clientid and hand it to the mobile backend. so that handles thefirst step.
the second step of this is, ifyou noticed, we're actually using oauth to dothis security. and oauth is tried and truetechnology, but somebody may associate oauth with the oauthconsent dialogue that you may have seen before, like whenyou're trying to access say google plus data or google docson behalf of somebody. they'll get a prompt that says,do you want to allow this app to access yourgoogle docs data? that's a oauth consent screen.
and that makes sensein that scenario. but in our scenario, we havethe geek serendipity app on the client accessing the geekserendipity backend. that's not one where-- the oauth consent screenwould be sort of silly. do you want the frontend of thisapp to be able to talk to its own backend? and that's not a choicethat we think is meaningful to users.
and so what we do is, we cansuppress that screen so it doesn't get seen, if we know thepublisher is the same on the client and serverside of the app. if we know it's your backend andyour frontend, you don't need to see that screen. so the way we prove that it'syour backend and your frontend is we use a web client id. and so you get theweb client id-- this is that--
yeah, this is the mobilebackend that we created earlier for getting the googlecloud messaging to work. and before we usedthe server key. and now, we're going to usethe oauth client id. so we just grab thisoauth client id. and you put it in the secondfield here for a web client id. and then you also put itin your android app. so it needs to be in both.
now this is not a secret. somebody could unpack your apkand get that, and they still couldn't access your backend. it just proves that you're thesame user on the frontend and the backend. ok and then there'sone more step. so the last thing is very easyand that is that because we're using google authentication inhere, we have the same notion
of who a user is on theclient and the server. that's built into the app engineframework and it's built in to android. so it's a very seamlessexperience. so i've have already loadedthat up on this phone, and let's switch over. so i loaded this app just aminute ago onto this phone. and you can see now, when i runthe app, it's giving me a chance to login.
and all of the-- most android phoneshave [inaudible] ids, google ids, associatedwith them. so i'll just log inwith this one. and now what's happenedis, it's gone out and validated who i am. what's the secret? david chandler: the secret is inorder to know your location it needs one of two piecesof information--
either gps-- david chandler: --or wi-fi. we have wi-fi off, becausewe had it hard wired. brad abrams: awesome david chandler: and nowwe have wi-fi on. brad abrams: give it a whirl. [interposing voices] brad abrams: fantastic. so now it knows who i am andwhere i am, and we're looking
for an acknowledgement thatit knows who i am. and we can switch over andsee the data store. is it going to work? david chandler: i think so. brad abrams: give itone more second. let's switch over and see. i'll just run this. it's not there. david chandler: let'stry closing the app.
brad abrams: so nowturn off wi-fi. we're done with-- weknow where we are. now we can use the internet--that we can use the hardwire. david chandler: no,i don't think so. i think we want to close theapp and then come back in. david chandler: sorry. brad abrams: justone demo glitch. brad abrams: we really needthe ethernet to be able to tell us where we are.
so what we've done so far,is we've built a backend on app engine. just click once to deploythat backend. and we've stored ourstate there. we've shown push notification,the easiest gcm wire-up i think you've ever seen. and we've showed usinga map and logging in. i did something wrong. all right.
david chandler: we'll moveon to the next thing. brad abrams: and so thatwill now store your data up on the server. so you want to switchthe next one? so now that we are sending ourlocation to the server. brad abrams: sorry. david chandler: we'll go aheadand proceed with the next stage, which is we wantto find out where all the other geeks are.
so we want to querythe server. and if you could putup the slide. brad abrams: oh,i forgot that. david chandler: --thekeynode slide. david chandler: i'll tell youabout the continuous query capability that we're goingto use to do that. so this is a feature of themobile backend starter project that uses several app enginefeatures as well. there's a api [inaudible]preview
called prospective search. and what that does is, anytimedata comes in that matches the parameters of your query, thenapp engine will notify your app on the server sidethat some matching data has been found. so we're going to use thatto our advantage here. any time a new location updategets posted, then our apple get notified on theserver side. and the mobile backend starterproject takes that further,
and will send a gcm messageto our app running on the phone, as well. so the flow looks like this. in step one, a new locationupdate comes from the phone. it gets put in the server. in step two, the app engineperspective search api notifies the server sidepart of our mobile backend starter app. that sends a gcm message--
google cloud messaging-- tothe client in step three. then in step four, we re-queryto get the latest data from the server. and then finally, step five, wedraw the markers on the map with that most recent data. so i'm going to go now writethe code that actually does this in our app. so we'll again take a lookinto our map activity. and the first thing we wantto do is write a query.
i'm just going to strolldown a little bit here. that will go out and getthe geek locations. so let me paste insome code here-- query geeks. and show you whatthat looks like. all the capability that i justdescribed on that slide is called continuous queries, iswhat we're calling it right now on this project. and so the first part of ourquery is to write a handler
that will receive the results. so we have a on complete handlerand we're just going to draw markers. simple enough. then to actually register thequery, we call get cloud backend, dot clearall subscription. now, the notion of a continuousquery, you can subscribe to querieson the server. so we want to clear any existingsubscriptions, and
then set up a new one. so we say new cloud queryfor kind geek. we're just going to get the top50 geeks sorted in order of the most recentlocation updates. and we're going to make thescope future and past. so again, this is a feature ofthe mobile backend starter that lets you say, i want to benotified of future matches to this query, aswell as present. and if you think about theamount of code that you have
to write to do that allmanually, setting up gcm, keeping track of this data,it is actually a very nice convenience. and then we actually registerthis query by calling getcloudbackend.list. and we pass it our queryand our handler. so the code that runs up herein lines 72 and 73, the on complete handler will getinvoked any time there's a new location update that getssent to the server.
then all the clients who aresubscribed to that query will get notified so theycan update their map displays as well. so we've made a query method. now we actually needto call this. and we only want tocall this query. now we have authenticationturned on, it's going to enforce that at theserver side. so we only want to call it ifwe're already authenticated.
there's another method that'suseful to do that in our project called on post create. we can inherit this from thecloud backend activity. and here's where we're going tocall our query geeks method to register our query-- so only gets called afterwe're authenticated. and then lastly, i just wantto remove my draw marker method, because now in our oncomplete handler, we're drawing all the markers.
so that's the finalcode for that. let me go ahead and putit on the phone. brad abrams: you havea suggestion? david chandler: right. we'll do run as android appagain to get it here. and once it appears, i willcross my fingers, walk over there, stick it underthe camera. wi-fi's still on on this one. you'll need wi-fi onfor the second part
of the demo as well. so here we go. going to give it a whirl here. i'll switch back tothe camera view. and we'll try the app. authentication is enabled now,so i have to log in. the map should be coming up. you know what i didn't do. i didn't plug in theethernet, but wi-fi
appears to be working. yay. brad abrams: shoot. david chandler: andwe'll locate. and there is a marker-- actually two markers,which is exciting. have you already launchedthe app? brad abrams: no. well.
brad abrams: you maysee one more. let's see. david chandler: in the advancedsection of this presentation, we will discusshow the clone ourselves-- or at least, our androiddevices. yep, i saw it appear. brad abrams: did yousee a third one? david chandler: yes, i sawthe third one appear as brad did the demo.
you remember, therewere two, right. nothing up my sleeve. a third marker appeared. that is the continuous query inaction when he ran the app. thank you very much. brad abrams: so, did youwant to do that slide? david chandler: yes, letme get that up here. i'll switch back to mine. i wanted to say a little bitmore about a couple of things.
first, the mobile backendstarter project is brought to you by a team at google calledthe cloud solutions team. and i wanted to acknowledgethe engineers there-- i'll be calling greg, because noone can pronounce his name properly, kaz sato,and jenny lo. the cloud solutions team isinvolved with helping app engine customers figure outthe optimum technical solutions to run-- cloud customers,more generally.
and they also publish bestpractices white papers you can find them at cloud.google.comunder the solutions section. i wanted to mention a little bitmore async tasks, as well because part of the magic thatthe mobile backend starter is doing for you is to runoff the ui thread. and android is behindthe scenes. that cloud backend activity isactually creating a new thread for the network request. but that's all.
you're insulated from that. you don't have toworry about it. even better would be to useservices on the android platform, and that's somethingthat we're looking at extending that project to do. thank you. so i think now we have a veryfull-featured app, and its cloud connected. i think the mobile backendstarter has
served us really well. we haven't had to do anyserver code yet. but i'm a server guy. and i was talking earlier,i think there's a few app engine-- who's sort of anapp engine guy here? are you guys missing writingcode on the server? i know i am. so i constructed a reasonto have to write some code on the server.
so both david and i arelittle bit data geeks. being at google, we loveprocessing lots of data. and so we want to log everythingabout the user experience on this app-- how dopeople use, how they pan, what do they do on the app--so that we can do data processing on it, and learn howto make the app better. but the mobile backend doesn'thave a logging mechanism-- doesn't have any way to storestuff in logs yet, although they will probably add itright after this talk.
but for now anyway,it's an excuse to write some server code. so we're going to write our owncustom cloud endpoint that is part of this backendstarter. and then we're going to callthat endpoint from a client library in the client. so let me show youhow this goes. so what i've done is i've goneout to github and i've downloaded the source code forthe mobile backend starter.
as we've said, everythingin this thing, the source code's available. so if you don't like somethinggreg, did you can go and change that. and so what i'm going todo, i've got that. and i'm just going to drag in anend point i wrote earlier. and this is the world's simplestcloud endpoint. so it's got that @api attributethat indicates to app engine at that we're goingto expose this is a rest api.
and then right here, we'reseeing where we are defining what its name will be in theclient library and what the rest interface should be. and then, it's very simple. we just call log.info and putthat in the app engine logs. so i've already deployed this alittle earlier this morning. and what's very cool aboutcloud endpoints is that there's this neat url. if you go to _ah/api/explorer,then you can actually view the
api explorer foryour interface. so what we saw earlier wasthe mobile backend. and now i've just added a newone called cloud login api. and that's got the same name igave it in the source code. and now if i "hi from the webapp," then this goes out and it calls my interface. and if i look at the app enginelogs for this, you can see there is that log, "hi fromthe web." so, very nice experience there.
now what we want todo is called this from our client app. so in order to do that, whati need to do is generate a client library. so i'm just going to right clickon this and find the generate cloud endpointsclient library feature. and this is going to go out. it's, going to take thediscovery document, the description of that interface,go out to the web to a service
we provide that will generatea strongly-typed android-optimized client libraryfor our service, and then download it, and put itright here in this project. there it is-- client logging. david chandler: thatfunctionality, by the way, is provided by the googleplug-in for eclipse. brad abrams: that's right. and then, we just need to copyit over, very simple.
i'm just going todrag this over. and now we need to add it to ourbuild path, so we're going to right click on this anduse a source folder. so now this to be partof the build. and then, i just have a verysimple bit of source code to add to the client to actuallydo the calls. and let me show you whatthis looks like. so this is my cloudlog function. it's very simple.
in the constructor, we take theunique id of the android app that we're using. so we can tell in the logswhat's happening where. and then in a thread, iam going and doing the asynchronous call upto the server. and that's right here--service.logs.log, passing that message, and doing execute. in just a couple more-- if wehad a couple of minutes-- i would wire this up into theui, but it's very simple.
you just call this log methodand we do that request each time up to the server. you might want to do batching,but for the demo to be snappy, i decided not to. there's nothing really to seeon here, but i have this on the phone and i'm just goingto pan around a little bit, generate some log datahopefully, if the connections working. then if i come back to my logs,i should see new logs.
and we do in fact, see logsfrom client, right, with a unique id. and this is for example,on my location changed. so we've shown you how to addcustom logging to the custom endpoints to your mobilebackend starter. so with, that i think we'repretty much done. let's-- brad abrams: --wrap up. david chandler: all right.
everything that we've donetoday is available. the mobile backend starter, ofcourse, you can get to off cloud.google.com inthe cloud console, as brad showed earlier. the demo code is going tobe posted soon, as well. and we also created a littlemore refined version of the app called geek serendipity,which you can download in the play store. i may drop that on the camerareal quick here, just so you
can see it in operation. we sent it out the otherday and allowed a few people get in on it. so you can see, it'll just putmarkers on the map for you, showing different typesof geeks in the area. so we hope you enjoy using themobile backend starter. and we have one minuteand a half left. if there's a quick question,we could take that. yes, right here.
audience: do you needto inherit from the cloud backend activity? david chandler: do you needto inherit from the currently, yes. yes. audience: [inaudible]. david chandler: yes, we arelooking at moving it into a fragment or otherwiseabstracting that capability, so that you don'thave to extend.
yes, behind you. female speaker: there'sa microphone right in the center aisle. yeah, please step tothe microphone. audience: ok. so what would be the differencebetween using that cloud messaging and web socketsor channel apis? david chandler: what would bethe difference between using google cloud messaging, websockets, or other apis?
audience: channel apis. david chandler: ora channel api? google cloud messaging is reallyoptimized for phone use because it'll send theupdates over the air. it's written in such a wayto be battery efficient. and it is a truepush mechanism. some of those others maintainlong-running connections. i'm not sure they're designedas much for android, specifically.
so i think google cloudmessaging would be the most battery efficient. brad abrams: i thinkwe're out of time. so thank you very much. appreciate it. david chandler: thank you.
0 comments
Post a Comment