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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T16:58:57+00:00 2026-06-14T16:58:57+00:00

I want to create a translate app in Android,i use Google Translate API,but it

  • 0

I want to create a translate app in Android,i use Google Translate API,but it has error,please help me for fix it. This is my code

public void onClick(View v) {
        // TODO Auto-generated method stub
        String InputString;
        String OutputString = null;
        InputString = InputText.getText().toString();

        try {

            Translate.setHttpReferrer("http://translate.google.com.vn/");
            OutputString = Translate.DEFAULT.execute(InputString, Language.ENGLISH, Language.VIETNAMESE);    ////////

        } catch (Exception ex) {
            ex.printStackTrace();
            OutputString = "Error";

        }

        OutputText.setText(OutputString);               
    }   

Here is my Manifest

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.stthing"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk
        android:minSdkVersion="8"
        android:targetSdkVersion="15" />
<uses-permission android:name="android.permission.INTERNET" />
    <application
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >
        <activity
            android:name=".MainActivity"
            android:label="@string/title_activity_main" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>

</manifest>

Error in line Translate.setHttpReferrer(“http://translate.google.com.vn/&#8221;);

The method setHttpReferrer(String) is undefined for the type Translate
  • 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-14T16:58:58+00:00Added an answer on June 14, 2026 at 4:58 pm

    I am not sure if you are aware but Translate API is no longer free. so you would need to set the API key as well..

    instead of using

    Translate.setHttpReferrer("http://translate.google.com.vn/");
    

    use

    GoogleAPI.setHttpReferrer("http://translate.google.com.vn/");
    GoogleAPI.setKey(/* Enter your API key here */);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to translate a word in my app. First I wanted to use
i want create Dynamic Slideshow in Jquery i'm Write this code var ctx =
I want to create a Silverlight app to extract and manipulate data from an
Google Translate is awesome for most of the major languages but where do you
I want to translate this html table into JSF table <table border=1> <tr> <td>OS
I have an app I'm trying to translate which uses tkinter and python, but
I want to create application which I want to use to turn off my
Let's say I have an android app, and in that app I want to
This is a WPF/SL app, but this would apply elsewhere. I have a contextually
i want to translate this below: <?php echo __(<<<EOM <p> For security reasons... </p>

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.