Join Lynn Langit for an in-depth discussion in this video Using the Codenvy IDE with Java, part of Google Cloud Platform Essential Training.
- In looking at developer tools, a third-party highlight that I want to showcase is something called Codenvy. Codenvy is a browser-based developer environment, and it works on any browser; it's particularly great on Chrome, and I often use it when I'm coding on my Chromebook. It's just something I have used, and I want to show you how it works. Codenvy is a developer environment or software as a service; it actually runs on Commercial Cloud, as you can see on the left side here, or it can be installed, and this is an Enterprise installation where it can be customized and what this means is that they work with the client to go ahead and install it, and it's basically private for their developers.
We're going to use this version right here, which has a free tier. I went ahead and signed up with my account, and then once you sign up, you get the user dashboard and so you'd sign in right here. Then, inside of the user dashboard, what you want to do is create a new project. Now, when you're creating a new project, you're instantiating a template which is going to have the libraries and all of the tools that you need, and I find this can be faster when I'm working with various clouds, particularly Google Cloud. You may remember if you followed along during the previous movie, for installing the Eclipse plug-in, it's very powerful but it took a good bit of time.
I'm going to go ahead and say, Create New Project, and that's going to open a new browser window, and what that's going to do, is instantiate an instance of a template, and you can see that Codenvy doesn't just work with the Google Cloud, it works with a lot of other languages, so it's a useful set of technologies, but in this case, we're going to focus on the Google Cloud integration. We're going to actually go and look at a sample. We're going to look at a Google App Engine in Java, and we're going to call this My Cool Project. Notice it's going to be an App Engine Java project, and this one uses the Search API.
So, it uses one of the Google API's. It's kind of interesting to see integration here. We're going to go ahead and click Create, and as this is setting up, there's three parts to this interface: There's the Project Tree, over to the left shows your files; There's the Runner/Builder in the bottom, that we're going to minimize right now, and then, there's the Coding Environment. So, just so we can see what we've got, you can see that we have the App Engine Jar that we need; again this automatically installs all of it, and the other jars that we would need in order to work with the Search API.
To code, we just open up the sample file here, and you can see that this is a Demo and this is a Text Search Servlet, so this is using the App Engine APIs; as you can see, they're loaded here. If we're new to this code, we can go to the Outline View, and then we can go past the Import Declarations and we can jump right down to the Servlet and you might remember from the previous movie, which we were coding in Eclipse with Java, that's the pattern that is used in App Engine. We click on that, and it jumps down to get inside of the code, so we can see what this sample application is doing.
Again, it's pretty well documented; this actually comes from Google. It's a Demo Servlet showing the basic Text Search capabilities. Now, if we wanted to make some change inside of here, we could just go ahead, and I'll just show you, there's some code completion capabilities as with Eclipse, even though this is browser-based, and there's code suggesting and hinting. If I went in here and I said Tab, and I said Private, and I did a Control, Space, it's going to again, allow me to use Intel Sense, so it's pretty responsive, for a browser-based implementation. Once our code was working in the way that we wanted it to, then in order to run this locally, we just click this button over here, and what this will do, is this will spin up a set of instances that will then show us this code running, and this is an analogous to when we were working with Eclipse, the local implementation before we would deploy it.
I'm going to let this spin up; this is interesting, it is using Docker, and there it's spinning up and now it's booted and reachable, so we're going to go ahead and click that. This is a Text Search Demo, so we don't have any documents so, we're going to say New One, and then we're going to add it, and we have no Authors or anything, because we didn't sign-in. This demonstrates the use of OAuth as well, so I'm going to go ahead and log-in, and now I'm logged-in, and I'll say Other One, so it's a nice integration and now I can search, so I can say New, and Search and then it shows that there's an author of a new one, at the bottom, here.
So, again it's a fully-functional application and it gets you up and going pretty quickly. It not only uses the servlets of App Engine, but it also uses the Search API that's available commercially through Google; it's a nice little example. In addition to this, we're going to stop this Runner, what we also have is the ability to have integration with Google App Engine, so we can deploy as we could with the plug-in in Eclipse, by clicking on the Deploy and Google App Engine, and we need to authenticate with Google, so that we can deploy this to a live instance on the Google Cloud.
I click, Log-in, and then it asks me if I want to update the application on App Engine, and I click Update, and it's building the project, and deploying.
- What is Google Cloud Platform?
- Saving time and money with cloud services
- Understanding billing
- Enabling services and APIs
- Planning deployments
- Using compute services
- Storing data with Cloud Storage, Cloud SQL, BigQuery, and more
- Using networking, monitoring, and prediction services
- Finding tools to work with the Google cloud
- Implementing Google cloud solutions