简体   繁体   中英

how to send data from android device to python website

我想使用python创建一个网站。我创建了一个android应用程序,它将值发送到特定网站,我想读取网站中的值并必须使用python在网站上显示它。我有用于发送的android辅助代码我需要使用python脚本在网站上接收数据的代码。

One way to go is to use 'Flask.'

There's a brief SO question/answer regarding basic functionality here. It includes the necessary code (~6 lines, I believe,) but I'll replicate it here for your convenience:

from flask import Flask, request

app = Flask(__name__)
@app.route('/', methods=['GET', 'POST'])
def parse_request():
    data = request.data
    # use data here

The product's quick start guide is located here.

I hope this helps!

look i am not python developer but i think it same structure you will use in all language , you need to make web services in python

http://www.diveintopython.net/soap_web_services/index.html?utm_content=buffer38256&utm_source=buffer&utm_medium=google&utm_campaign=Buffer

this kind with services deal with xml data to transfer data from android client to your server , and when you finish your services you will using KSOP2 Lib in android to deal with this services

http://javatutorialspoint.blogspot.com/2012/02/android-web-service-access-using-ksoap2.html

this way i implemented before and help me

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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