How to get number of lines of a project in Android Studio?
One way is to search (ctrl+shift+F)
for line breaks \n
with regular expressions enabled and whole project
as the scope. If you want to limit the search to only java and xml files, you can use the following file mask *.java, *.xml
As alternative you can use (Linux, Windows) utility cloc (Count Lines Of Code). Cloc counts, and computes differences of, comment lines, blank lines, and physical lines of source code.
An example basic use (my project):
cloc /home/myHome/StudioProjects/myApp/app/src/
111 text files.
111 unique files.
0 files ignored.
github.com/AlDanial/cloc v 1.70 T=0.36 s (308.1 files/s, 38552.3 lines/s)
-------------------------------------------------------------------------------
Language files blank comment code
-------------------------------------------------------------------------------
Java 50 1323 146 6407
XML 60 460 50 3203
SQL 1 0 0 2302
-------------------------------------------------------------------------------
SUM: 111 1783 196 11912
-------------------------------------------------------------------------------
Project page https://github.com/AlDanial/cloc (thanks Xam)