Tag Archives: programming

Android

How to find Android deprecated API

The problem

When you compile android apps, sometimes you can see this message:
-compile:
[javac] Compiling 12 source files to /home/max/Projects/Android/postphone/bin/classes
[javac] Note: Some input files use or override a deprecated API.
[javac] Note: Recompile with -Xlint:deprecation for details.

Now, how is possible to find the API call which seems to be deprecated?

The solution

$ ant -Djava.compilerargs=-Xlint:deprecation debug
The above command will show you what you were searching for:
[javac] /home/max/Projects/Android/xxx/src/net/mx17/xxx/Yyy.java:212: warning: [deprecation] getNotification() in android.support.v4.app.NotificationCompat.Builder has been deprecated
[javac] Notification notif = notificationBuilder.getNotification();