2014年10月24日 星期五

[ Android AsyncTask] 從網路下載圖片,使用AsyncTask來顯示圖片。

在設計Android程式時,在下載網路上的資源,經常會使用到執行緒來進行多工,此時我們不能在執行緒內來改變UI內容,詳細資訊可參閱:
https://developer.android.com/guide/components/processes-and-threads.html
以下是使用執行緒來下載圖片,並利用AsyncTask來顯示圖片。
1. 首先建立新專案,並在activity_main.xml的資源檔中,新增按鈕及圖片視域物件。

2. 原始程式列表
3. 記得把Internet權限打開

4. 執行結果

[ Android Thread] 從網路下載圖片,使用post來顯示圖片。

在設計Android程式時,在下載網路上的資源,經常會使用到執行緒來進行多工,此時我們不能在執行緒內來改變UI內容,詳細資訊可參閱:
https://developer.android.com/guide/components/processes-and-threads.html
以下是使用執行緒來下載圖片,並利用post來顯示圖片。
1. 首先建立新專案,並在activity_main.xml的資源檔中,新增按鈕及圖片視域物件。
 2. 原始程式列表:
3. 記得把Internet權限打開

4. 執行結果

[ Android Thread] 從網路下載圖片,使用Handler來顯示圖片。

在設計Android程式時,在下載網路上的資源,經常會使用到執行緒來進行多工,此時我們不能在執行緒內來改變UI內容,詳細資訊可參閱:
https://developer.android.com/guide/components/processes-and-threads.html
以下是使用執行緒來下載圖片,並利用Handler來顯示圖片。
1. 首先建立新專案,並在activity_main.xml的資源檔中,新增按鈕及圖片視域物件。

2. 原始程式列表
3. 記得把Internet權限打開

4. 執行結果

2014年9月29日 星期一

LinkIt ONE 第一次接觸 -- 開發環境安裝與實作

9月15日聯發科 LinkIt ONE 以美金79元在 SeeedStudio 進行首賣,而我剛好在一個機緣下透過同學取得了一片,因此在此將環境安裝及實作整理並進行紀錄。

由於LinkIt ONE是聯發科與 SeeedStudio 公司合作的一個產品,可以在SeeedStudio 購物網站購買到,另外在台灣也可以在拍賣網站上搜尋的到,其價格大約落在NT$2500左右。

2014年8月31日 星期日

[ Unity Animation ] Palm Trees Pack

1. Download and import the package of Palm Trees Pack.

2. We add some code in the method of Setup.


The variable of trees is defined as follows.
private var trees:GameObject;

The some codes are added in the method of Setup in order to adjust the position in the Screen.
trees = GameObject.Find("All PalmTrees");
trees.transform.localScale = Vector3(0.5f, 0.5f, 0.5f);
trees.transform.position += Vector3(-0.2f, -0.4f, 0.0f);

 3. _The property of WaveAndDistance is found in Waving DoublePassCullBackface located in the the folder of Shaders.


[Unity Animation] Spider attacks.


The following steps is presented.
1. Start the unity and then open Asset Store Window.
2. Download the SPIDER package.

3. Open the scene of temp_scene.
4. Observe all actions of animation.

5. Create a C# file and then open the Editor of Assembly CSharp.
6. Write the programming of spider animation.
7. Build and Running