Can I connect to a GAE app from a Java ME application? - python

I just finished working on a GAE application in python to retrieve flight data and return the result to the calling URL.
I tested it in a browser at it works, but my Java ME application, which is able to retrieve data from other websites turns up nothing from the GAE app which is already hosted on GAE.
I know Google has some authentication issues, but does this apply to GAE apps as well, and what can I do?

Related

How to run python programs for android app in cloud for each user

I have a python programs & classes combined together by main.py for the backend algorithms and works. I was developing the app for android using Jetpack compose in android studio.
Last week I started my research for cloud services that can run my python programs for my android.
I find that App Engine of Google Cloud Platform and Firebase. But after looking for tutorials I couldn’t find a way to work with App engine so I decided to go for Firebase.
In Firebase page, they had a service called - Cloud function. Now as per my understanding even I if I had gone with App engine, I would have used the Cloud function too.
How my app works?
My app is a social media app. I have a MongoDB server cluster in MongoDB Atlas that store every data. For authentication I had decided to go just for plain custom username & password stored encrypted on my same MongoDB server, but I was open to Firebase Authentication too. Since my app had a feed where photos, videos are stored - I needed a cloud storage for that. I found that Google Cloud storage for that.
So back to my question. Is there any service that is server-less (as I’ve very less people in my team to manage a server too) that can run Python programs for different requests from different users of my android app.
For sake of comparison, my app can be compared to Instagram without Reels!
My question is how to upload my python project, which contains different classes that are used to as algorithms for my app. It's like this, for ex., if an user goes to feed page then it has to call function in my python program that gets the feeds as per calling user's preference & followed accounts. My understanding is that I have to call this function from my android app.
I need help to find a tutorial for following things:
How to set up Firebase or App Engine & implement it in Android Studio
How to deploy my python files to firebase or App Engine for Cloud Functions
How to call this function from Android app (Kotlin + Compose) and receive in Python.
Note: I've already implemented the class that communicate with my MongoDB Atlas, So I also have functions in Python that updates the MongoDB.
Finally, how to upload the files from user input in Android app to Cloud Storage through my Python functions. And how to download files from Cloud Storage to Android app through my Python functions.

What Google app engine Auth to use to only expose my "intranet" site only to my GSuite users?

I am pretty new Google app engine, and though I have hacked around with alot of languages, I am finding the google documentation a little overwhelming. I have successfully launched a static site, and successfully run some python code from the console. But I have not run any python from my static site.
I am a Small company trying to setup a google app engine static/dynamic website that I only want to expose to my Gsuite users.
I have some python code I want to run on my app engine, which will download a file from gdrive/teamdrive, process the file, create a new file from the results and then upload the resulting file to the same folder.
I may also at a later date have this static/dynamic website also interfacing with Cloud SQL(mysql) or an external database.
my Questions
What authentication method to use to only expose this website to my gsuite users?
Though I have worked through some of the GDrive api examples whats the best and easiest method of passing GDrive text files to my python code? (though I have hacked around with python lots in the past, the html and python combination perplexes me)
Thanks!
You would use OAuth2.0 to acquire a token which you can then use to interact with that user's files through the GDrive API (see "About Authorization" as well as this quickstart Python example).

Do rest servers need to be hosted on a website or CMS?

I need to create a REST server of a python module/API of a BCI, so that the application can be accessed on my Drupal website. Will I need to create and host the REST server on a python-based website or CMS, so that it can be accessed by my Drupal website, or is the api and rest server uploaded and hosted directly on my web hosting server? If so, what is the simplest python CMS that for creating a REST server for a python module/API already available?
The beauty of REST is precisely that it doesn't matter where your API is, as long as its accessible from your Drupal server, or from the client if you have a javascript API client.
If it's a simple application and you have admin access to your Drupal server, there's nothing preventing you from hosting the Python webservice side-by-side. They may even share the same HTTP Server, like Apache or Nginx, although depending on your demands on each one it might be better to keep them separate.
If you're new to Python, the Flask framework is a decent option to write a simple REST-like API interfacing with a Python module.

Execute python script in localhost

I have downloaded and installed python on my PC. I am learning python at this moment so I am a beginner.
Is there anyway I could execute python scripts in localhost (Apache) and view them in a web browser as we do with PHP? I am executing the python scripts from CLI at this moment.
Although there are multiple solutions, I would take a look at mod_python. Unfortunately, in my experience it is not the easiest thing in the world to set up and requires making changes to httpd.conf, but this tutorial is helpful (and gives some examples).
Google App Engine SDK for Python includes a local web server application that simulates the App Engine environment. It allows for instant server script changes by just saving the file and refreshing the browser.
The development tutorial is here
Once you have your web site working locally, it is easy to deploy it live on Google's App Engine servers.

Accessing Google Groups Services on Google Apps Script in Google App Engine?

I'm trying to work out if it is possible to use Google Apps Scripts inside Google App Engine?
And if there is a tutorial in doing this out there ?
Through reading Google's App Script site I get the feeling that you can only use app scripts inside Google Apps like Drive, Docs etc?
What I would like to do is to be able to use the Groups Service that is in GAS inside GAE to Create, delete and only show the groups that a person is in, all inside my GAE App.
Thanks
No you can't. AS and GAE are totally different things and won't work together.
What you can really do is (abstract):
write an AS that does what you need
redirect from GAE to the AS url to make sure that the user logs-in/grants permissions.
perform what you needed to do with AS
send back the user to GAE with a bunch of parameters if you need to
If you need GAE in Google Apps script, you can write a webservice in GAE using UrlFetch in Apps Script: https://developers.google.com/apps-script/service_urlfetch
To give you an example: I created an Apps Script to get report data (json) from an appengine webservice. This data is added to a google apps spreadsheet.

Categories