{"id":94,"date":"2014-02-04T17:39:32","date_gmt":"2014-02-04T17:39:32","guid":{"rendered":"http:\/\/visualgdb.com\/w\/?p=94"},"modified":"2015-07-19T08:21:00","modified_gmt":"2015-07-19T15:21:00","slug":"android-native-plasma","status":"publish","type":"post","link":"https:\/\/visualgdb.com\/tutorials\/android\/native-plasma\/","title":{"rendered":"Tutorial: Building and Debugging the native-plasma Project with VisualGDB"},"content":{"rendered":"<p>This tutorial shows how to build and debug the native-plasma sample provided by Android NDK.<\/p>\n<p>For this tutorial, ensure that at least <a href=\"\/download\/\">VisualGDB 2.0<\/a> or later version is installed with the Android Edition.<\/p>\n<ol>\n<li>Start Visual Studio. Go to File-&gt;New-&gt;Project. Choose VisualGDB-&gt;Android Project Wizard. Choose the name and location for the project as you wish. <a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/android\/native-plasma\/01-newproject.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-1\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/android\/native-plasma\/01-newproject.png\" alt=\"01-newproject\" width=\"700\" height=\"394\" \/><\/a><\/li>\n<li>For this tutorial we are cloning a sample, so choose that option. Note that if you have not done so before, then you need to &#8216;Configure NDK\/SDK locations&#8217;. Press &#8216;Next&#8217; when done. <a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/android\/native-plasma\/02-clonesample.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-2\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/android\/native-plasma\/02-clonesample.png\" alt=\"02-clonesample\" width=\"700\" height=\"616\" \/><\/a><\/li>\n<li>Choose the native-plasma sample and press &#8216;Next&#8217;. <a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/android\/native-plasma\/03-sampleselection.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-3\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/android\/native-plasma\/03-sampleselection.png\" alt=\"03-sampleselection\" width=\"700\" height=\"543\" \/><\/a><\/li>\n<li>Choose at least SDK platform 8 for this project. We choose 2.3.3 as the latest of the 2.* versions. Press &#8216;Finish&#8217; to exit the tutorial. <a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/android\/native-plasma\/04-platformselection.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-4\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/android\/native-plasma\/04-platformselection.png\" alt=\"04-platformselection\" width=\"700\" height=\"543\" \/><\/a><\/li>\n<li>Open &#8216;plasma.c&#8217; from Solution Explorer and set a breakpoint at line 114 by pressin the &#8216;f9&#8217; key. Then go to Build-&gt;Build Solution to build the project. <a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/android\/native-plasma\/05-build.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-5\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/android\/native-plasma\/05-build.png\" alt=\"05-build\" width=\"699\" height=\"541\" \/><\/a><\/li>\n<li>Connect an Android physical device or emulator and make sure it is started. Next go to Android-&gt;Debug Android App to start debugging on the device. <a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/android\/native-plasma\/06-debug.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-6\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/android\/native-plasma\/06-debug.png\" alt=\"06-debug\" width=\"699\" height=\"541\" \/><\/a><\/li>\n<li>Once the debugging has started look at the screen of the debugging device. The screen should be filled with plasma. Click on the device&#8217;s screen to start animating the plasma. <a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/android\/native-plasma\/07-emulator.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-7\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/android\/native-plasma\/07-emulator.png\" alt=\"07-emulator\" width=\"567\" height=\"534\" \/><\/a><\/li>\n<li>Now the breakpoint we set is hit as the fill_plasma function is called each time the plasma is redrawn. Congratulations, you are successfully debugging the native-plasma project. <a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/android\/native-plasma\/08-breaking.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-8\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/android\/native-plasma\/08-breaking.png\" alt=\"08-breaking\" width=\"699\" height=\"541\" \/><\/a><\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This tutorial shows how to build and debug the native-plasma sample provided by Android NDK. For this tutorial, ensure that<\/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\/94"}],"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=94"}],"version-history":[{"count":1,"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/posts\/94\/revisions"}],"predecessor-version":[{"id":180,"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/posts\/94\/revisions\/180"}],"wp:attachment":[{"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/media?parent=94"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/categories?post=94"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/tags?post=94"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}