简体   繁体   English

如何在QPython Android应用程序中运行Flask Project?

[英]How to run Flask Project in QPython Android app?

I have written a code using python and Flask Framework, Which is working fine. 我已经使用python和Flask Framework编写了代码,效果很好。 Now i want to run that complete code in my android phone, Qpython app is there for running python code but the problem is how to setup flask framework in Qpython app. 现在我想在我的android手机中运行完整的代码,Qpython应用程序在那里可以运行python代码,但是问题是如何在Qpython应用程序中设置flask框架。 I got some some solution for installing Flask in Qpyton but don't know the further process. 我有一些在Qpyton中安装Flask的解决方案,但不知道进一步的过程。 Could you please help me. 请你帮助我好吗。

Thanks! 谢谢!

I had this similar situation before, but in my case instead of Qpython, I had Java running on the phone 我以前也有类似的情况,但就我而言,我在电话上运行了Java,而不是Qpython

there are two things you can do here, 您可以在这里做两件事,

  1. Deploying your flask application to a sever, local or whatever you wanna go for and then doing an http request to the server (I used heroku servers in my case but it doesn't respond somethimes as the free dyno sleeps after 30 mins of inactivity or maybe it was the fault of Java ), basically making an Flask API. 将Flask应用程序部署到服务器,本地服务器或您想去的任何地方,然后向服务器发出http request (我使用了Heroku服务器,但由于30分钟不活动或空闲30分钟后免费的dyno睡眠,它无法响应某些内容也许这是Java ),基本上是创建了Flask API。

  2. Using Firebase for cloud messaging . 使用Firebase进行云messaging I don't know what you are trying to achieve but it might help, to provide a gateway or so. 我不知道您要达到什么目的,但是提供一个网关可能会有所帮助。

I hope this helps. 我希望这有帮助。 ;) ;)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM