Android 使用查询字符串在数据库上发布数据
我必须将数据发布到数据库,并使用查询字符串传递值。我已通过asynctask完成此操作,但数据未发布到数据库-: TelephonyInfo TelephonyInfo=TelephonyInfo.getInstance(this)Android 使用查询字符串在数据库上发布数据,android,mysql,database,Android,Mysql,Database,我必须将数据发布到数据库,并使用查询字符串传递值。我已通过asynctask完成此操作,但数据未发布到数据库-: TelephonyInfo TelephonyInfo=TelephonyInfo.getInstance(this) String imeism1=telephonyInfo.getimeism1(); 字符串IMEISM2=telephonyInfo.getIMEISM2(); 布尔值isSIM1Ready=telephonyInfo.isSIM1Ready(); 布尔值isSI
String imeism1=telephonyInfo.getimeism1();
字符串IMEISM2=telephonyInfo.getIMEISM2();
布尔值isSIM1Ready=telephonyInfo.isSIM1Ready();
布尔值isSIM2Ready=telephonyInfo.isSIM2Ready();
最终布尔值isDualSIM=telephonyInfo.isDualSIM();
类MainThread扩展异步任务{
受保护的布尔doInBackground(Void…params){
HttpClient http=new DefaultHttpClient();
HttpPost=新的HttpPost(url);
试一试{
HttpResponse response=http.execute(post);
//responseString=new BasicResponseHandler().HandlerResponse(响应);//基本处理程序
//返回true;
}
catch(ClientProtocolException e){
}
捕获(IOE异常){
}
//返回null;
返回true;
}
公共void执行(字符串url){
//TODO自动生成的方法存根
MainThread线程=新的MainThread();
执行(url);
}
};
}
}
请帮我解决这个问题。
提前感谢。您是否希望android端出现任何异常?ActivityThread中未找到源代码。performLaunchActivity logcat在此无法拒绝打开访问,请将您的logcat粘贴到此处!太长了。所有警告,没有任何错误
String imeiSIM1 = telephonyInfo.getImeiSIM1();
String imeiSIM2 = telephonyInfo.getImeiSIM2();
boolean isSIM1Ready = telephonyInfo.isSIM1Ready();
boolean isSIM2Ready = telephonyInfo.isSIM2Ready();
final boolean isDualSIM = telephonyInfo.isDualSIM();
class MainThread extends AsyncTask<Void, Void, Boolean>{
protected Boolean doInBackground(Void... params) {
HttpClient http = new DefaultHttpClient();
HttpPost post = new HttpPost(url);
try {
HttpResponse response = http.execute(post);
// responseString = new BasicResponseHandler().handleResponse(response); // Basic handler
//return true;
}
catch (ClientProtocolException e) {
}
catch (IOException e){
}
// return null;
return true;
}
public void execute(String url) {
// TODO Auto-generated method stub
MainThread thread=new MainThread();
thread.execute(url);
}
};
}
}