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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T20:25:07+00:00 2026-06-05T20:25:07+00:00

I am attempting to write an Android app which will allow me to read

  • 0

I am attempting to write an Android app which will allow me to read text from a website that holds my work roster https://www.blahblahblahcompany.com/Rostering/exportRoster.aspx

Is this possible? Would I be able to authenticate myself with the website and then download the source code?

The website in question also has the ability to export the roster as an .xls file

screenshot of the page in question
http://img528.imageshack.us/img528/9954/rosterf.png

  • 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-06-05T20:25:10+00:00Added an answer on June 5, 2026 at 8:25 pm

    I don’t know if I’ve get what you really want to do, but I’m sure that at least, you gonna need some Get/Post operations to execute authentication proccess and retrieve data/informations. Please check the following methods:

    public StringBuilder post(String url, List<NameValuePair> nvps) {
        try {
            HttpPost httppost = new HttpPost(url);
            // if there is cookies, set then
            if (cookies != null && cookies.size() > 0) {
                String cookieString = "";
                for (int i = 0; i < cookies.size(); ++i) {
                    cookieString += cookies.get(i).getName() + "=" + cookies.get(i).getValue() + "; ";
                }
                cookieString += "domain=" + Constants.BaseUrl + "; " + "path=/";
                httppost.addHeader("Cookie", cookieString);
            }
            // connection timeout options
            HttpParams httpParameters = new BasicHttpParams();
            HttpConnectionParams.setConnectionTimeout(httpParameters, Constants.timeoutConnection);
            HttpConnectionParams.setSoTimeout(httpParameters, Constants.timeoutSocket);
            // setup the post method
            DefaultHttpClient httpClient = new DefaultHttpClient(httpParameters);
            httppost.setEntity(new UrlEncodedFormEntity(nvps, HTTP.UTF_8));
            HttpResponse response = httpClient.execute(httppost);
            BufferedReader reader = new BufferedReader(new InputStreamReader(response.getEntity().getContent(), "UTF-8"));
            StringBuilder builder = new StringBuilder();
            for (String line = null; (line = reader.readLine()) != null;)
                builder.append(line).append("\n");
            // set cookies
            List<Cookie> incomingCookies = httpClient.getCookieStore().getCookies();
            for (int i = 0; incomingCookies != null && i < incomingCookies.size(); i++) {
                cookies.add(incomingCookies.get(i));
            }
            return builder;
        } catch (UnsupportedEncodingException e) {
        } catch (ClientProtocolException e) {
        } catch (IOException e) {
        } catch (Exception e) {
        }
        return null;
    }
    

    The above mehod executes a post in the url string parameter, using the pair values nvps as arguments for header. Note that Constants class is the class where you are declaring static strings (such as API entries) for your WebService, and the field cookies is a list of Cookies that gonna hold your session issues. This method will return the result for your POST request as a string builder object. Basically, it is a general-purpose method that can be used in several cases, and you should do little adaptations to fit tasks. This is what you can use to authenticate.

    There is another important method, the Http GET:

    public StringBuilder get(String url) {
        try {
            HttpGet httpget = new HttpGet(url);
            // if there is cookies, set then
            if (cookies != null && cookies.size() > 0) {
                String cookieString = "";
                for (int i = 0; i < cookies.size(); ++i) {
                    cookieString += cookies.get(i).getName() + "=" + cookies.get(i).getValue() + "; ";
                }
                cookieString += "domain=" + Constants.BaseUrl + "; " + "path=/";
                httpget.addHeader("Cookie", cookieString);
            }
            HttpParams httpParameters = new BasicHttpParams();
            HttpConnectionParams.setConnectionTimeout(httpParameters, Constants.timeoutConnection);
            HttpConnectionParams.setSoTimeout(httpParameters, Constants.timeoutSocket);
            DefaultHttpClient httpClient = new DefaultHttpClient(httpParameters);
            HttpResponse response = httpClient.execute(httpget);
            BufferedReader reader = new BufferedReader(new InputStreamReader(response.getEntity().getContent(), "UTF-8"));
            StringBuilder builder = new StringBuilder();
            for (String line = null; (line = reader.readLine()) != null;)
                builder.append(line).append("\n");
            // set cookies
            List<Cookie> incomingCookies = httpClient.getCookieStore().getCookies();
            for (int i = 0; incomingCookies != null && i < incomingCookies.size(); i++) {
                cookies.add(incomingCookies.get(i));
            }
            return builder;
        } catch (UnsupportedEncodingException e) {
        } catch (ClientProtocolException e) {
        } catch (IOException e) {
        } catch (Exception e) {
        }
        return null;
    }
    

    This one do similar sequence of steps, but with very different purposes. The goal of this one is to retrieve informations, considering that you already have authenticated or that the auth process is not needed. It returns the requested data as a string builder.

    Please, note that besides these methods are very general, you must closely check what is the proccess used in your requested web page. Hope that it helps you in some way! 😉

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am attempting to write a VB.net application which will allow users to create
I'm attempting to write an iPhone App that automates actions on a certain website.
I'm attempting to write a SQL search which will allow return any records which
I'm attempting to write an app that involves connecting two android devices via bluetooth.
I am attempting to develop an Android app that allows a user to write
I am attempting to write a C# component which will expose events. The component
I am attempting to write a python daemon that will launch at boot. The
I am attempting to write a interpreter that will turn a string like: vector(random(0,
I am attempting to write a firefox addon that will analyze the displayed page
I am attempting to write a function which will operate on a std::map of

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.