0

I have my flask app which would serve my flutter app using HTTP requests. Everything is okay when the mobile phone is connected to the PC. But once after we deploy the app to the mobile phone and detach it from the PC, how would the flask app serve the flutter app?

Is there any way which would start the python script when the flutter app is launched in the mobile phone?

2 Answers2

1

for testing purpose you can use ngrok to deploy your flask server, for more info ngrok

0

Your phone when connected to the PC is accessing a Flask app via 'localhost'. You have two options to make it work (i.e. access Flask based REST APIs from the mobile when not connected to the PC).

  1. Expose Flask app to the network. And make sure both PC and the mobile phone are on the same wifi. This link might help for that.
  2. Deploy the Flask based APIs somewhere. There are few free web servers available out there (e.g. MS Azure). This or this link might help.
Sukhi
  • 13,261
  • 7
  • 36
  • 53