Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JsonHttpParser is deprecated

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 ?

EDIT:

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();
                headers.setApplicationName("Places-Test");
                request.setHeaders(headers);
                // here it is saying deprecated
                JsonHttpParser parser = new JsonHttpParser(new JacksonFactory());
                request.addParser(parser);
            }
        });
    }

Is there any alternative to create HttpRequestFactory?

like image 451
Minion Avatar asked Jun 29 '26 00:06

Minion


1 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.

like image 56
Jainendra Avatar answered Jul 01 '26 15:07

Jainendra