INFO http://applicationsinthecloud.blogspot.com/
Google Cloud Platform Live: Building Cloud Powered Android Applications
and we're going to talk about building cloud powered and with that produces
thought this is going to be a very much the hands on them all
um we're actually going to pick an application
right the back and forth like now live in 15 minutes
and we're also going to give you a pic of introduction before we do that and
then we're going to talk about
some of the future actions and will try to leave
a minute or two for questions and answers thought let's start with them
over you
for for the for the thermal we're going to be using Andrew through your I'm
Google Cloud on points and let me just give a quick overview of
you to be thought 102 open source ID
it broke around Roy and it's based on them IntelliJ IDEA
know what that means is that it has a lot of good
according to systems be to help you ride quality drama called
for things like context-aware call completion
and the same method auto-completion optimizing imports balkans ball to occur
although can apply for
it also has a license agreement visual and layout designer which means that you
can drag and drop to shore
elements into into her up and it also comes with a whole bunch of that accord
and I was the school's
we call them losers I think that's how they're known
industries will a and they help you to build quality absolutely him to things
like
simple security issues and compatibility issues
of a kind of things and finally under to do with very well
in integrated with agreeable which means not
you can use the same a build files and also
war I V command line your continuous integration server
all of these things so that's one half now the other half is Google Cloud
imports
and with who called on points with beeper why the
very simple way to build server-side logic for your app
on Google App Engine plopper and since throwing what happens in
is benefiting you all you know from all of these things that we just spoke about
both the beautiful or scaling the high-availability
all those lifeless thought this harvest
to architectural would like to have a you have a back and running what happens
in instances
and then you have Google how them point plans and one one thing that
and point those for you is the think the poem thing out of
night program by for example marshalling double object thing to do some options
are providing rest the PI's from your I wanted the job a cool
another thing that the Google Cloud on point before users
the the complexity out of more pliable
saw I understand the three you know while you might be targeting Android as
the primary
kinda distribution for there's also I were them there's JavaScript and so you
can automatically generate strong you buy
client libraries for for those blood and then finally I'm point also picking the
risk out of it
the bold move in the sense that there's out of the box blew open the line of
service production
their support for all four for all of 2.4
and there's also support for things like wine key management
and so on when we when you combine is threatening to get you to them you are
doing better
and so on and with who in my mind and Ruth who oppose problem points is the
easiest way
for mobile developers to yet to Google while powerful
and we have a whole bunch of apps now the in Andrews studio
would help you do just that thought you can create
happens in back im you can generate strong the pipeline by Bruce
other also a pawnshop quick fixes and as to buy
politicians for when you're developing the actual in tonight
and we're going to show you all there's room for them when the next
15 minutes or so and one thing I would just like to mention those motha
its all using realizable system
saw it's very well live together and unified build across the command line
across
across like up for both the back and front
thought let's open to them all
I'll and we were thinking like you feel a lot of cool little to the
were thinking what a thumping cool it would be to
talk to you guys and first 12 sure like your own application to strike some
people prefer
from straps but then we would both is up you know is that mister
and we found a sweet home to two txt up which is a simple to do task management
up its own place for if love with miss three others
and using a different Paul provider for the backup
school let me just show you the app if we can just skip to the
to the mobile device this number to txt up
I as you can see those all of the things that would explode
from a to do up you can you can other task
you can market baskets burn a nothing nothing groundbreaking
blue erotica my throughout know if you can
got back to the plans for almost like him best football that happens open
source
so we fought lipstick up let's remove the different low provider back and
and let's have our own fob fall back into through let's go back to the last
this is exactly what we burn
saw again this is not to do this up
but now owns the refusing to a different ball over whether it's using Google
not apply for and thought again as you would expect
more like ima past story I'm gonna try to
another thousand during the them all words he wrote them all
sure why not good enough I'm
yet so so it works as expected and let's go back to the white man's
and in fact north or simple in thought you had to do this transition
from taking an existing app and adding your Google
blah blah from back into but we're gonna sue right now
live against admitting to bill roth
how to dual start-ups though I full
we're gonna start with an app which is completely through now
or any kind about him just the UI and then receive them into all the magic and
he's going to have
about him through over to you call arm things manford
alright so a no-pressure let's let's let's let's write a back-end
um alright so here's the architectural we're doing as a lot of steps here
on the left side you see the two new text app which manfred showed
and as we dropped out the existing the existing cloud provider
right on the right hand side you see the App Engine back and we want to build
here
its guineas a cloud data store to store and retrieve tasks
and what we're gonna do is then expose this back and
using cloud in points and want to expose the back in using cloud in point we can
generate strongly typed client libraries
and then use them over the two you text app and then we can communicate with the
back into storm treat asks
so okay cool all right let's let's let's get started here
arts or starting with two decks at so what does that look like
I let me just go to enter studio here I think yes can see it okay so what I have
on the left hand side
you not to go through United read although all the lines here but
it's a it's the two tax project here and
there's a buncha models here to text touch there's like an action bar widget
and what not and 10 showing here
is the main build a grain of I'll actually for the to use it
text touch module so you know
I'm gonna go through everything here but as a as members saying is a great this
is a is an agreeable build system
and this is written in Group B I so this is what the syntax is that you're seeing
and right here I've actually got you know one thing a point out is if you
look at the compilation dependencies
so watcha jars here but then there's a couple project dependencies or traction
just pointing
to the other models there so this is kinda the key point
about using entered studio all over your Android applications is a great I'll
build system and give you much more rational way
to bill your app and you command line bills so cool
okay great arm let's go back here to see we're at now
and alright so what I want to do now is only generate an App Engine back n
that has a clot in point service lets go and do that
so I'm gonna go up here to tools
they're going to do a cloud tools I mean it's a new app engine module
the temple and any use is the App Engine Java and points module
call this to do taxed
back in package name can be called on Google
to do taxed back-end
I looks good some degenerate
alright so couple things going on here 1
we have we basically have a series of templates and you're seeing
that over here from the template code we we've we created
BBC generated all this code here are many gonna go to that in a second what's
also going on
is you're seeing this is great all sink in progress because
this is using agree to build system any time you add a model your project
it has to be built-in absorbed into the
into the actual I D E be a great all so that's why I synchronize what's going on
here
so really in the bill brill file here for the Android application
or the App Engine application you can see that this is using
the App Engine plugin is a great a plugin for App Engine
the dependencies on the App Engine SDK I got some compile time dependencies here
that's the main green of I'll so it's hop into the co those actually generated
right
my being is wall its I guess might be in it's a simple to very simple class would
like a single field
just got a string field as simple as you can get for data object
are again this is part of the template that we generate and we've got my end
point here
okay so my in which a little more interesting because what this is is
actually a to Java class
or exposing is a cloud in point how we doing that we're using the Add API
annotation
which you see it here and I'm specifying a name
my ATI which allows us to be expose
as a cloud in point with the PI name my ATI
but you know that's not much fun you need a map it right i mean if the call
something
you know its answer RPC call so there's the say hi method that's also been
defined here
and we've we've expose this with the EPI not that annotation
called called and we call given the name here say I
as well and is a really simple method it takes a parameter
freeze my being returned so what level do with this looks like tax issue with
this actually does some gonna run this
I'm gonna run this I'll hit play
okay so whenever we actually run
I when we run the an Android a or an app in App Engine
ap in every studio because it's using great all does agree to a bill before
and
and and then what it does is the kicks off the local development app server
you saw this in a previous demo actually and
it starting to stick me over there so just started but basically
this allows assist s locally before to point a production
so let's take a look at you know water sample app looks like here
so what I'm doing here is on base the opening up API Explorer
yet it's an app that's basically pointing to my local host here
to slurp in the EPI met information you provide me a view over the REST API
CC that an EP I called my view has been defined others say hi method
and it takes it takes forever to name something is put in manfred
snow my name his name but at AXA Q
and there we go so what actually happened here right you see that the
Java class I created with the annotations
has mapped pretty well into a REST API you get the post
resume in your little bit arm you've got 90 min the name
version 1 that's the method that's the data the responses hi manfred
such basie the Epix for just that this just showing you how r expose pot and
pour really simply
so okay let's go back over to a school record is studio here
all right let's stop the devout server a and okay let's let's let's just on
a checkpoint let's check point where we are here right so what we want to do
is we're we've got the backing got a cloud in point that's great but
you know it's not really helpful for trying to do here trying to store tasks
in a data store and get them back so to work on that party at
so go back to studio and limited to you
results all-star the sample it's good I can I can get sort this
called my the night I don't like that name something actually rename this to
task being
alright that's better well let me add an ID field here
arm gonna generate a getter and setter for this
reform at the file that ugly alright call
so now being with an IT field right now
okay my end points is were we on actually want to put in
the lotto draw trying to do here so I'm hearing in this too
task API said it might be I gonna drop out the say I method because we don't
me that anymore am gonna drop in some code here
and really just and this is gonna be co to talk to the data store
and skin expose three methods clear tasks
get task and store task right get ass full retreat ass from the data store
store task force for a task in a data store
and third house will delete all the data store but I'm and Robin is codenamed
talk through what I did
here alright so just dropped in a buncha code
and it was gonna resolve these imports here
on BT's the data store entity
see or use the happen jim better options
on each of the two lists arm
cool I think I think I got a mall okay great
00 there are actually a couple of other is here arm
this one is actually complaining because because task API
its it starts with a capital letter here but when you're using is received the
eyes you're supposed to start lower case letters like mistakes that
that's a validation and we wrote arm and I look at the get ass method
and also got a dot in the name doesn't like that either
summers gonna fix that up and just to let you know when you're writing the
endpoint classes
there's a lot to help us for all these conventions you go under inspections
here
you can see undergo a cloud in points you don't have to read them all but
there's a variety of things that'll help you in as you type validation
as you're a cloud in point classes okay great so
what what actually do here I'm psychic I'm created three methods
their store task as I mentioned to you get tasks
and clear tasks so to go through these really quickly I'm using the data store
service here
and what I'm doing in store task I'm basing creating a new transaction
and then for a task being that's coming in from
you know from basically a client I'm creating an entity for that and putting
it in the data stored in committing that transaction
get tasks runs a query over the data store for all
entities a tight ass mean creates to aspin objects from them
and returns on the caller clear Taz is similar except to create a transaction
does that same query
and then it blows away all the tasks that are in the data store and commits
the transaction
so ok people so arm
looks like we are back end arm you know so what we need to do now i think is
actually look to see where we are
so I can keep track of where we are arm okay cool yet what I want to do now is
only generate client libraries write about my back and I'm expose it to cloud
10 points
but someone's got to use it right anything that we want to use it is an
Android app so we need to
generate strongly typed choir libraries so we can use this on the other side
so we go ahead and do that actually so many go to you
tools who flout rules a minute pic
install client libraries okay so this is doing a couple things right what it's
doing is it's doing a build
up the App Engine app because the change much for the code and
it's going to do then basically get all the Med information
from the annotations kicked up to a cloud service
wouldn't take them that information and say oh hai you ni jobber
here I'm gonna give you a bunch for Java source they can use as client
it as a way to call the clout in points from a client application
we grab that source we compile it and we install in your local Maven repository
so now you can access it on the other side
and it to you in the Android app so arm
so let's go ahead and let's go ahead and actually
go and use those quiet libros on the other side so now I'm gonna go to the
two you text touch
application here and when a drop in the defense is here
right so that it a reference to to the back to the
libros that were generated and this is referencing the local maven repo
and because I change the bill gray to file got in USA Inc
so let's do that well that's going on let's just see where we're at
here alright so basically we're we're getting we're getting last 80 right we
basically have our back end
we've got our client application on were generating the client libraries
now we need to use override the parts where we actually call the cloud
provider the existing cloud provider
from you text app and use ours instead the back to increase was going to do
that
I call okay so you know the magic in this actually all happens
in a class called task for example not a great name I know
to task bankable but anyway there's a
there's basically two methods here or format that's actually
pusher remote and Paul from remote and
these methods actually are you know are doing what they're saying
pushing the task the remote I the remote on cloud provider and polling
from from a cloud provider you can see in this implementation here
its easy remote client manager which is where the existing cloud providers let's
just let's extend this class and override these methods
I'm gonna create a new class here past eg
temple I mean extend
task for example and I'm gonna drop in Co that overrides these methods
and actually calls our back-end instead the existing back-end here so let's do
that
alright and was gonna walk through the code quickly here
so what we've got here is basically an endpoint Stace begging bowl
we've created the I'm creating a new version %uh
or new instance a task EPI and that's really the thing that calls over
to the it's a thing to use to actually invoke remote methods
on our back end you'll see in the construction I have overwritten the root
URL
2.2 ten dots here to 2.2 that's because when I run this in the emulator
I actually the internet me later I want to run against the local that server
which is mapped it and not the right 2.2 on
in pushed a remote really others go this really quickly before BC grabbing
the list to the tasks that are stored in the local
and a local Android store creating task been objects
and then calling store tasks for each one of those wanna call execute that on
the each unique all happens to our back-end
in pool for remote we call get tasks which is the name and that we define on
that side
execute and we call get items and then for each one of those
we create a new task object which is what the UI understands for this app
and we call reload and that shows them up in the
in the Android application so it's let's go ahead is run as a stress out actually
so many do is I'm gonna run the back end
are locally and while that's actually going on I did remember there's one
thing I do need to change here
I need to use our new our new actual that the
endpoint aspect impulse and change that here
loves cool
so let's take a look the dow servers running that's great and
now all that's running I wanna run the
arm the Klein ap something run that
that's gonna cause a agreeable to happen here
you can see that basically in the bill process it's actually going ahead and
doing both the Debug and Release builds up the application
are you get that out of all on and you can actually to find many other variants
of your application very easily
with the in great also gonna choose the running emulator here
right let's kick over the emulator and
see for working here okay cool alright so any emulators on the anatase
okay
call at another one
I'll get on mark this is complete arm
and let's just see if we're to the actual let's look at the back and make
sure actually storing data and not
you know not deceiving myself here so I'm running a lot the Epix for you
notice the
API definitions are now mapping a task EPI
medical get tasks here and basically see
arm you see that you see the data here DC hi there high cloud platform people
with the axe it's been marked as completed that's why it's a line through
it so looks like we're up and running their
call arm so the this great this is
is good times but arm one thing we actually need to do is
what a likely to get this to production right i mean that's those the
as a whole point of the exercise so let's go and let's do that
so I'm gonna do is up into little housekeeping here's a gun a ploy this
right of two
2002 or two can't authentication
want to make sure my Apple ID is set properly here
platform
live 14 great and you know what ima do use the place on the command line cuz I
mention reason great also should be able to do that right so
griddle w/ to you tax
back and call app engine update
which uses a cladistic into the hood and
bike or so before doing this it doesn't build
looks like it's a going up there
is an updated seks so she grabbed that anyway
arm call so looks like it's deployed let's go into
are a call that's actually what actually use the production back in on the phone
their
yeah love to have him do up
floor let's let's see if I'm more a look at this time with my
done superbly slow if we keep
go to the wise II
bloodstream along little more firm on poor
would make him not solve all the problems for most bomb
what will the uploading on now that's me so what I the phone with them
audit or if I don't work
for you through the thriving through mobile
for nothing
Chalmer more
yeah there we are right okay
floor resume what we would do on midterm
to know absolute first volume
missed me in the loop is here with us and the
are just I don't know say wrap-up
yeah wrap-up I like GV I don't know you know things are fine
a okay so I've tried adding a wrap-up ask
alright and now through to the mall responsible cool can you can you flip
over to
you flip over to the the telecommute or I'm and refresh this here
ago
wrap-up boy i think is a good time for a blog site
idea I thanks love sure both authors liveth
I know this might not have been the most exciting bill of their lives
booth with more smokes and mirrors in 15 minutes we booked through
now up and we are the claw back into flies you know I thought it was kind of
cool
and you're seeing things like local the MapServer and the API Explorer and
how called gets transmitted from Java to rest them of the go all through school
things um
thought anyway if we can go back to the slides are you know I know you guys are
you here to go to the fires
fireside chat with them worth and to have been through all the squeaking a
bomb blast through this line
um I would like to mention that while from what do you think the really cool
what we have now
more of the exciting things are coming including support for GC
and improved getting started experience API and the Olympics third-party client
access them
all of those kinds of things that you can look forward to a in Ohio in 2014
saw I hope to see you all there thanks so much for coming thanks for being
attentive after the lawn so I understand that I can be quite hard
and the any persons North
actually do we have a mic week
yep wanted him to feel the question older people up
min
yet so throughout the third question only be distributed
%uh the question was mostly global purrs are using other ideas a outside the
hundreds who knew and understood it was mostly Android
and so what's with the further long-term plan their saw
our goal is commuter where you are and so partially
one reason for that was having the grid greenlaw fiber
backing them from them build currently Andrew through those forced to
Java there might be some
things on the road map search them that unfortunately that's all I can do at
this point thank you
though one reason we did you know we want to say
the back into work reading their especially 100 studio
are really in tune to be used by injury doubts right so that's why
its that's white still an entrance idiots like this at a cloud back and
very easily
for the purpose if you enter into okay well ask listen to her
okay the question was will hurry support from
Android were both on Google glass I mean
yeah I we haven't thought about that but but technically
right i mean with clout in points if you're using
you know if it's a jobless you can generate bindings in any language
and you're using HTTP right so I don't see
we have we haven't thought about it but I don't see any any actual technical
reason why that would be a problem
to use it to use an app or a cloud-based back n
and flat and points to expose it to you a device like
alright thanks so much guys thank you
Posting Komentar