Open main menu

CDOT Wiki β

Changes

MAP524/DPS924 Lab 1

2,177 bytes added, 22:41, 30 June 2015
Part B: Configure your environment
<li>Before you move on to PART C, try "gradle --help" to see what else gradle can do. If the build was successful you can run the Bash tree command to get a bird's eye view of what files/directories were created by the build. Save this tree output, you'll need it for PART D of this lab.</li>
</ol>
 
== Part C: Start an Android Virtual Device (AVD) and install your app. ==
 
<ol>
<li>Use this comand to list your virtual devices:</li>
<pre>android list avd</pre>
<li>If you used the default settings when setting up Android Studio - you should have one AVD already. You can now start your AVD with this command: </li>
<pre>emulator -avd Nexus_5_API_22_x86 &</pre>
<li>If your AVD is too large on the screen you can use the scale option to make it smaller, like this:</li>
<pre>emulator -scale 0.4 -avd Nexus_5_API_22_x86</pre>
<li>Finally, we can install our APK onto our AVD with this command: </li>
<pre>adb install build/outputs/apk/GradleProject-debug.apk</pre>
<li>Now that our app is installed, we should be able to run it. Click on the app icon in the AVD to execute it.
<li>Modify your app by editing your HelloActivity.java file and change the text to be displayed to "Hello Seneca". You'll find your HelloActivity.java inside your project's java/org/hello folder.</li>
<li>Back in your apps project directory rebuild your app as in step B7.</li>
<li>Try to install the app using the adb command as in step C4. You should get an error message telling you that the app is already installed.</li>
<li>Use this adb command to connect to your AVD:</li>
<pre>adb shell</pre>
<li></li>
<pre></pre>
<li><Now that you have a shell on the AVD you can list all installed packages using the pm command like this /li>
<pre>pm list packages</pre>
<li>Use the pm command to remove your app. You'll have to use the full package name like this </li>
<pre>pm uninstall org.hello</pre>
<li>Exit the debug shell with the "exit" command or Ctrl+d.</li>
<li>You can now repeat step C4 to install your package.</li>
<li>Run your app to ensure it says "Hello my name is Andrew Smith" (but use your own name).</li>
<li>Now take a screen shot of your running app with this command </li>
<pre>screenshot2 -e lab01.png</pre>
<li>You can view the image file by using the Linux "display" command.</li>
<li>Be sure to attach this screenshot to your lab answers.</li>
<li>When satisfied with using Android command line tools please move on to PART D of this lab. </li>
</ol>
 
== Part D: Submit ==