I am trying to generate my first Google Cloud Endpoint and am having trouble generating the client libraries.
First I try doing it with the GPE. It generates an endpoints-libs folder in the Eclipse project with a bunch of files. The readme.html says, "The generated service-specific library can be found in the top level directory of the zip file: google-api-services-mayapp-v1-rev20140417180959-1.16.0-rc.jar". There is no such file generated.
Second, I try to generate with the appengine-sdk. It creates myapp-v1-java.zip, which contains the same files and structure that GPE generates, but I don't see any JAR in there that would contain my endpoints.
I'm using Eclipse Juno Release 2 and GPE 3.5.1. Just did a Check Updates and I appear to be up to date.
NOTE: I am not using Maven and prefer to continue not using it if possible.
How does one generate the client libraries?
I have found no explanation and assume the problem is that the GPE has been updated and the documentation is old.
What has worked for me is to follow this video which an Android client being build to use an endpoint:
https://www.youtube.com/watch?v=NU_wNR_UUn4
The video shows that one must build the endpoint client libraries (from GPE). That generates some source files in the endpoints-lib. Those source files are then copied to the client app.
In my case I was building a Java client app. I followed the instructions for build and Android client app, which are here:
https://developers.google.com/appengine/docs/java/endpoints/consume_android
That shows how to call the service from an Android app. Specifically, it shows how to use the source classes that were copied to the client app from the endpoints-lib. I had to make a few small adjustments. In the end it seems to work.
Related
I'm using Google App Engine and I've followed the instruction to setup Google Debugger as show here:
https://cloud.google.com/debugger/docs/setup/nodejs
My project is written in Node.js and I'm starting the service with this line:
require('#google-cloud/debug-agent').start({serviceContext: {enableCanary: true}});
I've also generated the source-context file.
When I go to the debugger console (https://console.cloud.google.com/debug) I see the green tick about the debug agent running but nothing is displayed on the left side, under "Deployed files".
Any ideas?
What you're seeing is intended behavior. Deployments to App Engine Standard will show the source code as the source files are included on deployment and not using a Docker container while deployments to App Engine Flex are using a Docker container, which currently need not to include the source files, hence why you need a source context information which is generated from a Git Repository. For more information about differences of standard and flex, please see Choose an App Engine environment.
For App Engine Flex app source code to appear on Cloud Debugger, it must be located on a remote code hosting provider. Make sure that you follow the Selecting source code automatically properly. Your main source code (js, yaml, and source-context.json) should be in the root directory of the repository as shown below.
App-directory/
main.py
app.yaml
source-context.json
I've successfully deployed sample application using Github showing the source codes on the left side as shown below.
Some important notes:
When using "Cloud Source Repositories" or "GitHub" or any of the other remote code hosting options, one must take some care:
Changes to the source file must be committed to version control before running gcloud debug source gen-repo-info-file.
gcloud debug source gen-repo-info must be run before deploying the App.
Commits must have been pushed to Cloud Source Repository/GitHub/etc before running Cloud Debugger.
Access must have been granted to the repo to the Cloud Debugger application.
Always redeploy application when there are changes to the repository or source code.
I am new in react+redux. Recently I got a task and have no idea.
Is it possible not to use any web server to run my react+redux project?
After building my project, I got a folder of static files.
Is it possible to place those in CDN not having web server eg. nodejs or tomcat?
thanks.
If you do not need save data on server - you do not need it. Take a look on GitHub pages for sample.
Of course you can but you need an HTML page to be parsed by the browser, in which you would include the necessary SCRIPT tags to load and run your React app.
I recommend you give Surge (https://surge.sh/) a try, it's free right now and you can easily host your React project with ease (including the .html files and every asset generated by your build). You can even create a npm script that builds and then deploys from the CLI with a single surge call. Works like a charm!
You can even use a custom domain name, or choose a specific surge subdomain if it's available, like gibbok.surge.sh. ;)
No it is not possible without a webserver.
If your app is a static website for example, with no server functionalities (like nodeJs) you could host your builded application (static files) on any simple http server included github pages without setup a nodeJs server.
If you app has some dynamic functionalities, example it use nodeJs to work with server file system or db, you need a node server.
In both cases a http server is necessary to delivery JS/HTML and assets to the browser when requested.
On a CDN you could store some static files, which can be used in your project, which is great if you are building a js library.
In case you do not want to care about the http server you could use any simple hosting solution, example GitHub page, or any hosting which allow running a website with some static files.
This is my first time with google apis and I am having trouble implementing the email settings api in eclipse .Please tell me exactly which jar files are to be included and how ? I am getting GmailSettingsService class not found error.Please Help
Thank you
From here:
Didn't you ever want some kind of tool to create new Google Data projects in seconds? Google Data Java Client Eclipse
Plug-in is now available for use.
Using this plug-in you can create a new Java project to interact with
any Google Data API of your choice. Now, you don't need to worry about
setting up the dependencies for your Google Data project. This plug-in
handles all the dependencies and also provides you with an option to
download the external dependencies. It also creates a boiler plate
code to interact with the API that you are interested in. This will
give a quick start to all the newbies.
We are trying to access gmail inbox from our application in Java. We can read inbox, message, add label, but we are in progress to achieve all the desired functionality.
Our conclusions:
-javax.mail embedded in GAE SDK doesn't work, we can't get the content of e-mail, it returns always null (as expected to not work with IMAP protocol).
With the package mail.jar (https://java.net/projects/javamail/pages/Home), the libraries throws an error because there are two libraries with the same name. (javax)
We investigated and we found a solution on Google Groups consisting in copy the files from javamail.jar to our WEB-INF/classes directory in to our project.
After that, javamail library works but com.sun package is not recognized by our project (eclipse) so we can't get the content of an attachment indeed we need to use "com.sun.mail.util" package.
How can add this libraries to our project?
We use:
App Engine Java SDK 1.7.7
GWT 2.5.1
Java Sun 1.6
Eclipse 3.7.2
You should make sure for recieving emails you should turn on the inbound mail services to true
<inbound-services>
<service>mail</service>
</inbound-services>
There is more configuration details that you can read thro in the documentation.,
Recieve email
I started a project with Google app engine, when I use eclipse to start, it automatically generate 4 package for me. My app package name is
com.appspot.xxxx
and it auto generate these three for me:
com.appspot.xxxx.client
com.appspot.xxxx.server
com.appspot.xxxx.shared
What does these three package convention means? Thank you.
First of all, to be clear, these packages are being created because you've chosen to create a Web Application that includes GWT code.
GWT compiles the code in your client and shared packages (by convention) into JavaScript which will run on your user's browser.
The GWT client-side code will communicate to your server, whose code will go in the server package. The server-side code can (again, by convention) use code in the shared package, so logic like validation can be used in both client and server code.
This is not an artifact of the app being an App Engine app, but rather of it being a GWT app.
When you register the application, it will be hosted at http://xxxx.appspot.com. You choose the value for xxxx, e.g. your application's name.