스트림이 실제로 있는지 여부를 확인하려고합니다. 나는 그 파일을 가지고있다 (http://www.calvaryccm.com/ServiceTimes.asmx/IsServiceTime). 스트림이 활성화되면webservice가 true 또는 false를 반환하는지 Android Xml 확인
<boolean xmlns="http://tempuri.org/">false</boolean>
는이 반환 :이 스트림이 비활성 상태 일 때 그것을 반환 것입니다
<boolean xmlns="http://tempuri.org/">true</boolean>
true 또는 false를 반환합니다. 도와 줘서 고마워.
저는 최근에 iOS에서 동일한 작업을 수행했으며 이것이 XML을 검사 한 방법입니다.
NSError * error = nil;
NSString * responseString = [NSString stringWithContentsOfURL:[NSURL URLWithString:@"http://www.calvaryccm.com/ServiceTimes.asmx/IsServiceTime"] encoding:NSUTF8StringEncoding error:&error];
NSRange range = [responseString rangeOfString : @"true"];
if (range.location != NSNotFound) {
NSLog(@"%@", responseString);
/// Handle active content.
hiddenVideo.hidden = FALSE;
hiddenAudio.hidden = FALSE;
noService.hidden = TRUE;
}
else {
NSLog(@"%@", responseString);
// Inform user that the content is unavailable
hiddenVideo.hidden = TRUE;
hiddenAudio.hidden = TRUE;
noService.hidden = FALSE;
// Inform user that the content is unavailable
UIAlertView *alert = [[UIAlertView alloc]
initWithTitle: @"Live Service"
message: @"There is no service going on at this time"
delegate: nil
cancelButtonTitle:@"OK"
otherButtonTitles:nil];
[alert show];
[alert release];
HasShownAlert = TRUE; //let the other event know that the alert has already been shown.
}
Android에서 이와 유사한 작업을 수행 할 수있는 방법이 있습니까?
에 대한 링크를 아래
을 사용하면 좀 더 자세히 설명해 수 있습니다. 네가 정말로 원하는 걸 이해할 수 없다? –
webservice가 true 또는 false를 반환하는지 확인하기 위해 xml 리더를 만드는 데 도움이 필요합니다. –