{"id":98,"date":"2014-02-04T17:39:32","date_gmt":"2014-02-04T17:39:32","guid":{"rendered":"http:\/\/visualgdb.com\/w\/?p=98"},"modified":"2015-07-19T08:20:57","modified_gmt":"2015-07-19T15:20:57","slug":"android-san-angeles","status":"publish","type":"post","link":"https:\/\/visualgdb.com\/tutorials\/android\/san-angeles\/","title":{"rendered":"Debugging the san-angeles project with Visual Studio"},"content":{"rendered":"<p>This tutorial shows how to build and debug the <strong> San-Angeles<\/strong> sample provided with Android NDK.<\/p>\n<p>Before you begin, please install <a href=\"\/download\"> VisualGDB 2.0<\/a> or later (ensure that &#8220;Android Edition&#8221; is checked in the installer). If you are not familiar with VisualGDB, please first go through the <a href=\"\/tutorials\/android\">Android Quickstart tutorial<\/a>.<\/p>\n<p><span class=\"warning\">\u00a0Warning! The Android Emulator does<br \/>\nnot support OpenGL. You will need a real device for this<br \/>\ntutorial.<\/span><\/p>\n<ol>\n<li>Start Visual Studio. Select File-&gt;New project-&gt;VisualGDB-&gt;Android Project Wizard.<a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/android\/san-angeles\/01-newprj.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-1\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/android\/san-angeles\/01-newprj.png\" alt=\"01-newprj\" width=\"700\" height=\"394\" \/><\/a><\/li>\n<li>Enter the path where you want to copy the sample and an arbitrary project name (e.g. SanAngelesTest).<\/li>\n<li>Select &#8220;Clone a sample from NDK&#8221;.<a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/android\/san-angeles\/02-clone.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-2\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/android\/san-angeles\/02-clone.png\" alt=\"02-clone\" width=\"699\" height=\"616\" \/><\/a><\/li>\n<li>Select &#8220;San-Angeles&#8221; from the sample list.<a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/android\/san-angeles\/03-sanangeles.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-3\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/android\/san-angeles\/03-sanangeles.png\" alt=\"03-sanangeles\" width=\"700\" height=\"543\" \/><\/a><\/li>\n<li>Keep the default Android 1.6 platform and press <strong> Finish<\/strong>.<a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/android\/san-angeles\/04-platform.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-4\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/android\/san-angeles\/04-platform.png\" alt=\"04-platform\" width=\"700\" height=\"543\" \/><\/a><\/li>\n<li>The san-angeles project folder includes files from Windows and Linux ports of the demo that won&#8217;t compile on Android. Select them in Solution Explorer, right-click and select &#8220;Remove&#8221;.<a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/android\/san-angeles\/05-remove.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-5\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/android\/san-angeles\/05-remove.png\" alt=\"05-remove\" width=\"700\" height=\"556\" \/><\/a><\/li>\n<li>Press &#8220;remove&#8221; in the confirmation window.<a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/android\/san-angeles\/06-confirm.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-6\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/android\/san-angeles\/06-confirm.png\" alt=\"06-confirm\" width=\"619\" height=\"216\" \/><\/a><\/li>\n<li>Build the project by selecting &#8220;Build-&gt;Build All&#8221;.<\/li>\n<li>Prepare your device for debugging (<a href=\"http:\/\/visualgdb.com\/tutorials\/android\/san-angeles\/..\/usbdebug\">follow this manual<\/a> if doing it for the first time) and connect it to PC.<\/li>\n<li>In Visual Studio select &#8220;Android-&gt;Debug Android App&#8221;.<a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/android\/san-angeles\/07-debug.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-7\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/android\/san-angeles\/07-debug.png\" alt=\"07-debug\" width=\"680\" height=\"608\" \/><\/a><\/li>\n<li>VisualGDB will deploy the app automatically and start it. If your device supports OpenGL, you will see the demo on the screen:<a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/android\/san-angeles\/08-run.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-8\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/android\/san-angeles\/08-run.png\" alt=\"08-run\" width=\"700\" height=\"394\" \/><\/a><\/li>\n<li>To test debugging functionality, set a breakpoint on the <strong>prepareFrame()<\/strong> function by navigating there in Visual Studio and pressing F9. The breakpoint will trigger almost immediately:<a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/android\/san-angeles\/09-stack.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-9\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/android\/san-angeles\/09-stack.png\" alt=\"09-stack\" width=\"661\" height=\"563\" \/><\/a><\/li>\n<li>You can use the usual Visual Studio tools to examine call stack, variables and threads, or the GDB Session window to send commands directly to GDB.<\/li>\n<li>To finish debugging, press Shift+F5.<\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This tutorial shows how to build and debug the San-Angeles sample provided with Android NDK. Before you begin, please install<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[87],"tags":[31,45],"_links":{"self":[{"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/posts\/98"}],"collection":[{"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/comments?post=98"}],"version-history":[{"count":1,"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/posts\/98\/revisions"}],"predecessor-version":[{"id":179,"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/posts\/98\/revisions\/179"}],"wp:attachment":[{"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/media?parent=98"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/categories?post=98"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/tags?post=98"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}