Take the 2-minute tour ×

I am building simple Android app where I am getting nearest locations using Goolge Places API. For this I used this. But when I am calling:

JsonHttpParser parser = new JsonHttpParser(new JacksonFactory());

it is saying The type JsonHttpParser is deprecated by placing a line-through on this line in Eclipse, but app is still working.

My Question is - Is it good using the libraries which are deprecated in application. Will this raise any problem in the future ?


I used JsonHttpParser for creating HttpRequestFactory like:

public static HttpRequestFactory createRequestFactory(final HttpTransport transport) {
        return transport.createRequestFactory(new HttpRequestInitializer() {
            public void initialize(HttpRequest request) {
                GoogleHeaders headers = new GoogleHeaders();
                // here it is saying deprecated
                JsonHttpParser parser = new JsonHttpParser(new JacksonFactory());

Is there any alternative to create HttpRequestFactory?

share|improve this question
add comment

3 Answers

Definition of Deprecated: A program element annotated @Deprecated is one that programmers are discouraged from using, typically because it is dangerous, or because a better alternative exists.

You can still use deprecated code without performance being changed, but the whole point of deprecating a method/class is to let users know there's now a better way of using it, and that in a future release the deprecated code is likely to be removed.

Deprecation today means that bugs will not be fixed tomorrow, unless you do it yourself.

If you do not mind that, then no need to worry.

share|improve this answer
Thank you. I added another question below it. Could you check once. –  user1225296 Aug 5 '12 at 9:11
add comment

This will not be answer to question.

But in google-http-client-1.5.0-beta.jar library the deprecation is removed and JacksonFactory
class is also available.

share|improve this answer
add comment

It appears that Class JsonHttpParser and Method HttpRequest were both deprecated in version 1.11. See The Deprecated list for more information.

If you want to replace the Deprecated JsonHttpParser, instead of:

            JsonHttpParser parser = new JsonHttpParser(new JacksonFactory());


            JsonObjectParser parser = new JsonObjectParser(new JacksonFactory());

And import:

import com.google.api.client.json.JsonObjectParser;

Note: Not tested.

share|improve this answer
add comment

Your Answer


