作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
谁能给我建议这个过程的要求
最佳答案
试试这个
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/
我是一名优秀的程序员,十分优秀!