繁体   English   中英

如何让 Android 应用程序在没有互联网的本地服务器上等待来自 Python 的消息?

[英]How to make Android app wait for a message from Python on a local server without internet?

抱歉,如果这是一个愚蠢的问题,我仍然是 Android 的初学者,找不到我的问题的答案。 我正在制作一个 Android 应用程序,该应用程序将输入发送到服务器并在该服务器上执行 Python 脚本以处理给定的输入并生成 output。 我使用 SSH 成功地将数据从 Android 客户端发送到 Python 服务器。

我还可以使用 SSH 将 output 检索回 Android 客户端。 However, the Python script takes some time to generate the output, and I can't seem to find a way for the Android client to wait for the Python script to finish generating the output. I was able to do this on internet connection with using Firebase database and have the Python script upload the output into Firebase database and have the Android client listen for changes in database. 但我正在寻找一种在没有互联网的情况下在本地执行此操作的方法(即 Firebase)。

So is there a way to make my Android application wait for a message from Python to know it has finished with generating the output so it can retrieve it back using SSH or any other way?

是一个协议,它发送了一个代码,如果这两个文件相同的话,应该说什么。 但我不记得名字了。 因为您将更容易将存储信息的位发送(到设备),然后开始重要的传输。 当设备丢失连接时,需要将实际存储 memory 与发送的第一个信息进行比较,如果不匹配,则要求用户重新连接到互联网或类似的东西。 也许正在帮助,直到有人会给你答案。

暂无
暂无

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

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