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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T05:41:02+00:00 2026-05-28T05:41:02+00:00

I am trying to build an Android App on Platform 2.2 Froyo. The app

  • 0

I am trying to build an Android App on Platform 2.2 Froyo. The app is supposed to connect to a remote server, fetch data from it and display to user in a different language.

  • So my question – What technologies I need to learn so that I can
    build the above app.

Note – I have already installed the Android platform and have built simple apps like Hello, world. I know Java. Also I am using Eclipse.

Thank you for your answers. No rude comment please…

//————–Code for connecting to web using HTTP protocol—————–//

package in.androidbook.Networking;

import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLConnection;

import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;

import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;

import android.app.Activity;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.os.AsyncTask;
import android.os.Bundle;
import android.widget.ImageView;
import android.widget.Toast;

public class MainActivity extends Activity 
{
    ImageView img;
    /* This is for making asynchronous calls to ensure that connection to server will not return until data is received */

    private class BackgroundTask extends AsyncTask<String, Void, Bitmap>
    {
        protected Bitmap doInBackground(String...url)
        {
            Bitmap bitmap = DownloadImage(url[0]);
            return bitmap;
        }

        protected void onPostExecute(Bitmap bitmap)
        {
            ImageView img = (ImageView) findViewById(R.id.img);
            img.setImageBitmap(bitmap);         
        }
    }
    // Code for making HTTP connection
    private InputStream OpenHttpConnection(String urlString) throws IOException 
    {
        InputStream in = null;
        int response = -1;

        URL url = new URL(urlString);//We take an object of class URL
        URLConnection conn = url.openConnection(); //Create a connection object and open the connection

        if(!(conn instanceof HttpURLConnection)) throw new IOException("Not an Http connection");
        try
        {
            HttpURLConnection httpConn = (HttpURLConnection) conn; //httpConn object is assigned the value of conn. Typecasting is done to avoid conflict.
            httpConn.setAllowUserInteraction(false);
            httpConn.setInstanceFollowRedirects(true);
            httpConn.setRequestMethod("GET");
            httpConn.connect();
            response = httpConn.getResponseCode();

            if(response == HttpURLConnection.HTTP_OK)
                in = httpConn.getInputStream();
        }
        catch (Exception ex)
        {
            throw new IOException("Error connecting");
        }
        return in;
    }   
        //------------------------------------------ OpenHttpConnection method completed----------------------------------------------------------//
    //----------------------------------------------------------------------------------------------------------------------------------------------------------------//
    //-------------------------------Method to download an image--------------------------------------------------------------------------------------//
    private Bitmap DownloadImage(String URL)
    {
        Bitmap bitmap = null;
        InputStream in = null;
        try
        {
            in = OpenHttpConnection(URL);
            bitmap = BitmapFactory.decodeStream(in);
            in.close();
        }
        catch(IOException e1)
        {
            Toast.makeText(this, e1.getLocalizedMessage(), Toast.LENGTH_LONG).show();
            //Toast displays a short msg to user. this refers to current object.
            e1.printStackTrace();
        }
        return bitmap;
    }  


/** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) 
    {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

       Bitmap bitmap = DownloadImage("http://i.zdnet.com/blogs/3-29-androids.jpg");
        img = (ImageView) findViewById(R.id.img);
        img.setImageBitmap(bitmap);
    }
}
  • 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-28T05:41:02+00:00Added an answer on May 28, 2026 at 5:41 am

    UPDATED (based on comment) : As we are talking about the client side, I confirm my answer. If the site is not yours, the first thing you need to do if check how/if it allows for some kind of communication via API, and in what kind of format (XML and JSON being the most used). With this information, it should be pretty easy. Take a look of the Android example using the Google Map or Twitter, you should find some.

    Well, it depends what do you mean exactly : are you asking for the skills needed on the client side (the app) – in the idea that the server is already built, or will be by someone else, or the skills needed for the server ?

    In the former case, I would advice to communicate with REST API and JSON. Take a look at apache HTTPGet, HTTPClient and HTTPResponse class and org.json (all are included in Android). If you want to test with them, use some public APIs (so you do not have to worry about the server), such as Google Map API (which is simple and free to use under some limits).

    In the latter case, I’m with ColWinters : if you know java, use it there also, with Tomcat as a server and a basic Servlet. You’ll find examples aplenty on the Internet.

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

Sidebar

Related Questions

I'm trying to build an android app that allows user to play a game
I'm trying to build an android app that would do a local search on
I'm trying to find the best way to build/package an Android app for 6+
I'm trying build an App Engine connected Android application and am having some problems
I am trying to integrate ZBar in my Android app but I cannot build
I'm trying to build a simple Android app that increments a number displayed every
So I'm trying to build a tabs view for an Android app, and for
I want to build a android app ,which converts some data to pdf file
I am trying to build a web app for Android device using Senahc Touch
I'm trying to use the Android tutorial to build an app that loads a

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.