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

  • Home
  • SEARCH
  • 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 6801337
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T19:05:16+00:00 2026-05-26T19:05:16+00:00

I am developing an Android application. I am calling a Perl file on a

  • 0

I am developing an Android application. I am calling a Perl file on a server. This Perl file has different print statements.

I want to make the collective text available to a variable in android Java file of mine.

I have tried this :

URL url= new URL("http://myserver.com/cgi-bin/myfile.pl?var=97320");    

here goes my request to the server file. But how can i get the data from the Perl file available there?

  • 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-26T19:05:17+00:00Added an answer on May 26, 2026 at 7:05 pm

    In your perl service:

    use CGI qw(param header);
    use JSON;
    
    my $var = param('var');
    
    my $json = &fetch_return_data($var);
    
    print header('application/json');
    
    print to_json($json); # or encode_json($json) for utf-8
    

    to return data as a JSON object. Then use one of many JSON libraries for Java to read the data. For instance http://json.org/java/:

    Integer var = 97320;
    InputStream inputStream = new URL("http://myserver.com/cgi-bin/myfile.pl?var=" + var).openStream();
    try {
      BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(inputStream));
      // Or this if you returned utf-8 from your service
      //BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(inputStream, Charset.forName("UTF-8")));
      JSONObject json = new JSONObject(readAll(bufferedReader));
    } catch (Exception e) {
    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm developing Android application using third party libraries (Twitter4j). I want to be able
I am developing an android application in that I want to upload videos to
I am developing an android application. I want to update the local SQLite database
I am new in developing android applications. I want to create an android application(using
I developing an android application in which i want to integrate faceebook and twitter.
I'm developing android application.In that i want to pick a date and time in
I'm developing a phonegap/jquery-mobile test application (I'm new in this technologies) for android and
I am currently developing an Android application which has a web backend. I can
I am developing an android application in which I have to make a layout.I
Hi i am developing android application. Now at this stage i am developing calendar

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.