Skip to content

Instantly share code, notes, and snippets.

@clamytoe
Last active August 29, 2015 14:27
Show Gist options
  • Save clamytoe/51343bfafc7eb2580acd to your computer and use it in GitHub Desktop.
Save clamytoe/51343bfafc7eb2580acd to your computer and use it in GitHub Desktop.
HKUSTx: COMP107x Introduction to Mobile Application Development using Android
Display the source blob
Display the rendered blob
Raw
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Exercise: Hello, World! App\n",
"---\n",
"## Objectives\n",
"\n",
"At the end of this exercise, you will be able to:\n",
"* Create a simple \"Hello, World\" Android Application\n",
"* Understand the various parts of an Android Project\n",
"* Learn to use the Android Emulator\n",
"* Understand the structure of a simple User Interface\n",
"\n",
"## Introduction\n",
"\n",
"This example gets you started on your first Android app. You learn to use the Android studio IDE to create a standard Hello World app with the built-in templates. After you complete the exercise steps and see the resulting application running on either the emulator or on a real device, we will then dissect the application to understand some of the Android concepts. As you do each step, ask yourselves why you might be doing it. We will analyze the steps later on. The reason why I want you to proceed in this order is so that you get to see the end result first before we examine the concepts.\n",
"\n",
"## Textual Instructions\n",
"\n",
"As you go through these steps, you will encounter several new terms that will be highlighted in italics. These terms will be explained in detail after you complete the exercise.\n",
"\n",
"1. **Create a new Android Project**: Start Android Studio. Once started, in the welcome window click **Start a New Android Project**.\n",
"\n",
" ![Welcome Screen](https://courses.edx.org/asset-v1:HKUSTx+COMP107x+2016_T1+type@asset+block/HW-1.png)<br/>\n",
"\n",
"2. **Create the project**: When the next window opens, type the information in as shown below.\n",
"\n",
" ![New Project](https://courses.edx.org/asset-v1:HKUSTx+COMP107x+2016_T1+type@asset+block/HW-2.png)<br/>\n",
"\n",
"3. **Select the target form factors**: Select the platform to be the phone and tablet by checking the box, and select the minimum SDK level to be API 21 as shown below.\n",
"\n",
" ![Target Android Devices](https://courses.edx.org/asset-v1:HKUSTx+COMP107x+2016_T1+type@asset+block/HW-3.png)<br/>\n",
"\n",
"4. **Add an activity**: Select the starting activity to be a blank activity. This will create an app from a template with a single activity and a standard screen layout displaying \"Hello world!\".\n",
"\n",
" ![Add an activity to Mobile](https://courses.edx.org/asset-v1:HKUSTx+COMP107x+2016_T1+type@asset+block/HW-4.png)<br/>\n",
"\n",
"5. **Customize the activity**: We can choose the name of the activity, layout file name, title and menu resource name as shown below.\n",
"\n",
" ![Customize the Activity](https://courses.edx.org/asset-v1:HKUSTx+COMP107x+2016_T1+type@asset+block/HW-5.png)<br/>\n",
"\n",
"6. **See the Graddle build in operation**: Android Studio needs to build the project. It uses the Gradle build system for this purpose. You will see the following screen for some time showing the progress of the build.\n",
"\n",
" ![Gradle build](https://courses.edx.org/asset-v1:HKUSTx+COMP107x+2016_T1+type@asset+block/HW-6.png)<br/>\n",
"\n",
"7. **See the completed project**: You will see the following screen upon completion of the build.\n",
"\n",
" ![Android Studio UI](https://courses.edx.org/asset-v1:HKUSTx+COMP107x+2016_T1+type@asset+block/HW-7.png)<br/>\n",
"\n",
"8. There it is - \"Hello, World!\" in Android! The next step, of course, is to see it running either in an emulator or on a mobile device."
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 2",
"language": "python",
"name": "python2"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 2
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython2",
"version": "2.7.6"
}
},
"nbformat": 4,
"nbformat_minor": 0
}
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment