Mike Hudgell
Mike Hudgell

Reputation: 307

Code analysis tools for Android

Is there any static code analysis tools for Android that would pick up simple things like NullPointerExceptions from trying to access an object that might be null (without checking for it first)...

Tools like resharper on C# projects do this quite well, so I'm presuming there is similar tools for Android's Java...

Upvotes: 15

Views: 13185

Answers (6)

Lonzak
Lonzak

Reputation: 9816

Android specific:

DidFail

FlowDroid

IccTA (from the creators of FlowDroid)

Upvotes: 1

Melinda Green
Melinda Green

Reputation: 2140

AndroidStudio is a thin layer on top of IntelliJ IDEA which zloyrobot points out has lots of inspections. The problem is that there are so many inspections that it is difficult to narrow down your queries to pick up only the really good stuff. I developed a profile for that purpose and describe how to use it here: http://superliminal.com/computing/idea_static_analysis.html

Upvotes: 0

user541064
user541064

Reputation: 333

For static analysis of Android apps, you can use the following combination:

  1. Use DED to first decompile the apps and get the Java source files
  2. Use SOOT to statically analyze the Java source files obtained from the step above

Upvotes: 1

fones
fones

Reputation: 181

Since ADT 16 there is build-int Android Lint tool for static code analysis. http://tools.android.com/tips/lint/

Upvotes: 6

zloyrobot
zloyrobot

Reputation: 11

Try IntelliJ IDEA from Jetbrains (the creator of resharper). It has a lot of java code inspections like resharper and support developing Android applications.

Upvotes: 0

inazaruk
inazaruk

Reputation: 74790

It's not really android specific, it's Java specific.

Several tools I know of:

  1. PMD - official site
  2. FindBugs - official site

More complete list of tools can be found on wikipedia.

Upvotes: 5

Related Questions