1. activity之间跳转要到AndroidManifest.xml中注册activity 否则会有The application ActivityMain,***(process com.lxw.activity.layout)has stopped unexpectedly.Plase try again 这样的错误...
<activity android:name=".ZoomBarCode"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".Ccie"
android:label="@string/app_name">
</activity>
2. android 调用WebService
首先 确保AVD没有问题。。。
然后 导入commons-httpclient-3.1.jar 和 ksoap2-android-assembly-2.4-jar-with-dependencies.jar
注意:不要使用UserLiberary; 要使用add External ,Referenced Liberary
String goodsListTranString = "321;432;543;654;765;876;";
// 第1步:创建SoapObject对象,并指定WebService的命名空间和调用的方法名
SoapObject request = new SoapObject("http://service.gis.open", "createLocationInfo");
// 第2步:设置WebService方法的参数
//request.addProperty("deliveryId", "569fd95a-ea5e-4c47-b93f-68215c137c4f");
request.addProperty("goodsListTranString", goodsListTranString);
request.addProperty("userId", 3);
request.addProperty("longitude", "345.345");
request.addProperty("latitude", "321.321");
// 第3步:创建SoapSerializationEnvelope对象,并指定WebService的版本
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope( SoapEnvelope.VER11 );
//envelope.setOutputSoapObject(request);
envelope.bodyOut = request; //
// 第4步:创建HttpTransportSE对象,并指定WSDL文档的URL
AndroidHttpTransport aht = new AndroidHttpTransport("http://127.0.0.1:8080/axis2/services/LocationService?wsdl");
//HttpTransportSE aht = new HttpTransportSE(URL2);
aht.debug=true;
// 第5步:调用WebService
try {
aht.call(null, envelope);
if (envelope.getResponse() != null)
{
//
// SoapObject soapObject = (SoapObject) envelope.getResponse();
SoapObject soapObject = (SoapObject) envelope.getResponse();
//
String deliveryId = "" + soapObject.getProperty("deliveryId");
// 不要用类型转化(String) 这个问题恶心了我两天
//System.out.println(soapObject.getProperty("deliveryId"));
}else {
System.out.println("sorry");
}
} catch (IOException e) {
//System.out.println("�쳣:"+1);
//e.printStackTrace();
} catch (XmlPullParserException e) {
//System.out.println("�쳣:"+2);
//e.printStackTrace();
}
3. Sqlite