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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T11:54:35+00:00 2026-06-03T11:54:35+00:00

Hello fellow developers, I am a total newbie in Android development and I am

  • 0

Hello fellow developers,

I am a total newbie in Android development and I am trying to write an application that uses the Google Places Api. I have done a lot of research in setting up Eclipse and finding out where to place the various jar files. (Boy that was a project y itself). Okay so now my problem is that I have been following Davy’s Tech Blog (http://ddewaele.blogspot.com/2011/05/introducing-google-places-api.html) and I am running into some problems.

I have downloaded the following Jars:
google-api-client-1.4.1.beta
google-api-client-1.8.0.beta (with dependecies)
google-collect-1.0-rc1

and I have added these to my libs folder

The application can compile correctly, but when the application runs on the Android simulator it comes up with an error message stating “Unfortunately, the application has stopped”
Looking into the Log Cat I can see the following:

05-10 04:26:32.456: I/System.out(1408): Perform Search ….
05-10 04:26:32.456: I/System.out(1408): ——————-
05-10 04:26:32.486: I/dalvikvm(1408): Could not find method com.google.api.client.googleapis.GoogleHeaders.setUserAgent, referenced from method com.google.api.client.googleapis.GoogleHeaders.setApplicationName
05-10 04:26:32.486: W/dalvikvm(1408): VFY: unable to resolve virtual method 279: Lcom/google/api/client/googleapis/GoogleHeaders;.setUserAgent (Ljava/lang/String;)V
05-10 04:26:32.486: D/dalvikvm(1408): VFY: replacing opcode 0x6e at 0x0000

The method looks like this:

public static HttpRequestFactory createRequestFactory(final HttpTransport transport) { 
    return transport.createRequestFactory(new HttpRequestInitializer() {
        public void initialize(HttpRequest request) {
            GoogleHeaders headers = new GoogleHeaders();
            headers.setApplicationName("MyFirstLocationApp");
            request.headers=headers;
            JsonHttpParser parser = new JsonHttpParser();
            parser.jsonFactory = new JacksonFactory();
            request.addParser(parser);
        }
    });
}

I think it has something to do with the Jar files that I have included. I believe that setApplicationName is found in google-api-client-1.8.0.beta and the setUserAgent is located in the google-api-client-1.4.1.beta (Under the Http class).

The problem however is that most of my objects I need are not found in google-api-client-1.8.0.beta but in google-api-client-1.4.1.beta

These are the imports I have:

import com.google.api.client.googleapis.GoogleHeaders;
import com.google.api.client.http.GenericUrl;
import com.google.api.client.http.HttpRequest;
import com.google.api.client.http.HttpRequestFactory;
import com.google.api.client.http.HttpRequestInitializer;
import com.google.api.client.http.HttpResponseException;
import com.google.api.client.http.HttpTransport;
import com.google.api.client.http.javanet.NetHttpTransport;
import com.google.api.client.http.json.JsonHttpParser;
import com.google.api.client.json.jackson.JacksonFactory;

Any help is appreciated. This is driving me nuts.

/Imran

  • 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-03T11:54:40+00:00Added an answer on June 3, 2026 at 11:54 am

    So I included only the 1.8.0 stuff which is below and included just the jars suggested by the usage doc’s of the API ( Just D&D’d them into the lib’s folder ) using eclipse indigo which just lets you drop files into the folder (not sure which version your using but indigo handles this stuff better then the previous version)

    google-api-client-1.8.0-beta.jar
    google-api-client-android2-1.8.0-beta.jar
    google-http-client-1.8.3-beta.jar
    google-http-client-android2-1.8.3-beta.jar
    google-oauth-client-1.8.0-beta.jar
    gson-2.1.jar
    guava-11.0.1.jar
    jackson-core-asl-1.9.4.jar
    jsr305-1.3.9.jar
    protobuf-java-2.2.0.jar
    

    Then modified your code a bit for the newer API

     public static HttpRequestFactory createRequestFactory(final HttpTransport transport) { 
            return transport.createRequestFactory(new HttpRequestInitializer() {
                public void initialize(HttpRequest request) {
                    GoogleHeaders headers = new GoogleHeaders();
                    headers.setApplicationName("MyFirstLocationApp");
                    request.setHeaders(headers);
                    JsonHttpParser parser = new JsonHttpParser(new JacksonFactory());
                    request.addParser(parser);
                }
            });
        }
    

    It compiles and seems to work fine for a trivial test, I suggest you try it using straight 1.8.0 and see if that works.

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

Sidebar

Related Questions

Hello fellow developers, I am trying to achieve something in Android and I would
hello fellow java developers. I'm having a very strange issue. I'm trying to read
Hello fellow developers, assume I had a program that required authorization granted to him
Hello my fellow ColdFusion developers! I'm trying to learn node.js, and I have a
I am follow google's listview tutorial (http://developer.android.com/resources/tutorials/views/hello-listview.html) and I'm trying to ad an adview
Hello fellow developers! I am trying to get the build error codes from a
hello fellow java developers. I'm having a bit of an issue here. I have
Hello fellow software developers. I want to distribute a C program which is scriptable
Hello fellow developers. First of all I apologize beforehand for the wall of text
Hello fellow developers. I have previously made a facebook fan page with an iframe

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.