Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6551737
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T12:22:30+00:00 2026-05-25T12:22:30+00:00

I have created a way to test if a link to a live stream

  • 0

I have created a way to test if a link to a live stream is active or not in iOS using the following code.

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.
   } 

The problem is, I have no idea where to start in converting this over to Android and I am looking for some guidance. Thank you for your help.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T12:22:30+00:00Added an answer on May 25, 2026 at 12:22 pm

    I don’t know Objective C at all, but as far as I’m able to understand you are only reading result from HTTP response from server and parsing it.
    To send HTTP GET and read response:

        HttpClient httpclient = new DefaultHttpClient(httpParameters);
        HttpGet httpget = new HttpGet(url);
        httpget.addHeader("If-Modified-Since", lastModified);
        HttpResponse response;
        response = httpclient.execute(httpget);
        String result = null;
        if(response.getStatusLine().getStatusCode() == 200) {
            HttpEntity entity = response.getEntity();
            if (entity != null) {
                InputStream instream = entity.getContent();
                //here read contents of stream
            }
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created a JAR file in this way jar cf jar-file input-files .
I have created a CSS stylesheet for my project. Is there any way I
Assume I have created a compiled re: x = re.compile('^\d+$') Is there a way
I have been thinking about the optimal way to create an XML file using
I have created a custom dialog for Visual Studio Setup Project using the steps
I have created a PHP-script to update a web server that is live inside
I have a web service that I created in C# and a test harness
I'm using ASP.NET with C# 2.0. I have created some objects for a database
I have the following test line in my PHP which works fine as a
I have stfw but I cannot find a simple / standalone way to create

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.