{"id":89,"date":"2014-02-04T17:39:32","date_gmt":"2014-02-04T17:39:32","guid":{"rendered":"http:\/\/visualgdb.com\/w\/?p=89"},"modified":"2015-07-19T08:26:25","modified_gmt":"2015-07-19T15:26:25","slug":"android-hello-neon","status":"publish","type":"post","link":"https:\/\/visualgdb.com\/tutorials\/android\/hello-neon\/","title":{"rendered":"Building and Debugging the hello-neon Project with VisualGDB"},"content":{"rendered":"<p>This tutorial shows how to build and debug the hello-neon sample project provided by Android NDK.<\/p>\n<p>Before we begin, ensure that <a href=\"\/download\/\">VisualGDB 2.0<\/a> or later 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\/hello-neon\/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\/hello-neon\/01-newproject.png\" alt=\"01-newproject\" width=\"700\" height=\"394\" \/><\/a><\/li>\n<li>For this tutorial we are going to copy a sample from the NDK. <a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/android\/hello-neon\/02-newandroidproject.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-2\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/android\/hello-neon\/02-newandroidproject.png\" alt=\"02-newandroidproject\" width=\"700\" height=\"616\" \/><\/a><\/li>\n<li>If you have not made any Android projects with VisualGDB before, press on &#8216;Configure NDK\/SDK locations&#8217;. There either browse to the needed tools or development kits or start installing them. <a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/android\/hello-neon\/03-androidsettings.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-3\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/android\/hello-neon\/03-androidsettings.png\" alt=\"03-androidsettings\" width=\"640\" height=\"203\" \/><\/a><\/li>\n<li>Press &#8216;Next&#8217; in the wizard. Choose the hello-neon sample project. <a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/android\/hello-neon\/04-sampleselection.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-4\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/android\/hello-neon\/04-sampleselection.png\" alt=\"04-sampleselection\" width=\"700\" height=\"542\" \/><\/a><\/li>\n<li>Press &#8216;Next&#8217;. Choose an Android platform 3 or higher. Choose the option of multiple libraries. Press &#8216;Finish&#8217;.<br \/>\n<span class=\"warning\">The option &#8216;The JNI Folder folder contains multiple libraries&#8217; needs to be selected as the Android.mk file for this project includes the source files separately.<\/span><a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/android\/hello-neon\/05-platformselection.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-5\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/android\/hello-neon\/05-platformselection.png\" alt=\"05-platformselection\" width=\"700\" height=\"542\" \/><\/a><\/li>\n<li>Connect a device with armeabi-v7a or start a virtual device with ABI armeabi-v7a (Android 4.0 or later). <a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/android\/hello-neon\/06-avdmanager.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-6\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/android\/hello-neon\/06-avdmanager.png\" alt=\"06-avdmanager\" width=\"694\" height=\"583\" \/><\/a><\/li>\n<li>If the app reports that it has no ARMv7 support although the device supports it, modify the Application.mk file to have only the <strong>armeabi-v7a<\/strong> target. Note that if you have already built the app, please delete the bin, obj and libs subfolders after you have modified Application.mk. <a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/android\/hello-neon\/07-applicationmkchange.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-7\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/android\/hello-neon\/07-applicationmkchange.png\" alt=\"07-applicationmkchange\" width=\"694\" height=\"583\" \/><\/a><\/li>\n<li>Build the project by going to Build-&gt;Build Solution. <a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/android\/hello-neon\/08-building.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-8\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/android\/hello-neon\/08-building.png\" alt=\"08-building\" width=\"694\" height=\"583\" \/><\/a><\/li>\n<li>Launch the project by going to Android-&gt;Launch Android App. A successful launch looks as follows i.e. there must be a value for the Neon version. Note that Neon instructions are slower on the emulator. <a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/android\/hello-neon\/09-running.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-9\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/android\/hello-neon\/09-running.png\" alt=\"09-running\" width=\"567\" height=\"534\" \/><\/a><\/li>\n<li>Add a breakpoint to line 106 of helloneon.c. <a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/android\/hello-neon\/10-breakpoint.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-10\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/android\/hello-neon\/10-breakpoint.png\" alt=\"10-breakpoint\" width=\"694\" height=\"583\" \/><\/a><\/li>\n<li>Start debugging. When prompted choose &#8216;Restart the first activity&#8217;. <a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/android\/hello-neon\/10a-restart.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-11\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/android\/hello-neon\/10a-restart.png\" alt=\"10a-restart\" width=\"350\" height=\"220\" \/><\/a><\/li>\n<li>When the breakpoint is hit take your time looking at the autos etc. Continue debugging when ready. <a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/android\/hello-neon\/11-stopped.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-12\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/android\/hello-neon\/11-stopped.png\" alt=\"11-stopped\" width=\"694\" height=\"583\" \/><\/a><\/li>\n<li>Look at the time difference between the Neon and C versions. Now the C version is much slower as stopping at our breakpoint affected the time calculations for it. <a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/android\/hello-neon\/12-running_changed.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-13\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/android\/hello-neon\/12-running_changed.png\" alt=\"12-running_changed\" width=\"567\" height=\"534\" \/><\/a><\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This tutorial shows how to build and debug the hello-neon sample project provided by Android NDK. Before we begin, ensure<\/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\/89"}],"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=89"}],"version-history":[{"count":1,"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/posts\/89\/revisions"}],"predecessor-version":[{"id":182,"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/posts\/89\/revisions\/182"}],"wp:attachment":[{"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/media?parent=89"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/categories?post=89"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/tags?post=89"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}