500 Server Error using Python - android

Please bear with me as I am a complete noob and trying to create a database for my app using App Inventor.
According to Google App Launcher, I have successfully created my app. However, when I load mcdougaltextspeak.appspot.com into my browser, I get the following message:
Error: Server Error
The server encountered an error and could not complete your request.
If the problem persists, please report your problem and mention this error message and the query that caused it.
I am following the directions provided on http://appinventorapi.com/program-an-api-python/ and I'm sure my issue is because I am not correctly modifying the default app.ymal file
Here's what I have according to the directions:
application: textspeakedtech597
version: 1
runtime: python27
api_version: 1
threadsafe: true
handlers:
- url: /images
static_dir: images
- url: .*
script: main.py
I initially just changed myapp to mcdougaltextspeak, however I got a message that I needed to modify the code for python 2.7 according to this site:
https://developers.google.com/appengine/docs/python/python25/migrate27
This site also included modifications for other things, so I am wondering if my error stems from this. The directions do not make note of modifying any other code. Do I need to modify/add the code that appears on the migrate to python 2.7 page (see above link) and if so where does it go.
My app is stuck without a location to hold data.
Any advice on how to proceed is greatly appreciated.

Have you actually created an app on https://appengine.google.com?! You need to do that first, then your app.yaml should contain the appid that you have created i.e. application: mcdougaltextspeak & not what it is in the tutorial.
After you've edited the app as you want, you must then deploy the app to the Google App Engine Servers (refer to the GUI deploy). You would get detailed logs when deploying, which would tell if the deployment was successful or not.
After deploying, you can then goto https://mcdougaltextspeak.appspot.com & play around with your online app. If you still get errors, check https://appengine.google.com/dashboard?&app_id=mcdougaltextspeak for the logs & report them here.

Related

Cannot get google-services.json file for Google Play Services

I am currently working on updating the Google Login process in my app using google-services 3.0.0 and play-services 9.6.1 and am having troubles getting the required google-services.json file to include in my project.
I am following the setup guide and trying to get the json file from https://developers.google.com/mobile/add?platform=android.
When I pick my app from the dropdown menu I get a 'bad request' error message.
I went ahead through the process anyway, choosing only Google Login for the service but I still get an error when I attempt to download the google-services.json file
This is what is returned when I attempt to download the file
)]}'
{"code":3,"errorSpace":"generic","placeholders":{"trackingId":"123456789"},"status":400,"message":"backend error"}
Looking at the form that was sent in Fiddler, the query string is
["getArtifactRequest",null,"android:my.app.package","2","123456789"]
(After replacing the trackingId and the project Id numbers in these two requests)
Attempting to go back through the process gives me an error stating that the package already exists (Which it does). Other places seem to imply that I could use this method repeatedly as a way to re-generate the json file though.
The app was already listed in the OAuth 2.0 client IDs on the developer console site when I did this. I also went through it a second time for a debug version of the app which was not already created, but I received the same messages and outcome.
Has anyone else seen this issue and found out how to fix it?
After switching projects for a bit and checking back today, I went through the same process as listed and it worked just fine. I haven't changed any settings, so maybe it was a problem on their end for a while. Wish there was something more helpful to say about this, but it just works now.

404 Error when running TicTacToe sample (Android) against sample Google App Engine project (Java)

I set up the Android App and Google App Engine backend as seen in these two projects:
Android Connected App Engine Project
Java App Engine Backend Project
When I click a TicTacToe-field button, which triggers a request I get an 404 error: "Not found"
04-09 23:11:51.115: W/TicTacToe(26247): GetComputerMoveTask: 404 Not Found
04-09 23:11:51.115: W/TicTacToe(26247): Not Found
That is exactly the what https://myappname.appspot.com/_ah/api/ in the browser shows "Not Found".
Here is what I did:
Created an api project on App Engine Console
There created an Android Client Id with com.google.devrel.samples.ttt as package an my debug keys SHA1-fingerprint
There created a Web Client ID
Integrated the Android Project in eclipse. Updated DEFAULT_ROOT_URL in Tictactoe.java to "https://myappname.appspot.com/_ah/api/"
There updated the value of AUDIENCE in ClientCredentials.java by replacing the string "your_web_client_id" with the generated web-client-id from step 3
Integrated the Java backend project in eclipse.There updated the value of application in appengine-web.xml to myappname
Updated the values in /spi/Ids.java to reflect the web-client-id and android-client-id from step 2 and 3
Updated the value of google.devrel.samples.ttt.CLIENT_ID in war/js/render with web-client-id
Deployed the backend to google. Worked great - it opend the https://myappname.appspot.com/ page showing the correct page after deploying (servlet)
Deployed the android app and tried to make a move in TicTacToe. The app crashes.
I think its very suspicious my DEFAULT_ROOT_URL is set to "https://myappname.appspot.com/_ah/api/" in my Android app whereas this pages show just "Not found" in the browser.
Whats going wrong here?
Thanks in advance
Try to test your API at https://your_app_id.appspot.com/_ah/api/tictactoe/v1/ and see if that doesn't do what you want.
Research from this link:https://github.com/GoogleCloudPlatform/appengine-endpoints-tictactoe-android/blob/master/app/src/main/java/com/google/api/services/tictactoe/Tictactoe.java
Lines 60-74
https://github.com/GoogleCloudPlatform/appengine-endpoints-tictactoe-java/blob/master/src/com/google/devrel/samples/ttt/spi/BoardV1.java
Lines 29-31
I suspect you have the API URL wrong, and diving in the code its apparent that the above URL is correct.
No idea where are you getting the instructions for step 4 (in your list), but looking at Setup Instructions in the for the Android project, step 2, what you should do is:
Update the value of DEFAULT_ROOT_URL in src/com/appspot/api/services/tictactoe/Tictactoe.java to point to the location where you are hosting a Tic Tac Toe backend (based off of the Java backend example).
And the location in your case is crearly "https://myappname.appspot.com/".

WHy my URl gives disalowed characters error?

I am trying to build an android app for which i was going through the hackerrank api documentation. This is the general format of the request to be made :
api.hackerrank.com/checker/submission.json -d 'source=print 1&lang=5&testcases=["1"]&api_key=yourapikeyfoobarbaz'
I pasted my key and made the request but got the error "The URI you submitted has disallowed characters"
The documentation however shows that proper response has been obtained.
This is the link to the documentation : https://www.hackerrank.com/api/docs
Since i am new to android development i am not able to figure out my fault. Can someone please guide me.

Bluemix android app .. no applicationId was specified exception

I want to run an android app using bluemix. I followed these steps:
http://www.ibm.com/developerworks/library/mo-android-mobiledata-app/index.html#N10131
But I'm facing an exception saying that the Application ID is not found:
Exception: 07-21 13:03:04.017: E/AndroidRuntime(1776):
java.lang.RuntimeException: Unable to create application
com.ibm.bluelist.BlueListApplication:
com.ibm.mobile.services.core.internal.IBMBluemixException:
IBMBLUEMIX-0042E: Initialization failed because
I have used my own Application ID, secret and route but I'm still getting this error. Can any one please help on this?
Based on the Message ID, I think this is the full error message.
"Initialization failed because no applicationId was specified"
#whitfiea is correct. You need to make sure the AppID is correctly specified for the Mobile Cloud application you are trying to reach (as well as check the other values, the appSecret and the appRoute).
The appRoute should be something like "BlueList.mybulemix.net"
I would also suggested downloading a new set of IBM Client SDK for Android JARs for your project. I would also recommend downloading a new copy of the BlueList sample from JazzHub, as corrections have been made to the application.
One final suggestion, create a new Mobile Cloud Application Backend, just to make sure you are at the current code levels for the client-side and the cloud side.
1.Please try applicationRoute in bluelist.properties file without any prefix like http.
Make sure your application is of type Mobile Cloud under boilerplates.
Verify the below step given in article.
Your Android app will need basic network capability and permissions, so we've included the following permissions in the manifest file. Open up the AndroidManifest.xml file to take a look.
Thanks.

unable to cast to personal whitelisted receiver app

I have successfully used the Android TicTacToe app to cast to the TicTacToe receiver app (AppID "TicTacToe"), using unmodified code from the TicTacToe example on github.
Next, I tried to use my personal receiver app. I got the email a couple of hours letting me know that my device was whitelisted and providing the AppID. I put the AppID in line 90 on GameActivity.java (not line 91, as stated in the instructions), and I also put it in line 35 of tictactoe.html (this step was missing from the instructions, but I assume it is needed). I also followed all steps in the Common Errors section of the instructions.
When I click the Start button in the Android app, the Tic-Tac-Toe board appears in the Android app, but the Chromecast device does not noticeably react.
Here is the LogCat:
07-28 00:13:47.776: W/StartSessionTask(10892): StartApplicationRequest failed with status: -4
07-28 00:13:47.826: E/ApplicationSession(10892): StartSessionTask failed with error: failed to start application: request failed
07-28 00:13:47.826: D/GameActivity(10892): start session failed: failed to start application: request failed
Try checking the box that says "Send this Chromecast's serial number when checking for updates".
Mine didn't work at first, after doing this and restarting mine seemed to pick up the whitelisted appID.
As mentioned by the author of question: Make sure to do from ChromeOS, Windows or Mac OSX client until they fix the issue from Android app.
Clients can be downloaded here: https://cast.google.com/chromecast/setup
This was fixed for me after I restarted the chromecast by removing power.
I tried Aaron's answer several times (was finally able to get the setting to stick using the Chromecast Mac app) but it still was giving this same error.
Then, I discovered I actually uploaded the receiver file to the wrong url. So double check which url was actually whitelisted!
Though even after fixing the url it still was broken. So I think I must have entered the wrong serial number when I made the whitelist request. I resent the whitelist request and the new app ids are working properly.
I solved same problem by using HTTP instead of HTTPS for my local hosted receiver, it seems Chromecast looks for valid certificate.

Categories

Resources