我有一个小小的困惑,在我们的移动应用程序中,从ios调用的ksoap Web服务如下所示:并正确获取数据.在下面的Web服务中,您可以从以下代码中看到,有一些参数需要传递给Web服务.
-(void)callwebservice{
NSString *soapMessage = [NSString stringWithFormat:
@"<s:Envelope xmlns:s=\"http://schemas.xmlsoap.org/soap/envelope/\"><s:Body><Calculate xmlns=\"http://tempuri.org/\"><inputRate>%@</inputRate><rateFrequency xmlns:a=\"http://schemas.datacontract.org/2004/07/FusionPeople.MobileContractor.DomainModel\" xmlns:i=\"http://www.w3.org/2001/XMLSchema-instance\"><a:RateFrequencyId>0</a:RateFrequencyId><a:RateFrequencyName>%@</a:RateFrequencyName></rateFrequency><nonTaxableExpense>%@</nonTaxableExpense><expenseFrequency xmlns:a=\"http://schemas.datacontract.org/2004/07/FusionPeople.MobileContractor.DomainModel\" xmlns:i=\"http://www.w3.org/2001/XMLSchema-instance\"><a:RateFrequencyId>0</a:RateFrequencyId><a:RateFrequencyName>%@</a:RateFrequencyName></expenseFrequency></Calculate></s:Body></s:Envelope>\n",txtinputrate.text,lblrate.text,txtexpenses.text,lblexpense.text
];
NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:@"%@MobileContractorCalculationService.svc",[MobileContractorAppDelegate getstrIpAddress] ]];
NSMutableURLRequest *theRequest = [NSMutableURLRequest requestWithURL:url];
NSString *msgLength = [NSString stringWithFormat:@"%d",[soapMessage length]];
[theRequest addValue:@"text/xml; charset=utf-8" forHTTPHeaderField:@"Content-Type"];
[theRequest addValue:@"http://tempuri.org/IMobileContractorCalculationService/Calculate" forHTTPHeaderField:@"SOAPAction"];
[theRequest addValue: msgLength forHTTPHeaderField:@"Content-Length"];
[theRequest setHTTPMethod:@"POST"];
[theRequest setHTTPBody: [soapMessage dataUsingEncoding:NSUTF8StringEncoding]];
NSURLConnection *theConnection = [[NSURLConnection alloc] initWithRequest:theRequest delegate:self];
if( theConnection ){
webData = [NSMutableData data] ;
}
}
Run Code Online (Sandbox Code Playgroud)
在android方面的另一方面我已经尝试了很多方法来调用这个Web服务并将数据传递给Web服务.但每次我得到服务器端错误代码:415,请有人帮助我并告诉我如何将此分层数据传递给这种类型的ksoap网络服务....
我试过以下代码:
try {
SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
request.addProperty("inputRate", …Run Code Online (Sandbox Code Playgroud) 我正在开发一个图像编辑器的Android应用程序,如:BeFunkey 我已经实现了很多这样的Android应用程序的效果,但仍然有些影响对我来说很头疼.喜欢PopArt效果.请看下面的图片.一个是原创,第二个是popart彩色效果:
原版的 ::

流行艺术 ::

我使用了RGB Color Matrix来获得位图的颜色效果.但是当我使用它时,它在整个图像中就像一种颜色一样,但在这种效果中,图像上有多种颜色.如果有人可以指导我,请告诉我如何才能实现这种色彩效果.感谢您的时间.
以下代码我用于颜色效果::
public static final float[] float_color_matrix = new float[] { 2.6f, 0, 0.1f, 0, 0, 0.1f, 1.2f, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0 };
ColorMatrix cm = new ColorMatrix();
cm.postConcat(new ColorMatrix(float_color_matrix));
ColorFilter colorFilter = new ColorMatrixColorFilter(cm);
imageView.setColorFilter(colorFilter);
Run Code Online (Sandbox Code Playgroud) 我有一个像字符串46542.5435657468,但我希望格式化这个字符串,并在点"."后只需要两个charector.喜欢46542.54.请建议我需要使用哪种String方法.