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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T22:14:08+00:00 2026-05-23T22:14:08+00:00

What would be the best way to show different images to applications in android?

  • 0

What would be the best way to show different images to applications in android?

For example…
I have a gallery that shows different images. i would like to change these images weekly. Right now i am using this…

public class ImageAdapter extends BaseAdapter {
 /** The parent context */
   private Context myContext;

     /** URL-Strings to some remote images. */
    private String[] myRemoteImages = {
    "https://sites.google.com/site/theitrangers/images/modern_warfare_3_21027.jpg"
    ""
    };

     /** Simple Constructor saving the 'parent' context. */
      public ImageAdapter(Context c) { this.myContext = c; }

        /** Returns the amount of images we have defined. */
           public int getCount() { return this.myRemoteImages.length; }
        /* Use the array-Positions as unique IDs */
 public Object getItem(int position) { return position; }
     public long getItemId(int position) { return position; }

 /        ** Returns a new ImageView to
       * be displayed, depending on
         * the position passed. */
           public View getView(int position, View convertView, ViewGroup parent) {
          ImageView i = new ImageView(this.myContext);

            try {
            /* Open a new URL and get the InputStream to load data from it. */
            URL aURL = new URL(myRemoteImages[position]);
            URLConnection conn = aURL.openConnection();
            conn.connect();
            InputStream is = conn.getInputStream();
            /* Buffered is always good for a performance plus. */
            BufferedInputStream bis = new BufferedInputStream(is);
            /* Decode url-data to a bitmap. */
            Bitmap bm = BitmapFactory.decodeStream(bis);
            bis.close();
            is.close();
            /* Apply the Bitmap to the ImageView that will be returned. */
            i.setImageBitmap(bm);
    } catch (IOException e) {

            Log.e("DEBUGTAG", "Remtoe Image Exception", e);
    }

       /* Image should be scaled as width/height are set. */
        i.setScaleType(ImageView.ScaleType.FIT_CENTER);
  / * Set the Width/Height of the ImageView. */
      i.setLayoutParams(new Gallery.LayoutParams(150, 150));
       return i;
    }


     public float getScale(boolean focused, int offset) {
     /* Formula: 1 / (2 ^ offset) */
     return Math.max(0, 1.0f / (float)Math.pow(2, Math.abs(offset)));
   }
     }



}

So here in this example i am using a URL to get the image from. The only problem is i would have upgrade the application each time i wanted to use a new image.Correct? What would be the best way for me to accomplish this?

  • 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-23T22:14:10+00:00Added an answer on May 23, 2026 at 10:14 pm

    What I would do is have a server-side script sitting on a web server which would tell your app what images to show.

    Every time you load the program you can query (HTTP GET) this script (you can use PHP, or any other CGI) which will return you the latest images. You could return the whole image directly, or just the URL for the application to load into it’s image frame.

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

Sidebar

Related Questions

I would like to show something similar to a progressbar by using different images,
What would be the best way to something like this where a timestamp is
I have an Android activity with an ImageButton. I would like to execute some
I would like to know what is the best way to place multiple, small(all
postgres 9.2 supports json columns. what would be best way to extend postgres to
I want to make a code snippet database web application. Would the best way
What would be the best way to display a dialog whenever my app receives
What would be the best way to version a rails application? We want to
What would be the best way to properly concatenate string with an url inside?
What would be the best way and more idiomatic to break a string into

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.