{"id":1978,"date":"2010-05-23T18:06:17","date_gmt":"2010-05-23T22:06:17","guid":{"rendered":"http:\/\/www.gubatron.com\/blog\/?p=1978"},"modified":"2010-05-23T18:06:17","modified_gmt":"2010-05-23T22:06:17","slug":"how-many-lines-of-code-does-it-take-to-create-the-android-os","status":"publish","type":"post","link":"https:\/\/www.gubatron.com\/blog\/how-many-lines-of-code-does-it-take-to-create-the-android-os\/","title":{"rendered":"How many lines of code does it take to create the Android OS?"},"content":{"rendered":"<p>This is a report done on all the projects that make up for the android project, my copy of it is synced as of May 23rd 2010, 6pm<br \/>\n<!--more--><br \/>\n[bash]<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br \/>\nLanguage                      files          blank        comment           code<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br \/>\nXML                            4130          26919          62996        3044624<br \/>\nC                              7191         494387         685731        2826741<br \/>\nJava                          16473         423278         986294        2084883<br \/>\nC++                            5623         349754         385625        1754053<br \/>\nC\/C++ Header                  12278         300773         653608        1153456<br \/>\nHTML                           2325          13539          14681         348935<br \/>\nBourne Shell                    501          45684          46947         317410<br \/>\nJavascript                     1717          41901          76306         208012<br \/>\nAssembly                       1704          18732          51392          96700<br \/>\nD                              2181          16936             24          59142<br \/>\nm4                              116           6026           1813          49502<br \/>\nPerl                            221           8189           8246          40058<br \/>\nPython                          236           9805          14225          38852<br \/>\nmake                            381           6844           3837          37059<br \/>\nIDL                             421           3128              0          24181<br \/>\nObjective C                      93           2804           3371          10032<br \/>\nyacc                             15           1300            742           9660<br \/>\nCSS                              42           1760            617           8566<br \/>\nTeamcenter def                   41            631             95           5430<br \/>\nC#                               93            863            537           5283<br \/>\nBourne Again Shell               99            569           1643           3784<br \/>\nlex                              21            776            754           3492<br \/>\nExpect                           20            105            168           2170<br \/>\nAda                              10            599            560           1681<br \/>\nRuby                             14            393            228           1433<br \/>\nXSLT                              8            105            110           1328<br \/>\nXSD                               7            182            359           1048<br \/>\nPascal                            4            218            200            985<br \/>\nDOS Batch                        34            252            399            911<br \/>\nawk                              14             92            198            899<br \/>\nDTD                               9             66             42            289<br \/>\nsed                               9             32            143            277<br \/>\nKorn Shell                        1             39             46            223<br \/>\nLisp                              2             32              5            144<br \/>\nMSBuild scripts                   1              1              0            140<br \/>\nNAnt scripts                      2             10              0             89<br \/>\nASP.Net                           3              5              0             76<br \/>\nYAML                              6             27             42             66<br \/>\nSQL                               1              5              0             21<br \/>\nPHP                               1              0              0              3<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br \/>\nSUM:                          56048        1776761        3001984       12141638<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br \/>\n[\/bash]<\/p>\n<p><strong>Update<\/strong><\/p>\n<p>It seems like this post got some attention on Reddit, YCombinator news and other sites on monday. I hadn&#8217;t noticed until today, so here are some answers to many of the FAQs about the post.<\/p>\n<p>Yes it was done using <strong><a href=\"http:\/\/cloc.sourceforge.net\/\">cloc<\/a><\/strong>. Don&#8217;t shoot me I&#8217;m just the messenger.<\/p>\n<p>It was run at the base folder of the entire Android OS source checkout, so yes it will include sample and tests I suppose.<\/p>\n<p>C#, Ada, Objective-C? I also thought the same&#8230; It&#8217;s probably worth the try doing a few finds and greps to see if this is true, again I just posted the output of cloc, I didn&#8217;t intend to make this a scientific paper, just a fun and curious post to get a rough number on the lines of code, that breakdown was just icing on the cake for me (as inaccurate as it maybe)<\/p>\n<p><strong>Update<\/strong><br \/>\nThis post is now being referenced in Wikipedia! on the &#8220;<a href=\"http:\/\/en.wikipedia.org\/wiki\/Android_(operating_system)#cite_note-14\">Android (operating system)<\/a>&#8221; article.<\/p>\n<p><strong>About Gubatron &#038; Android<\/strong><br \/>\nEver since the iPhone OS handicapped millions of smartphone devices with its draconian laws, I started looking more and more seriously at Android as THE platform for every non-iPhone device coming to the mobile and TV space. Now I&#8217;m part of the developer team of <a href=\"http:\/\/frostwire.com\/android\" target=\"_blank\">FrostWire for Android<\/a>, an application that exploits all the power of the device and the freedoms of the platform to allow people to connect and share.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This is a report done on all the projects that make up for the android project, my copy of it is synced as of May 23rd 2010, 6pm<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[5,15,30],"tags":[1434,1437,621],"class_list":["post-1978","post","type-post","status-publish","format-standard","hentry","category-android","category-code","category-geeklife","tag-android","tag-code","tag-lines-of-code"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p5Unzf-vU","jetpack-related-posts":[{"id":2762,"url":"https:\/\/www.gubatron.com\/blog\/frostwire-for-android-breaks-past-its-first-250k-lines-of-source-code\/","url_meta":{"origin":1978,"position":0},"title":"FrostWire for Android breaks past its first 250k lines of source code","author":"gubatron","date":"July 31, 2012","format":false,"excerpt":"-------------------------------------------------------------------------------- Language files blank comment code -------------------------------------------------------------------------------- Java 1950 101133 77855 256590 XML 126 480 2351 9308 XSD 2 28 57 187 Bourne Again Shell 1 30 17 147 -------------------------------------------------------------------------------- SUM: 2079 101671 80280 266232 -------------------------------------------------------------------------------- Help wanted","rel":"","context":"In &quot;Code&quot;","block_context":{"text":"Code","link":"https:\/\/www.gubatron.com\/blog\/category\/code\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":3277,"url":"https:\/\/www.gubatron.com\/blog\/how-many-lines-of-code-are-there-inside-bitcoin-core-client\/","url_meta":{"origin":1978,"position":1},"title":"How many lines of code are there inside Bitcoin-Core client?","author":"gubatron","date":"April 30, 2014","format":false,"excerpt":"According to cloc this is the line count breakdown, 87% of the project is all C\/C++ header files and code. http:\/\/cloc.sourceforge.net v 1.60 T=7.23 s (72.2 files\/s, 43792.9 lines\/s) ------------------------------------------------------------------------------- Language files blank comment code ------------------------------------------------------------------------------- C++ 244 9985 6246 211500 C\/C++ Header 188 5346 4617 35399 Bourne Shell 26\u2026","rel":"","context":"In &quot;BitCoin&quot;","block_context":{"text":"BitCoin","link":"https:\/\/www.gubatron.com\/blog\/category\/bitcoin-2\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":2759,"url":"https:\/\/www.gubatron.com\/blog\/frostwire-nearing-1mm-lines-of-source-code\/","url_meta":{"origin":1978,"position":2},"title":"FrostWire nearing 1MM lines of Source Code","author":"gubatron","date":"July 31, 2012","format":false,"excerpt":"-------------------------------------------------------------------------------- Language files blank comment code -------------------------------------------------------------------------------- Java 6700 230082 339218 818509 HTML 403 8751 4745 72384 XML 70 1112 996 11029 C++ 6 220 317 806 CSS 10 202 132 799 JSP 16 64 606 777 Javascript 5 77 54 571 XSLT 4 134 298 553 XSD 7 40\u2026","rel":"","context":"In &quot;Code&quot;","block_context":{"text":"Code","link":"https:\/\/www.gubatron.com\/blog\/category\/code\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1913,"url":"https:\/\/www.gubatron.com\/blog\/how-to-do-unit-testing-on-android-with-eclipse\/","url_meta":{"origin":1978,"position":3},"title":"[SCREENCAST] How to do Unit Testing on Android with Eclipse","author":"gubatron","date":"May 2, 2010","format":false,"excerpt":"I was going to make a tutorial, but then I figured that making a video would be a much better way to show this. As for the code that you could grab from a tutorial, there's a link at the end of the post with all the code shown in\u2026","rel":"","context":"In &quot;Android&quot;","block_context":{"text":"Android","link":"https:\/\/www.gubatron.com\/blog\/category\/android\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/androinica.com\/wp-content\/uploads\/2008\/10\/android_logo.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":1922,"url":"https:\/\/www.gubatron.com\/blog\/think-youre-in-a-big-project\/","url_meta":{"origin":1978,"position":4},"title":"Think you&#8217;re in a big project?","author":"gubatron","date":"May 18, 2010","format":false,"excerpt":"Recently I became curious on how many lines of code a huge open source project I contribute to has on what languages. I found a tool called \"cloc\" on sourceforge, check out the results and I dare you to think again if you think you're in a big project. [bash]\u2026","rel":"","context":"In &quot;Code&quot;","block_context":{"text":"Code","link":"https:\/\/www.gubatron.com\/blog\/category\/code\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":3020,"url":"https:\/\/www.gubatron.com\/blog\/how-to-avoid-android-compilationbuilding-issues-setting-up-the-eclipse-buildpath-correctly\/","url_meta":{"origin":1978,"position":5},"title":"How to avoid Android compilation\/building issues &#8211; Setting up the Eclipse Buildpath correctly","author":"gubatron","date":"May 21, 2013","format":false,"excerpt":"This post is the product of about 48 hours of not being able to work on what I was supposed to be working because I had to deal with build issues in Eclipse. Hopefully If you follow these steps you will be able to solve some of the issues you\u2026","rel":"","context":"In &quot;Android&quot;","block_context":{"text":"Android","link":"https:\/\/www.gubatron.com\/blog\/category\/android\/"},"img":{"alt_text":"Screen Shot 2013-05-21 at 12.13.46 PM","src":"https:\/\/i0.wp.com\/www.gubatron.com\/blog\/wp-content\/uploads\/2013\/05\/Screen-Shot-2013-05-21-at-12.13.46-PM.png?resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.gubatron.com\/blog\/wp-content\/uploads\/2013\/05\/Screen-Shot-2013-05-21-at-12.13.46-PM.png?resize=350%2C200 1x, https:\/\/i0.wp.com\/www.gubatron.com\/blog\/wp-content\/uploads\/2013\/05\/Screen-Shot-2013-05-21-at-12.13.46-PM.png?resize=525%2C300 1.5x"},"classes":[]}],"_links":{"self":[{"href":"https:\/\/www.gubatron.com\/blog\/wp-json\/wp\/v2\/posts\/1978","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.gubatron.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.gubatron.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.gubatron.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.gubatron.com\/blog\/wp-json\/wp\/v2\/comments?post=1978"}],"version-history":[{"count":0,"href":"https:\/\/www.gubatron.com\/blog\/wp-json\/wp\/v2\/posts\/1978\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.gubatron.com\/blog\/wp-json\/wp\/v2\/media?parent=1978"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.gubatron.com\/blog\/wp-json\/wp\/v2\/categories?post=1978"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.gubatron.com\/blog\/wp-json\/wp\/v2\/tags?post=1978"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}