0
다음 코드를 사용하여 iOS에서 라이브 스트림에 대한 링크가 활성 상태인지 여부를 테스트하는 방법을 만들었습니다.Objective C to Android XML Response
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;
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.
}
문제는 안드로이드로 변환에서 어디서부터 시작 해야할지 모르겠지만 나는 약간의 지침을 찾고 있습니다. 도와 줘서 고마워.
시작은 여기 : http://developer.android.com/ 대신 UIAlertView의 예는 당신은 가능성이 android.app.AlertDialog' – Joe
당신에게 조 감사'사용됩니다! 정말 의미가 있습니다. –