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 6822847
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T21:42:43+00:00 2026-05-26T21:42:43+00:00

I am currently working on an Android app and I am trying to connect

  • 0

I am currently working on an Android app and I am trying to connect to Flickr and grab photos from it. However, my HttpGet call fails completely. Here is my code:

HttpClient httpClient = new DefaultHttpClient();
String temp = restUrl.toString();
HttpGet httpGet = new HttpGet(temp);
try
{
        HttpEntity httpEntity = httpClient.execute(httpGet).getEntity();
        if (httpEntity != null)
        {
            InputStream inStream = httpEntity.getContent();
            Reader in = new InputStreamReader(inStream);
            BufferedReader bufferedReader = new BufferedReader(in);
            StringBuilder sBuilder = new StringBuilder();
            String stringReadline = null;
            while ((stringReadline = bufferedReader.readLine())!=null)
            {
                sBuilder.append(stringReadline+"\n");
            }
            queryResult = sBuilder.toString();
        }
    }

My temp stores the string “http://api.flickr.com/services/rest/?method=flickr.photos.search&api_key=467ae9bf5926d10c684d4f47d7da6434&tags=new%20york&per_page=5&page1”

The call works fine when I make the call in my browser (It returns the xml file I am expecting). However, it does not work when I am making the call from my android app. I have added the Internet permissions line in my android manifest file.

I would really appreciate any help.

Thanks,
Ro

  • 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-26T21:42:44+00:00Added an answer on May 26, 2026 at 9:42 pm

    Yup didn’t read your full question before I posted my answer.

    I have used code below to retrieve content and it works with no problems.

        HttpResponse response = httpClient.execute(request);
    
        InputStream is = null;
        try {
            is = response.getEntity().getContent();
        } catch (IllegalStateException e) {
            e.printStackTrace();
            return null;
        } catch (IOException e) {
            e.printStackTrace();
            return null;
        }
    
        String line = "";
        StringBuilder total = new StringBuilder();
        BufferedReader rd = new BufferedReader(new InputStreamReader(is));
    
        try{
            while ((line = rd.readLine()) != null) { 
                total.append(line); 
            }
        } catch (IOException e){
            e.printStackTrace();
                return null
        }
    
        return queryResult = total.toString();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am currently working on an Android app and I am trying to get
Currently, I'm working on an Android app for Pinterest. What I am trying to
I'm currently trying to get a grip on Android development and working my way
I am currently working on an Android app and I am having some issues
I'm currently working on an Android app. I would like to use the app
I'm currently working on converting an Android app I built natively as an iPhone
I'm new to android game development. I currently working on a simple android app
I'm currently working on an XMPP app' on Android and I'm pondering about the
I'm currently working on my fist app for android phones and I want to
I am currently working on building an Android app for my Rails backend. I

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.