Google App Engine - Eclipse Authentication - java

I have the Eclipse GAE Plugin keeping memory of a previous Google Authentication and thus not allowing me to upload a GAE app associated to a different account. The strange thing is that I can't find any GAE button at the bottom of My Eclipse Installation (as mentioned in some docs on the Internet). The only thing I have managed to do is to add the --no_cookies option in the upload command which opens a new tab in chrome allowing me to provide the right auth.
Unfortunately this doesn't seem to update the Eclipse configuration so I have to do it at any upload.
How should I fix that?

Related

Intellij: Getting Started with Google App Engine

I try to create a Google App Engine project in Intellij 2016.3 based on this tutorial. The described "Google App Engine" plugin does not exist. I used the "Google Cloud Tools" instead. I enabled it, downloaded the actual Cloud SDK and added it to the App Engine under "Build, Execution, Deployment".
When I try to create an App Engine project as described in the tutorial, I should add under "Additional Libraries and Frameworks" the Google App Engine but this selection is not available. The project created without it is a standard Java project with no relation to the App Engine.
What do I have to do to create a Google App Engine project in Intellij?
Ok, the answer is already in the comment from Dan Comilescu above. I found it independently after exchanging almost 10 emails with Jetbrains. They first told me that Google App Engine is included by default into Intellij. Therefore everything should just work as described. Only after checking the logs they became aware that the problem is that it is only included in the Ultimate edition of Intellij. The Community edition does not have it and therefore can not use it! I urged them to put that on top of their tutorial page and meanwhile they have added it.

How to update the App Engine Application Name when using Google Account UserService

I have an existing App Engine (Java) app and we use the UserService for Google Account authentication of our users.
We'd like to update the Application name that shows up on this screen when users click through to allow access to their Google Account:
I am pretty sure it was an option in the old App Engine console/settings screen but I cannot find it in the new settings screen.
Does anyone know where this setting has been moved to or how to update the Application name?
As an aside, incase any App Engine team members track this tag, is App Engine OK? Is anyone testing it? I am a bit nervous! This is how my settings screen looks in the new Cloud Console:
From the Signing in and out section of the Users Java API Overview doc:
If your app uses Google Accounts or Google Apps for authentication,
the name of your application appears on the sign-in page when the user
signs in to your application, using the application name you chose
when registering the application. You can change your application name
in the Google Cloud Platform Console projects page. Click on the
pencil icon for the project you want to rename.
Confirming the answer from #steeling in this python Q works:
https://stackoverflow.com/a/36829844/883778
Not sure if there's a proper way to refer to another question's answer as the answer for this question. If there is let me know.

Google picker not working when deployed to gae

I have developed an app in Java - Eclipse to upload images to google app engine using Google Picker API. While in development mode it works as it should, when i deploy it to Google app engine, the code stops working (as it does in development mode (stops uploading images to drive)).
I have created a Browser key, and I have that key as API key for the app. Also, in allowed referers, i have it as any referer its allowed.
I suspect that i dont have to show any code, as this isnt a coding issue. If it was, it wouldnt be working in dev mode.
Can you help me out?
I found the error myself.
I read somewhere that an app behaviour in eclipse dev mode could be slightly different than an app behaviour deployed to google app engine.
So, i opened developer tools in chrome, and debugged the application. I found out that a function which wasnt throwing any error in dev mode, was actually throwing a null pointer exception in gae. So I debugged this, and corrected the code that was messing up the code in google app engine.
And now it works.

How do I connect my Desktop Java Application to an Existing GAE Datastore?

Currently I have a very basic desktop Java application in Eclipse that is meant to add entities to an existing project's datastore on Google App Engine. I have it all setup right now but since I am new to working with Google App Engine, I have no clue on how to get the application to send the Entities into the datastore of my existing project.
I tried looking this up online but most of what I found was for making java web apps. My goal is to have the application running as its own application, not through a browser.
So, what do I have to do to make the application connect to my GAE datastore? Is there some code I need to type, or perhaps some xml file I need to have within the project? I am just using the Java Eclipse plugin for Google App Engine.
Thanks for the help!
Based on the language of your question, I think you really need a big-picture sort of answer, rather than any specific code. Therefore:
You have a desktop application. This runs on some desktop computer.
You have a Google App Engine application with its data store. This runs in Google's data centers.
These are not the same computer. Therefore, they must communicate over the network in some fashion — that is the missing piece you're looking for.
Since GAE is designed around doing web applications, I recommend you think of this as a “web service” situation — that is, your desktop application makes HTTP requests to your GAE application. (The situation is simplified over the general case because you are writing both the client and the server.)
I recommend you read about designing simple web services and do whatever seems to fit your application.
One important warning: Unless your GAE application only ever has one user, you must not simply write a bridge that gives access to the data store over HTTP, because then anyone can make arbitrary changes to other people's data. As it is said for multiplayer game design: don't trust the client — that is, only accept network requests that make sense according to the rules of your application, and do not expect the client to enforce those rules. This is because anyone can make requests to your GAE application using something other than your desktop application, so you must assume you could receive arbitrary requests. This is the fundamental nature of the Internet.
For example, in the simple case of a multi-user application whose users do not interact with each other using the application, this means that every request that, say, updates a record, should only update a record which belongs to the logged-in user, not one of any other user.
For anyone that gets this problem in the future, I got an answer to it. I just tried experimenting around with the project settings and found it. So as it turns out, after you have installed the GAE Eclipse Plugin, you can just right click your project folder in the Package Explorer, go the Google sub menu, then click on App Engine Settings... .
From there, you need to check the Use Google App Engine checkbox, then in the deployment section, just fill in your project's Application ID. Your project's application ID can be found under the Application Settings tab of your project's online Google app engine dashboard. It is listed there as your Application Identifier.
Turns out that for me, I will need to find a different solution as you cannot integrate GAE with a desktop application that uses the Java Swing library. Bummer :/

Getting facebook deeplinks to work on emulator facebook android

The problem I'm trying to solve- I'm trying to get deep linking working, and testing it with Emulator. When clicking on posts, the links direct to the mobile web site. This is in the case of the user having permissions for the app, and the app is installed (on the emulator). In the Facebook app, it even acknowledges its out of date, but an upgrade (in app) crashes.
I also noticed that the Facebook app installed on the emulator is out of date (I installed it via adb install facebook.apk from github sdk).
SSO is working fine, and I have setup deeplinking effectively with iOS before (So I know how ti's supposed to work/test it, etc.). But the port to Android is being held back by this out of date 3rd party Facebook app. I'm assuming testing on device will solve it, because there the Facebook app will be the latest (which brings to mind- what if people haven't updated their android facebook app?).
My app settings:
I'd post code, but this seems to be pure integration and configuration issues.
Note: my app isn't published on Google Play, could that be the issue?
Also: maybe this is only testable on the device? My device is "in the mail" so trying to get this done with emulator as much as i can.
Update: Facebook told me that this requires the Facebook app 1.9.* which is not in the SDK. So, I got my hands on a device, and while I haven't solved it, at least the app bookmark functionality is working. Will update if/when I find the answer.
Update 11am: I finally got it to work!
I had to publish my app in the Play/Market.
Each time I tested, log out of FB-Android app, clear cache, and force stop. Acc.
to the documentation the bookmarks are cached. I also think the
facebook app-syncing occurs on launch, and never again. So if you
change anything in FB's app settings, you need to log out/clear
cache/stop for it to take in the fb android app.
Only one key worked, even though it says "hash" in the fb app settings, I think
my dev key was screwing things up. Double-confirm that your release
key is the same as the one listed in app settings.
The final secret sauce for me, was to turn off SSO and deeplinking, re-test
without anything set. Also, remove dev package from phone and
download from Play. (see: key mixups). then, I stepped back through
the configurations by first turning on SSO, testing, then turning on
the native deep linking.
Only works on real device, not emulator (unless you can get 1.9 installed on emulator, may work, did not go down that route to test)
Not sure if this matters, but it may: install app from Store/Play, not from Eclipse. Could be the key syncing thing.
I figured it out- involved doing the following:
I had to publish my app in the Play/Market.
Each time I tested, log out of FB-Android app, clear cache, and force stop. Acc. to the documentation the bookmarks are cached. I also think the facebook app-syncing occurs on launch, and never again. So if you change anything in FB's app settings, you need to log out/clear cache/stop for it to take in the fb android app.
Only one key worked, even though it says "hash" in the fb app settings, I think my dev key was screwing things up. Double-confirm that your release key is the same as the one listed in app settings.
The final secret sauce for me, was to turn off SSO and deeplinking, re-test without anything set. Also, remove dev package from phone and download from Play. (see: key mixups). then, I stepped back through the configurations by first turning on SSO, testing, then turning on the native deep linking.
Only works on real device, not emulator (unless you can get 1.9 installed on emulator, may work, did not go down that route to test)
Not sure if this matters, but it may: install app from Store/Play, not from Eclipse. Could be the key syncing thing.
Have you had a look at the troubleshooting tips for deep linking? (Sorry, have to ask.)
I'm wondering if perhaps the FB app on your device was not properly quit after the relevant setting changes.

Categories

Resources