gpt4 book ai didi

android - 如何从 android 手机 db(sqlite) 上传记录到网页

转载 作者:行者123 更新时间:2023-11-30 04:24:53 25 4
gpt4 key购买 nike

我想设置一个 Android 应用程序,它的数据库中有一些记录,用户可以将记录转发到服务器数据库并在网页中显示它们

谁能给我建议这个过程的要求

最佳答案

试试这个

SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
private static final String HostUrl =" http://test.gloriatech.in:5657/Service.svc";//(your url)
private static final String NAMESPACE = "http://tempuri.org/";
private HttpTransportSE httpTransport = new HttpTransportSE(HostUrl);
SoapPrimitive response=null;
final String methodname="InsertGPSInformation";
request = new SoapObject(NAMESPACE,methodname);
envelope.dotNet = true;
TelephonyManager telephonyManager = (TelephonyManager)getSystemService(Context.TELEPHONY_SERVICE);
String getImeNumber=telephonyManager.getDeviceId();
SimpleDateFormat sdfDateTime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String newtime = sdfDateTime.format(new Date(System.currentTimeMillis()));
request.addProperty("IMEINumber",getImeNumber);
request.addProperty("Longitude",longitudeField.getText().toString());
request.addProperty("Latitude",latituteField.getText().toString());
request.addProperty("Date",newtime);
request.addProperty("formName",className);
envelope.setOutputSoapObject(request);
String result = null;
try
{
httpTransport.call(NAMESPACE+"IService/"+methodname, envelope);
response = ( SoapPrimitive )envelope.getResponse();
result=response.toString();
}
catch(Exception e)
{
Toast.makeText(this, "Exception"+e.toString(), Toast.LENGTH_LONG).show();
Log.e("Upload Picture Error:",e.getMessage());
}
Toast.makeText(this, ""+result, Toast.LENGTH_LONG).show();

关于android - 如何从 android 手机 db(sqlite) 上传记录到网页,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8676418/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com