{"id":82,"date":"2014-02-04T17:39:32","date_gmt":"2014-02-04T17:39:32","guid":{"rendered":"http:\/\/visualgdb.com\/w\/?p=82"},"modified":"2015-07-19T08:20:53","modified_gmt":"2015-07-19T15:20:53","slug":"android-bitmap-plasma","status":"publish","type":"post","link":"https:\/\/visualgdb.com\/tutorials\/android\/bitmap-plasma\/","title":{"rendered":"Tutorial: Building and Debugging the bitmap-plasma Project with VisualGDB"},"content":{"rendered":"<p>This tutorial demonstrates how to build and debug the bitmap-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\/bitmap-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\/bitmap-plasma\/01-newproject.png\" alt=\"01-newproject\" width=\"700\" height=\"394\" \/><\/a><\/li>\n<li>Choose the &#8216;clone a sample from NDK&#8217; option. Note that you may need to &#8216;Configure NDK\/SDK location&#8217; if this is your first VisualGDB Android project and the project options are shown as disabled. Press &#8216;Next&#8217; when done. <a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/android\/bitmap-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\/bitmap-plasma\/02-clonesample.png\" alt=\"02-clonesample\" width=\"700\" height=\"616\" \/><\/a><\/li>\n<li>Choose the bitmap-plasma sample. Press &#8216;Next&#8217;. <a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/android\/bitmap-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\/bitmap-plasma\/03-sampleselection.png\" alt=\"03-sampleselection\" width=\"700\" height=\"543\" \/><\/a><\/li>\n<li>Choose at least SDK platform 8 for this sample. Press &#8216;Finish&#8217; to exit the wizard. <a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/android\/bitmap-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\/bitmap-plasma\/04-platformselection.png\" alt=\"04-platformselection\" width=\"700\" height=\"543\" \/><\/a><\/li>\n<li>Now we have a sample project copied from Android NDK. Go to Build-&gt;Build Solution to build the project. <a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/android\/bitmap-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\/bitmap-plasma\/05-build.png\" alt=\"05-build\" width=\"697\" height=\"541\" \/><\/a><\/li>\n<li>Next connect an Android device or emulator and make sure it is started. Then go to Android-&gt;Debug Android App to start debugging. <a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/android\/bitmap-plasma\/05b-debug.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-6\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/android\/bitmap-plasma\/05b-debug.png\" alt=\"05b-debug\" width=\"697\" height=\"541\" \/><\/a><\/li>\n<li>Once the app is successfully started the screen of the device should contain a square of moving plasma. <a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/android\/bitmap-plasma\/06-emulator.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-7\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/android\/bitmap-plasma\/06-emulator.png\" alt=\"06-emulator\" width=\"567\" height=\"534\" \/><\/a><\/li>\n<li>Go back to Visual Studio and open the file plasma.c. Go to line 180 and press &#8216;f9&#8217; to set a breakpoint just inside the fill_plasma function. The breakpoint should be hit soon, as the fill_plasma function is used to draw the moving plasma. Congratulations, you are successfully debugging the bitmap-plasma sample. <a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/android\/bitmap-plasma\/07-breakpointhit.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-8\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/android\/bitmap-plasma\/07-breakpointhit.png\" alt=\"07-breakpointhit\" width=\"697\" height=\"541\" \/><\/a><\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This tutorial demonstrates how to build and debug the bitmap-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\/82"}],"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=82"}],"version-history":[{"count":1,"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/posts\/82\/revisions"}],"predecessor-version":[{"id":178,"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/posts\/82\/revisions\/178"}],"wp:attachment":[{"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/media?parent=82"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/categories?post=82"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/tags?post=82"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}