Android Studio 版控
===
## 從GitHub下載檔案下來(第一次的時候做)
1. 辦一個GitHub帳號 www.github.com
2. 下載git到你的電腦,https://git-scm.com/downloads
3. 在Android Studio中點擊功能表「File/Settings/Version Control/Git」,輸入你的Git安裝位置並點Test確認連接。
4. 確認APP資料夾內有 **.gitignore** 。假設沒有添加。Android Studio有個插件叫—— ignore,可以去搜索安裝,安裝之後,在頂級目錄,右鍵—> New —> ignore file —> .gitignore file,還可以選擇不同的語言和框架,我們選擇Android就行了。

5. 在Android Studio中點擊功能表「File/Settings/Version Control/GitHub」,輸入你的GitHub信箱及密碼點選OK。
6. 在Android Studio中點擊功能表「File/New/Project from Version Control/GitHub」由GitHub版本控制取得專案,顯示如下畫面::
* Git Repository URL(GitHub來源): https://github.com/janis03050055/Mahjong_counter.git
點選Test確定可連接。

* Parent Directory(本地端儲存位置):建議路徑位置都是英文**不要有中文**!!
---
## 只要你要改程式必做的事
### 從GitHub Pull到本地端把程式更新為最新
在你改程式前就要做這步驟,確保和其他人不會有因版本上的落差造成的程式衝突。
* 以下為Pull方式
1. 「VCS/Git/Pull」什麼都不用改直接按Pull。

假設有衝突,按一下View then,可以點Show Diff看一下不同的地方,或直接捨棄他點選Revert。

2. 確定本機端為最新版本
* Android Studio

* GitHub

### 將你所修改的程式Push到GitHub <--能動再上傳
* 每次Push請**到群組留言**,並大略說一下你更新了什麼
* 每**一小部分能動就更新一次**(更新文字、新稱一個按鈕功能等),不要一口氣上傳!!
* 請確定你程式內的**註解都有寫好**
1. 介面元件(按鈕等)命名方式依照[大駝峰式命名法](https://zh.wikipedia.org/wiki/%E5%B8%95%E6%96%AF%E5%8D%A1%E5%91%BD%E5%90%8D%E6%B3%95),例如:有一顆Button功能是拍照則命名為b_TakePhoto(b為元件縮寫、Take photo為該動作英文名第一個單字首字母採用大寫字母;後續單字的首字母亦用大寫字母)。
2. 變數名稱所代表意思,不要用a、b、c變數名稱打有意義的字像是count。
3. Function是在做甚麼事的,function內部的程式也請打註解。
4. 點擊Button會發甚麼事等。
5. 有新增中文的字要打在res/values/strings.xml方便未來修正字或國際化

使用strings.xml方式如下:

* 以下為程式Push方式
1. 「VCS/Git/Commit File」,勾選你所要更新的檔案,點選Commit and Push
你這次更新了甚麼地方,**一定要打註解**!!越清楚越好像是:新增了甚麼功能、修正了甚麼地方...,另外作者欄記得打自己的**GitHub名字**。

2. 點選Push

3. 去[GitHub](https://github.com/janis03050055/Mahjong_counter)確認有上傳成功

並更新README.md檔。
---
## 額外補充,你們不用做
### 將本地的軟體放到github上面。
1. Sign up and create a GitHub account in www.github.com.
2. Download git from https://git-scm.com/downloads and install it in your system.
3. Open the project in android studio and go to File -> Settings -> Version Control -> Git.
4. Click on test button to test "path to Git executables". If successful message is shown everything is ok, else navigate to git.exe from where you installed git and test again.
5. Go to File -> Settings -> Version Control -> GitHub. Enter your email and password used to create GitHub account and click on OK button.
6. Then go to VCS -> Import into Version Control -> Share Project on GitHub. Enter Repository name, Description and click Share button.
7. In the next window check all files inorder to add files for initial commit and click OK.
8. Now the project will be uploaded to the GitHub repository and when uploading is finished we will get a message in android studio showing "Successfully shared project on GitHub". Click on the link provided in that message to go to GitHub repository.
**假設不成功就重建幾次吧~哈哈**