Skip to content

Commit 3ff2ed2

Browse files
trevorahrichardwestenra
authored andcommitted
Android links for everyone (#342)
* fixed trailing whitespace * turned plaintext urls into links
1 parent cefd148 commit 3ff2ed2

1 file changed

Lines changed: 15 additions & 15 deletions

File tree

android/1introduction/tutorial.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@ title: Introduction to Android Development
55

66
## 1. Intro
77

8-
The aim of this worksheet is to create a cookie clicker game (http://orteil.dashnet.org/cookieclicker/), with a cookie image that can be tapped to increase the score.
8+
The aim of this worksheet is to create a cookie clicker game (http://orteil.dashnet.org/cookieclicker), with a cookie image that can be tapped to increase the score.
99

1010
To follow this tutorial, you will need to [install Android
1111
Studio](https://developer.android.com/studio/index.html) (please
1212
note: this is a large file, so our advice is to download and install it before
1313
arriving at the workshop!)
1414

15-
Feel free to chose a different topic other than cookies, we really like the popular pokémon Goomy Clicker - http://joezeng.github.io/goomyclicker what things do you like?
15+
Feel free to chose a different topic other than cookies, we really like the popular pokémon [Goomy Clicker](http://joezeng.github.io/goomyclicker) - what things do you like?
1616

1717
![Imgur](http://i.imgur.com/ssQF3jO.png)
1818

@@ -24,15 +24,15 @@ Feel free to chose a different topic other than cookies, we really like the popu
2424
2525
Next, we set the SDK level to `14` - It'll give you a helpful guide for how many people this supports. Speak to your coach about what minimum sdk level they usually have to use.
2626

27-
Finally, we want to create an `Empty Activity`
27+
Finally, we want to create an `Empty Activity`
2828

2929
![Imgur](http://i.imgur.com/PzqiEXC.png)
3030

3131
> We are going to keep the default of MainActivity.java and activity_main.xml :smile:
3232
3333
click FINISH (this might take some time)
3434

35-
Take some time to look at the different buttons with your coach - where are the different files located in the project? How do you run your app in an emulator or on a device?
35+
Take some time to look at the different buttons with your coach - where are the different files located in the project? How do you run your app in an emulator or on a device?
3636

3737
## 3. Layouts
3838

@@ -44,7 +44,7 @@ We're going to be dealing with the XML directly in this tutorial, so find the 't
4444

4545
Now you should see some code that looks familiar-ish! Android layouts using XML, which is very very similar to HTML. You should see already we have a `<RelativeLayout>` and a `<TextView>` tag, with some attributes already there. The thing that looks weird is that all the attributes currently are prefixed with the word `android`.
4646

47-
One of the most important features of our cookie clicker will be our cookie - we can create an `<ImageView>`, you will need to provide a `height` and a `width`. We also need to provide it an id so we can connect to it later.
47+
One of the most important features of our cookie clicker will be our cookie - we can create an `<ImageView>`, you will need to provide a `height` and a `width`. We also need to provide it an id so we can connect to it later.
4848

4949
```xml
5050
<ImageView
@@ -55,17 +55,17 @@ One of the most important features of our cookie clicker will be our cookie - we
5555

5656
> id’s need to start with @+id/ - the plus symbol means it assigns the variable name to the current ImageView
5757
58-
In Android we don't use pixels, but instead use `dp` which is a device point. 1 point might be 1 pixel on a really low resolution device, but might be 4 pixels, or even 8 pixels on a newer device. Take a look at this handy guide Android wrote for more information https://developer.android.com/guide/practices/screens_support.html .
58+
In Android we don't use pixels, but instead use `dp` which is a device point. 1 point might be 1 pixel on a really low resolution device, but might be 4 pixels, or even 8 pixels on a newer device. Take a look at [this handy official guide](https://developer.android.com/guide/practices/screens_support.html) for more information.
5959

60-
Next, we want to save the following cookie image into our project. You can either google for a cookie image that's free to use, or use ours that we found earlier = http://imgur.com/a/9BXV4 . You need to save it inside your project folder using Windows Explorer or Mac OSX Finder and navigate to the following -> app -> src -> main -> res . You need to create a folder called `drawable-xhdpi` and place your cookie image in here!
60+
Next, we want to save the following cookie image into our project. You can either google for a cookie image that's free to use, or use [our example image](http://imgur.com/a/9BXV4). You need to save it inside your project folder using Windows Explorer or Mac OSX Finder and navigate to the following -> app -> src -> main -> res . You need to create a folder called `drawable-xhdpi` and place your cookie image in here!
6161

6262
Because android has different density devices, we usually need to provide different resolution images for all those different devices. If we only provide it in one folder, Android will scale the image for other devices, but this might cause make the image look bad!
6363

6464
![Imgur](http://i.imgur.com/dIMVebY.png)
6565

6666
If we want to then use that image in our Android app we can use an attribute `android:src="@drawable/cookie"` - autocomplete will be your friend here!
6767

68-
Because we have a RelativeLayout parent this means we can do some special things to position our cookie on our screen. We can provide an attribute like `android:layout_centerInParent="true"`.
68+
Because we have a RelativeLayout parent this means we can do some special things to position our cookie on our screen. We can provide an attribute like `android:layout_centerInParent="true"`.
6969

7070
Next, we want to look at having a TextView for to keep track of how many cookies we've clicked. Again you need to provide it a height, width, and id. But we can also provide it some special label things, such as `text`, `textColor`, or `textSize`
7171

@@ -75,13 +75,13 @@ Another neat feature of using a RelativeLayout is how we can position things **i
7575

7676
> this is how our layout code finally looked :smile:
7777
78-
Ask your coach what other special things RelativeLayout can do? Do you know any other alternative parent layouts? Take a look at https://developer.android.com/guide/topics/ui/layout/relative.html for more information.
78+
Ask your coach what other special things RelativeLayout can do? Do you know any other alternative parent layouts? Take a look at the [official guide](https://developer.android.com/guide/topics/ui/layout/relative.html) for more information.
7979

8080
## 4. Clicking
8181

8282
Next, we want to make it so our cookie actually does something when it's been clicked on!
8383

84-
We want to open our MainActivity.java file and take a look at what's there already. What do you think the `onCreate` method might do? Speak to your coach about what other methods get called in the activity lifecycle. For more information look at https://developer.android.com/training/basics/activity-lifecycle/index.html .
84+
We want to open our MainActivity.java file and take a look at what's there already. What do you think the `onCreate` method might do? Speak to your coach about what other methods get called in the activity lifecycle. For more information look at the [official training guide](https://developer.android.com/training/basics/activity-lifecycle/index.html).
8585

8686
Inside the `onCreate` method, below where it sets the layout to the xml file we just finished designing. We want to create a variable called imgCookie and findViewById to hook them up. This is similar to how we use jQuery in JavaScript to hook up with a HTML element
8787

@@ -99,11 +99,11 @@ After, we can set an onClickListener, which is again similar to the JavaScript e
9999

100100
![Imgur](http://i.imgur.com/IhKTxKv.png)
101101

102-
Inside our method we're going to put a Toast. These are those little messages at the bottom of the phone that show for a short period of time. They're really good
102+
Inside our method we're going to put a Toast. These are those little messages at the bottom of the phone that show for a short period of time. They're really good
103103

104104
![Imgur](http://i.imgur.com/K5q1Ftr.png)
105105

106-
Run your app now, and see what happens when you tap on the cookie!
106+
Run your app now, and see what happens when you tap on the cookie!
107107

108108
## 5. Game Logic
109109

@@ -155,8 +155,8 @@ If you want to take your cookie game clicker onwards, maybe consider:
155155

156156
## 8. More Information
157157

158-
Amal has written a more advanced android tutorial located at https://github.com/K4KYA/MakersHelloAndroid/tree/codebar if you want to take Android even further :)
158+
Amal has written a more [advanced android tutorial](https://github.com/K4KYA/MakersHelloAndroid/tree/codebar) if you want to take Android even further :)
159159

160-
If you’d like to go even further, the Big Nerd Ranch have a really very good book to pick up Android (they have an iOS book too) - https://www.bignerdranch.com/we-write/
160+
If you’d like to go even further, the Big Nerd Ranch have a [really very good book](https://www.bignerdranch.com/we-write) to pick up Android (they have an iOS book too).
161161

162-
Google also has their own tutorial series at https://developer.android.com/training/basics/firstapp/index.html, which touches on some of the details and complexities of Android app development - saving data, sharing things with other apps, getting location data and other things you may want a more complex app to be able to do.
162+
Google also has their own [tutorial series](https://developer.android.com/training/basics/firstapp/index.html), which touches on some of the details and complexities of Android app development - saving data, sharing things with other apps, getting location data and other things you may want a more complex app to be able to do.

0 commit comments

Comments
 (0)