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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T01:58:36+00:00 2026-06-16T01:58:36+00:00

I made a simple currency converter, but is there a simple way to retrieve

  • 0

I made a simple currency converter, but is there a simple way to retrieve live currency (just the currency, say from Israel shekel to dollar)? For example:

case R.id.euro:
        mDollar.setChecked(false);
        Meuro.setChecked(true);
        exchangeRate = **//live currency from external source**
        exchangeSymbol = "€";

        break;

Here is my whole code

protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    mResult = (TextView) findViewById(R.id.result);
    mToConvert = (EditText) findViewById(R.id.toConvert);
    mRadioGroup = (RadioGroup) findViewById(R.id.radioG);
    mDollar = (RadioButton) findViewById(R.id.dollar);
    Meuro = (RadioButton) findViewById(R.id.euro);

    mToConvert.addTextChangedListener(new TextWatcher() {

        @Override
        public void onTextChanged(CharSequence arg0, int arg1, int arg2,
                int arg3) {
            // TODO Auto-generated method stub

        }

        @Override
        public void beforeTextChanged(CharSequence arg0, int arg1,
                int arg2, int arg3) {
            // TODO Auto-generated method stub

        }

        @Override
        public void afterTextChanged(Editable arg0) {
            convertCurrentAmount();

        }
    });
    mRadioGroup
            .setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {

                @Override
                public void onCheckedChanged(RadioGroup group, int checkedId) {
                    convertCurrentAmount();
                }
            });
}

public void convertCurrentAmount() {
    double exchangeRate = -1;
    String exchangeSymbol = null;
    switch (mRadioGroup.getCheckedRadioButtonId()) {
    case R.id.dollar:
        mDollar.setChecked(true);
        Meuro.setChecked(false);
        exchangeRate = 3.76;
        exchangeSymbol = "$";


        break;

    case R.id.euro:
        mDollar.setChecked(false);
        Meuro.setChecked(true);
        exchangeRate = 5;
        exchangeSymbol = "€";

        break;
    }
    if (exchangeRate > 0 && exchangeSymbol != null) {

        Double stringtoint = Double
                .valueOf(mToConvert.getText().toString());
        double result = stringtoint * exchangeRate;
        mResult.setText("" + exchangeSymbol + result);

    }
}

}

  • 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-16T01:58:37+00:00Added an answer on June 16, 2026 at 1:58 am

    The European Central Bank has a site for daily currency rates in XML.

    http://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml

    Some more info here: http://www.ecb.int/stats/exchange/eurofxref/html/index.en.html#dev

    You should probably load and parse the XML on startup and also save it for offline usage and so that you don’t have to fetch the values every time(once a day is enough).

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

Sidebar

Related Questions

I made simple email in wordpress but it would only send email to the
Visual Studio 2008 (vb.net) I made simple anivirus but when I make Full scan
On Windows, testing different OSes is made simple using VMs. Is there a simple
so I'm making some basic programming language (just for exercise). I've made simple grammar
I made a simple module for Lighttpd to experiment with it. If I just
I made simple procedure just to demonstrate CREATE PROCEDURE `demo`(demo_int int) BEGIN DECLARE minid
I just made simple app using JodaTime libary. It does nothing special, only calculates
I made a simple map, and loaded all my points from a xml file,
I made a simple button template from the rectangle with Make into control../Button command.
My home-made simple logger (just a wrapper around fopen , fwrite , fclose )

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.