1

I want to build a Client Android Application that can insert data and send it for processing to a parse-server that is running in AWS cloud. The server will process the data and save it to a parse-dashboard and send the processing results to the client back?

I have a Linux virtual machine instance from AWS EC-2 and it is running. I have the code for the client in android java that has a connection to parse server using master-key, app-id and the other details needed for connection.

Tom Fox
  • 897
  • 3
  • 14
  • 34

1 Answers1

0

I'm not entirely sure what you are asking but here we go...

The server will process the data

When your Android client sends a request to your Parse Server using Cloud Code there are a number of 'triggers' you can use to process requests. I think the beforeSave trigger would probably make the most sense in your use case but you can check the cloud code guide for more information.

save it to a parse-dashboard

When you send a save request from the android client there is no need to save it to the dashboard, the request saves the object to your database which is then retrieved by the dashboard when you go to view it.

Also any changes you make to the object in the beforeSave trigger will be reflected in the dashboard.

send the processing results to the client back

If you alter the object in the beforeSave trigger, I believe if you want to get the updated object on the client you will then have to query for it - see the section on queries in the Android Guide

Tom Fox
  • 897
  • 3
  • 14
  • 34
  • Ok, I understood this, thank you. I'm willing to write a python code script algorithm Machine Learning (that requires training and testing). I have two questions: (1) I want to run this script in the server as a back-end that gets new data (testing data) from client through TCP\IP socket and will process this data, then send the results back. Where should I put this script? (2) There's no Parse SDK for Python, so the python script has no access to the parse-dashboard for retrieving data from database, what should I do? – כינאן סובח May 05 '19 at 22:25
  • 1. You can’t run a python script directly in Parse Server (it’s a Node.js environment), you will have to host the script somewhere else and use webhooks/http requests/cloud code triggers to communicate back and forth. – Tom Fox May 05 '19 at 22:31
  • 2. You can still use Parse Server with Python, you will just have to use the rest api directly - see this question for how to write a rest api request in python https://stackoverflow.com/questions/17301938/making-a-request-to-a-restful-api-using-python#17306347 – Tom Fox May 05 '19 at 22:32
  • Could you explain how to use Webhooks in AWS EC2? I searched alot and didn't find anything. I need to run python function. thanks – כינאן סובח May 09 '19 at 16:11
  • Take a look [here](https://docs.parseplatform.org/cloudcode/guide/#cloud-code-webhooks) – Tom Fox May 09 '19 at 16:27
  • Yeah I saw this. Lets say I have a python script: its content is print("hello"). I created a webhook using my Parse Dashboard and got a URL for it: https://SERVER_URL/parse/hooks/Function The question is how do I upload the python script (that prints hello) to the specific URL I have put for the webhook? – כינאן סובח May 09 '19 at 16:34