Thursday, December 25, 2014

柯博文老師的新書- Raspberry Pi 超炫專案與完全實戰。

Raspberry Pi 超炫專案與完全實戰。


  • 作者: 柯博文

  • 出版社:碁峰資訊

  • 出版日期:2014-12-30

  • 語言:繁體中文

  • ISBN:

  • EAN:

  • 定價:520元

  • 博客來: 元 這裡

  • 天瓏網路書店: 元 這裡

  • 誠品網路書店: 元 這裡

Raspberry Pi 討論區: 網頁版






AEH002500-cover-1224 copy


Chapter 01 簡介Raspberry  Pi

Chapter 02 執行作業平台

Chapter 03 網路架設

Chapter 04 建立網站伺服器系統

Chapter 05 網路附加儲存NAS系統,USB 外接硬碟檔案伺服器

Chapter 06 建立家庭雲端儲存系統

Chapter 07 藍莓派電視機盒

Chapter 08 Android

Chapter 09 氣象預報機

Chapter 10 氣候監視器

Chapter 11 藍莓派照相機、藍莓派攝影機

Chapter 12 數位播放機

Chapter 13 安全監視系統

Chapter 14 擴增實境影像辨識系統

Chapter 15 條碼掃描機

Chapter 16 P2P檔案下載機

Chapter 17 自製GameBoy 掌上型遊戲機

Chapter 18 遙控電器開關

Chapter 19 遙控汽車專案

Chapter 20 藍莓派迷你無線路由器

Chapter 21 藍莓派機器人

Chapter 22 樹莓派螢幕

Chapter 23 藍莓派超級電腦



柯博文老師的新書- Raspberry Pi 超炫專案與完全實戰。

Tuesday, December 9, 2014

True space 3完全實戰手冊

 


True space 3完全實戰手冊


  • 作者: 柯博文

  • 出版社:碁峰資訊

  • 出版日期:1998-01-1

  • 語言:繁體中文

  •  ISBN: 957-566-157-5

  • 定價:340元

  • 金石堂:289

11090809711029_433_s


 


 



True space 3完全實戰手冊

超人氣Shareware一把抓

超人氣Shareware一把抓


  • 作者: 柯博文

  • 出版社:碁峰資訊

  • 出版日期:1998-12-1

  • 語言:繁體中文

  •  ISBN: 957-566-493-0

  • 定價:280元

  • 金石堂:238


 



超人氣Shareware一把抓

Visual Basic 6.0函數範例應用

 


Visual Basic 6.0函數範例應用


  • 作者: 柯博文

  • 出版社:博碩文化

  • 出版日期:1999-02-1

  • 語言:繁體中文

  • ISBN:957-527-143-2

  • 定價:490元

  • 金石堂:387


 


 



Visual Basic 6.0函數範例應用

Wednesday, December 3, 2014

BeagleBone Black 課前準備

BeagleBone Black 課程 ,


2014/12/8,9,15,16,18 新竹, Beaglebone Black周邊設備控制之軟/硬/軔體應用整合開發實作系列


請在課前準備以下的事物:


1. 請準備以下的硬體


  • BeagleBone Black Rev C.

  • mini USB 的線

  • 4G~16G 的 Micro SD 卡

  • USB 讀卡機 用來讀寫 Micro SD 卡

2. 請下載和安裝以下的檔案到硬碟中:


  • 請到 官方網站 http://beagleboard.org/getting-started 下載電腦的Windows 驅動程式

  • 下載 Putty,網址是:http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html

  • 下載REAL VNC 下載網址是http://www.realvnc.com/download/viewer/

  • 下載7-zip下載網址是 http://www.7-zip.org/download.html

3. 請下載以下的檔案到硬碟中:


  • https://s3.amazonaws.com/angstrom/demo/beaglebone/BBB-eMMC-flasher-2013.09.04.img.xz

  • http://debian.beagleboard.org/images/BBB-eMMC-flasher-debian-7.5-2014-05-14-2gb.img.xz

 


 


 



BeagleBone Black 課前準備

Tuesday, December 2, 2014

Beaglebone Black周邊設備控制之軟/硬/軔體應用整合開發實作系列

103年物聯網系列課程》


Beaglebone Black周邊設備控制之軟/硬/軔體應用整合開發實作系列


BeagleBone Black僅需花費約新台幣千元購買其硬體設備,即可執行Linux、Android等作業系統,並且擁有GPIO可以控制周邊,網路連接與USB的介面,使其可成為機上盒並當成電腦使用。尺寸則僅一張名片大小,方便隨身攜帶;其並具備技術愛好者能運用開放原始碼系統的優勢,能迅速建立低成本系統。


本系列課程全程將進行5天,分別包括:(A)第一階段:Android Beaglebone Black 物聯網開發;(B)第二階段:Android Beaglebone Black 系統開發;(C)第三階段:Android Beaglebone Black BLE Driver底層系統開發,特聘國際知名技術專家-柯博文老師,示範感應器如何透過作業系統與BeagleBone Black硬體相互連接的技術與方法,並且透過網頁控制周邊設備的紮實開發程式技術,期望提供學員接觸新技術並體驗現有產品帶來的新機會。


※參加者條件:(1)程式設計相關經驗與Linux 基礎知識;(2)建議自備mini SD card 做為BeagleBone Black 開機使用(3)建議自備BeagleBone Black Rev C實驗板和麵包板等簡易硬體線材。未自備實驗板與mini SD card者可使用主辦單位提供之設備進行實作。預計招生20人,最低人數:12人。































日期(A)第一階段:Android Beaglebone Black物聯網開發           12/ 08~09日(一~二) 09:30~16:30

(B)第二階段:Android Beaglebone Black系統開發             12/15~16日( 一~二) 09:30~16:30


(C)第三階段:Android Beaglebone Black BLE Driver底層系統開發 12/18日(四)       09:30~ 16:30

地點新竹市光復路二段295號3樓恆逸資訊電腦教室(位於工研院光復院區旁之帝國經貿大樓上)
講師 ‧美國矽谷錄克軟體設計公司(LoopTek)首席技術執行長 柯博文老師

專長與經歷:曾多次獲設計比賽大獎;為大型上市公司(如美國SanDisk 、國泰世華銀行、臺灣房屋、昱泉國際、美華影音、中國移動、海信電視等)開發手機應用軟體和多項硬體穿戴式設備產品;在  Android 和iOS平台上開發銷售近百款軟體。曾任大陸工信部電子視像行業協會數位平台推進中心顧問  和台灣工研院資通所顧問。授課地點遍及美國矽谷、台灣、大陸等地,並應邀在美國相關iOS開發者大  會、台北Computex展、上海GDC大會、北京手機開發者大會、北京CSDN 移動大會等活動擔任演講者。


著作:「Android 變形金剛:程式設計實戰應用」、「Arduino互動設計專題與實戰」、「Raspberry Pi 最佳入門與實戰應用」、「Raspberry Pi 超炫專案與完全實戰 」等。

(A)第一階段:Android Beaglebone Black物聯網開發
‧簡介BeagleBone Black

‧準備作業系統和開機 sd card


‧連接到電視、USB、聲音與網路


Linux 作業系統與BeagleBone Black 整合


BeagleBone Linux shell


‧桌面應用程式整合


‧使用BeagleBone Black架設網路伺服器


‧架設網頁伺服器


‧架設資料庫伺服器


‧架設公司用的網頁


‧架設個人部落格wordpress


RS232 com port使用或對傳

‧了解BeagleBone Black的電路設計

Python開發BeagleBone Black的應用程式


BeagleBone的GPIO接腳控制


BeagleBone的周邊感應器類比資料讀取和PWM


BeagleBone的周邊感應器 SPI資料讀取


BeagleBone的周邊感應器I2C資料讀取


‧遠端控制


‧遠端家電控制


‧居家安全監控系統


‧透過網頁遠端控制BeagleBone


‧與手機結合


iOS/Android 遠端物聯網控制

(B)第二階段:Android Beaglebone Black系統開發
Android平臺移植:Android移植的主要步驟與方法、配置Linux內核支援Android、Linux內核中添加Android驅動、製作yaffs2、jffs2格式的Android檔案系統

LAB:下載Linux內核、Android源碼,編譯、移植到目標開發板平臺


LAB:編寫兩個簡單的應用程式(GPIO+ LED / BLE + 手機對傳)執行在目標開發板平臺

Android底層開發基礎:Android啟動流程與相關服務解析、添加自己的平臺、添加本地庫的方法、Dalvik虛擬機工作原理介紹、Jni開發/HAL開發、SystemServer、ServiceManager介紹、Android Binder工作原理

Android調試方法


LAB:編寫一應用程式、Framework、jni、HAL實現Android平臺上之LED (GPIO)控制 [Android Sensor開發框架]說明

(C)第三階段:Android Beaglebone Black BLE Driver底層系統開發
Android BLE Driver底層重要應用( Trace Code):利用 BLE 開發/應用當成講解範例 ( BLE +手機對傳)

‧說明理解原始相關程式碼的內容


‧實際修改和撰寫Android Kernel Driver藍芽驅動程式


‧調整Android HAL 藍芽中間層


‧修改Android 藍芽framework


‧撰寫Android 藍芽APP


‧本課程的目標是添加和修改藍芽硬體,並順利運作在現有的Android 系統。

【課程費用與繳費方式】
  • 課程費用

(A)第一階段(12/08-09日):NT$6,500 /1人。1124日以前報名或同公司5人以上參加者可享優惠價NT$6,000/人。


(B)第二階段(12/15-16日):NT$6,500 /1人。1124日以前報名或同公司5人以上參加者可享優惠價NT$6,000/人。


(C)第三階段(12/18日) :NT$3,250 /1人。1124日以前報名或同公司5人以上參加者可享優惠價NT$3,000/人。


同時報名(A)+(B)+(C)三個階段課程者可享優惠價NT$14,000 /1人


(2)繳費方式:


a.即期支票、匯票(抬頭—中華民國計量工程學會)請郵寄至:新竹市光復路二段321號3館204室


b.電匯或ATM轉帳帳號:帳戶:台灣土地銀行(005) 戶名:中華民國計量工程學會 帳號:156001000161 郵寄地址:新竹市光復路二段321號3館204室。匯款時請註明參加者姓名、所屬機構與課程名稱。匯款後請將匯款收據傳真至03-5743838。

Beaglebone Black周邊設備控制之軟/硬/軔體應用整合開發實作系列》報名表
報名班次 (A)+(B)+(C) 等3個階段   □(A)第一階段   (B)第二階段   (C)第三階段
機構名稱
統一編號
地址
姓名部 門電       話傳   真E-mail


(   )      分機



(   )       分機

【報名方式】

(1)報名網址


(A)第一階段12/08~09日:http://www.nml.org.tw/training.orig/course/course_details.php?id=03182


(B)第二階段12/15~16日:http://www.nml.org.tw/training.orig/course/course_details.php?id=03185


(C)第三階段12/18日   :http://www.nml.org.tw/training.orig/course/course_details.php?id=03187


(2)傳真報名專線:03-5743838,聯絡人:彭小姐03-5743809、羅小姐 03-574 3703


(3)E-mail報名或索取簡章信箱:kitty-peng@itri.org.tw


(4)課前1週以E-mail與傳真方式傳送上課通知單

主辦單位:中華民國計量工程學會           執行單位:工業技術研究院量測中心



Beaglebone Black周邊設備控制之軟/硬/軔體應用整合開發實作系列

Thursday, November 27, 2014

04 cvRectangle 正方形的外框

penCV 的畫連續畫線指令



#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/opencv.hpp>
#include <iostream>
#include <string.h>
#include <fstream>
using namespace cv;
int main(int argc,char **argv)

int width,height;
if(argc<=1)

std::cout<<"Error:Please Load a picture!"<<std::endl;
return 0;


IplImage *image;
//建立視窗
namedWindow("image",CV_WINDOW_AUTOSIZE);

//讀取圖片
image=cvLoadImage(argv[1]);
width=image->width;
height=image->height;

// 畫出正方形的外框
cvRectangle(image,
cvPoint((width/4),(height/4)),
cvPoint((width/4)*3,(height/4)*3),
CV_RGB(255,0,0),3,CV_AA,1);


cvShowImage("image",image);
waitKey(0);

cvDestroyAllWindows();
cvReleaseImage(&image);
system("pause");
return 0;





Screen Shot 2014-11-27 at 11.29.02 PM



04 cvRectangle 正方形的外框

01 cvLine,畫線

openCV 的畫線指令cvLine


openCV 的畫線指令


void cvLine(CvArr* img, CvPoint pt1, CvPoint pt2, CvScalar color, int thickness=1, int line_type=8, int shift=0 )


參數:


  • img – Image.

  • pt1 – First point of the line segment.

  • pt2 – Second point of the line segment.

  • color – Line color.

  • thickness – Line thickness.

  • lineType – Type of the line: 8 (or omitted) – 8-connected line. 4 – 4-connected line. CV_AA – antialiased line.

  • shift – Number of fractional bits in the point coordinates.


#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/opencv.hpp>
#include <iostream>
#include <string.h>
#include <fstream>
using namespace cv;
int main(int argc,char **argv)

int width,height;
if(argc<=1)

std::cout<<"Error:Please Load a picture!"<<std::endl;
return 0;


IplImage *image;
//建立視窗
namedWindow("image",CV_WINDOW_AUTOSIZE);

//讀取圖片
image=cvLoadImage(argv[1]);
width=image->width;
height=image->height;

//畫出紅線
cvLine(image, cvPoint((width/4),(height/4)),
cvPoint((width/4)*3,(height/4)*3),
CV_RGB(255,0,0),3,CV_AA,1);
//畫出綠線
cvLine(image,cvPoint((width/4)*1,(height/4)*3),
cvPoint((width/4)*3,(height/4)),
CV_RGB(0,255,0),3,CV_AA,1);

cvShowImage("image",image);
waitKey(0);

cvDestroyAllWindows();
cvReleaseImage(&image);
system("pause");
return 0;


Screen Shot 2014-11-27 at 11.05.07 PM



01 cvLine,畫線

02 cvPutText文字

openCV 的文字指令 cvPutText文字


[PHP]

#include

#include

#include

#include

#include

#include

using namespace cv;

int main(int argc,char **argv)


int width,height;

if(argc


std::coutwidth;

height=image->height;


CvFont font;

double hScale=1.0;

double vScale=1.0;

int lineWidth=1;

cvInitFont(&font,CV_FONT_HERSHEY_SIMPLEX

[/PHP]


1-16



02 cvPutText文字

01 cvPolyLine,畫線

openCV 的畫線指令

[PHP]

#include

#include

#include

#include

#include

#include

using namespace cv;

int main(int argc,char **argv)


int width,height;

if(argc


std::cout
return 0;


IplImage *image;

//建立視窗

namedWindow("image",CV_WINDOW_AUTOSIZE);


//讀取圖片

image=cvLoadImage(argv[1]);

width=image->width;

height=image->height;


CvPoint PointArray1[6];

CvPoint *PointArray[2]= &PointArray1[0],&PointArray1[3];


PointArray[0][0]=cvPoint((width/6)*1,(height/6)*3);

PointArray[0][1]=cvPoint((width/6)*2,(height/6)*2);

PointArray[0][2]=cvPoint((width/6)*3,(height/6)*2);

PointArray[1][0]=cvPoint((width/6)*4,(height/6)*3);

PointArray[1][1]=cvPoint((width/6)*3,(height/6)*4);

PointArray[1][2]=cvPoint((width/6)*2,(height/6)*4);


int PolyVertexNumber[1]=6;

int BlockNumber=1;


cvPolyLine(image,PointArray,PolyVertexNumber,

1,true,CV_RGB(0,255,0),3,CV_AA,0);


cvShowImage(“image",image);


waitKey(0);


cvDestroyAllWindows();

cvReleaseImage(&image);

system(“pause");

return 0;


[/PHP]


1-15



01 cvPolyLine,畫線

03 CvConvertImage, CV_CVTIMG_FLIP , 上下顛倒

openCV 的圖片上下顛倒



#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/opencv.hpp>
#include <iostream>
#include <string.h>
#include <fstream>
using namespace cv;
int main(int argc,char **argv)


if(argc<=1)

std::cout<<"Error:Please Load a picture!"<<std::endl;
return 0;


IplImage *image,*hsv,*mask;
//建立視窗
namedWindow("image",CV_WINDOW_AUTOSIZE);
namedWindow("hsv",CV_WINDOW_AUTOSIZE);

//讀取圖片
image=cvLoadImage(argv[1]);
hsv=cvCreateImage(cvGetSize(image),8,3);
//將顏色RGB轉成HSV 顏色
cvCvtColor(image,hsv,CV_RGB2BGR);
cvShowImage("image",image);
cvShowImage("hsv",hsv);

waitKey(0);

cvDestroyAllWindows();
cvReleaseImage(&image);
cvReleaseImage(&hsv);
system("pause");
return 0;


1-14



03 CvConvertImage, CV_CVTIMG_FLIP , 上下顛倒

02 cvConvertImage , CV_CVTIMG_SWAP_RB 1.2.1 紅色 藍色 顏色互轉

openCV 的顏色轉換API
cvConvertImage , CV_CVTIMG_SWAP_RB 1.2.1 紅色 藍色 顏色互轉



#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/opencv.hpp>
#include
#include
#include
using namespace cv;
int main(int argc,char **argv)


if(argc<=1)

std::cout<<"Error:Please Load a picture!"<<std::endl;
return 0;


IplImage *image,*hsv,*mask;
//建立視窗
namedWindow("image",CV_WINDOW_AUTOSIZE);
namedWindow("CV_CVTIMG_SWAP_RB",CV_WINDOW_AUTOSIZE);

//讀取圖片
image=cvLoadImage(argv[1]);
hsv=cvCreateImage(cvGetSize(image),8,3);
cvConvertImage(image,hsv,CV_CVTIMG_SWAP_RB);
cvShowImage("image",image);
cvShowImage("CV_CVTIMG_SWAP_RB",hsv);

waitKey(0);

cvDestroyAllWindows();
cvReleaseImage(&image);
cvReleaseImage(&hsv);
system("pause");
return 0;


1-12



02 cvConvertImage , CV_CVTIMG_SWAP_RB 1.2.1 紅色 藍色 顏色互轉

01 CV_RGB2BGR,BGR 轉RGB

cvtColor( m1,m2, CV_RGB2BGR);

 由於 OpenCV 影像格式為 BGR 排列, 而非一般 圖片的 RGB 排列. 可以透過以下指令轉換格式。



#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/opencv.hpp>
#include
#include
#include
using namespace cv;
int main(int argc,char **argv)


if(argc<=1)

std::cout<<"Error:Please Load a picture!"<<std::endl;
return 0;


IplImage *image,*hsv,*mask;
//建立視窗
namedWindow("image",CV_WINDOW_AUTOSIZE);
namedWindow("hsv",CV_WINDOW_AUTOSIZE);

//讀取圖片
image=cvLoadImage(argv[1]);
hsv=cvCreateImage(cvGetSize(image),8,3);
//將顏色RGB轉成HSV 顏色
cvCvtColor(image,hsv,CV_RGB2BGR);
cvShowImage("image",image);
cvShowImage("hsv",hsv);

waitKey(0);

cvDestroyAllWindows();
cvReleaseImage(&image);
cvReleaseImage(&hsv);
system("pause");
return 0;


1-12



01 CV_RGB2BGR,BGR 轉RGB

Saturday, November 22, 2014

05 儲存圖片

使用OpenCV 改變圖片的顏色成為灰色,並將資料儲存在檔案中,以及顯示在畫面上。



#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/opencv.hpp>
#include <iostream>
#include <string.h>
#include <fstream>

using namespace cv;

int main( int argc, char** argv )

char* imageName = argv[1];
Mat image;
image = imread( imageName, 1 );
if( argc != 2

編譯時的指令:

g++ main.cpp -o main -I/opt/local/include -L/opt/local/lib -lopencv_core.2.4.10


執行結果:
Screen Shot 2014-11-23 at 1.46.50 PM



05 儲存圖片

03 改變圖片的顏色

使用OpenCV 2 改變圖片的顏色成為灰色

更多顏色的調整, 請在 這裡http://docs.opencv.org/modules/imgproc/doc/miscellaneous_transformations.html



#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/opencv.hpp>
#include <iostream>
#include <string.h>
#include <fstream>

using namespace cv;

int main( int argc, char** argv )

char* imageName = argv[1];

Mat image;
image = imread( imageName, 1 );

if( argc != 2



Screen Shot 2014-11-23 at 1.21.18 PM

 


 



03 改變圖片的顏色

04 顯示攝影機WebCam的畫面


#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <iostream>
#include <string.h>
#include <fstream>

using namespace cv;
int main( int argc, char** argv )

VideoCapture cap(0); //開啟攝影機
if(!cap.isOpened()) return -1; //確認攝影機打開
namedWindow("MyCamera",1); //建立一個視窗,名稱為MyCamera
Mat frame; //用矩陣紀錄抓取的每張frame
for(;;)
cap >> frame; //把取得的影像放置到矩陣中
imshow("MyFrame", frame); //建立一個視窗,顯示frame到camera名稱的視窗
if(waitKey(30) >= 0) break; //按鍵就離開程式

system("PAUSE");
return 0;


Screen Shot 2014-11-23 at 12.03.36 PM



04 顯示攝影機WebCam的畫面

Friday, November 21, 2014

02 顯示圖片


#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <iostream>

using namespace cv;
using namespace std;

int main( int argc, char** argv )

if( argc != 2)

cout <<" Usage: display_image ImageToLoadAndDisplay" << endl;
return -1;


Mat image;
image = imread(argv[1], CV_LOAD_IMAGE_COLOR); // Read the file

if(! image.data ) // Check for invalid input

cout << "Could not open or find the image" << std::endl ;
return -1;


namedWindow( "Display window", WINDOW_AUTOSIZE );// Create a window for display.
imshow( "Display window", image ); // Show our image inside it.

waitKey(0); // Wait for a keystroke in the window
return 0;



02 顯示圖片

01 OpenCV 安裝方法

資料來源: 這裡



01 OpenCV 安裝方法

Thursday, November 20, 2014

使用Unity3D開發大型遊戲的秘訣?

Unity3D是很棒的工具。但分享些柯老師已經建立了幾個小項目的經驗談,,到目前為止整個開發過程中,我們也看到Unity3D 要注意的部分。Unity3D引擎可以做幫助開發,但更多的是一但用開發過程中容易忽視的問題。

所以,我試圖打聽大的開發團隊的項目是如何工作的,


1)源代碼的版本控制

2)分離場景、遊戲和編輯器,盡量把大型遊戲切成越多小塊越好。


但最近花了很多時間看到unity 會議的所有影片,這裡


影片講的很多地方,是在分享他們在用 Unity3D 實際工作的經驗。

開發團隊Scalable 的PPT 投影片在此


資料來源: http://va.lent.in/so-how-do-teams-work-on-a-big-unity3d-project/


Unity tends to crash building a large project. That’s why they split the game into several projects: entry point project, assets projects, code project.

Entry point project is simple, contains minimum stuff to show loading screen or error screen. Loads asset bundles from asset projects and DLLs from code projects.

Content projects got their copy of DLLs, they are used to export assets to bundles and there are external tools to rebuild assets.

There’s no single source file in Unity projects.

That allows to build custom framework, use namespaces, custom compiler preprocessor and obfuscator (if needed).

But there are problems with this approach like some deeply derived from MonoBehavior classes not showing in Unity3D IDE, harder to debug, etc.

#if preprocessor instructions are used to exclude platform specific code.

Custom GUI with relative sizing and positioning of controls. Saved and loaded using ScriptableObjects.

A lot of external data handled by ScriptableObjects which are serializable, editable like Behaviors and not tied to a GameObject.

Unite 11: Postmortem – Smuggle Truck


ONE project to build for all platforms. I think the project is not large, so they don’t see Unity crash much.

There’s a Level Editor which was used by players to create levels which actually shipped with the release.

Asset Settings tool to configure assets importing parameters for every platform. For example, background textures could be half-size in iPhone builds to increase performance.

Platform Specific properties can be configured with special 1. Behaviors attached to objects. For example, you could specify object’s size depending on whether the project is compiled for iOS or PC.

Custom build process allows them to use the data from 3 and 4 to set needed properties and delete unused assets before the actual build. This ensures that assets from PC build will not go to iOS build increasing its size.

At the end of the presentation they advised to have 2 copies of the project for different build targets if you have a lot of assets. Because converting from PC formats to iOS formats takes a lot of time.

Update: recently they released Multiplatform Toolkit to the Asset Store.


Unite 11: Jagged Alliance Online Engineering for Large Web Player Game


Large games have different problems: automatic builds, light map baking which takes 4 days to complete.

Big monolithic project fails to build. (heh, been there done that)

The project is split in SEVERAL small projects: code libraries, asset project(s). This approach allows to share code between client and server. Unity3D .NET project uses 3.5 and can be referenced from 4.0 server code. Asset projects are compiled into assets bundles to be use with code.

Programmers don’t spend an hour a day waiting for assets to be imported.

Code projects are separate Visual Studio solutions kept outside of Unity3D Assets folder. It allows using namespaces (not for MonoBehaviors though). Also they use Unit Tests with modified SharpUnit framework. There are problems with built-in Unity3D classes.

Shared code between code projects and assets projects are separated in yet another project which is referenced by them as DLL libraries.

Separate VS projects are configured to build DLLs into Temp folder not to be loaded by Unity3D and causing names conflict with existing source files.

There’s an advanced automatic build system which executes light map baking and asset bundles exporting in parallel reducing average build time.

Unite 11: Creating a Browser-ready FPS MMO in Unity Slides


Yet again, nobody uses built-in Unity GUI system.

The game looks really cool q:

There’s a custom interface to build asset bundles.

They use ScriptableObjects which are saved to XML and later loaded from server.

Tools for artists is a key to success.

Unite 11: Intro to Editor Scripting, Unite 12: Advanced Editor Scripting, Unite 13: Advanced Editor Scripting — totally must see if you want to create your own editor tools. Describes how to create custom Behaviors inspectors, drawing dummies in 3D scene and even creating custom editor windows.


Unite 11: SHADOWGUN: Rendering Techniques and Optimization Challenges (PDF) — a lot of low-level details if you want to optimize your game for devices.


Conclusion


Now I have time to think what approach to use: single configurable project, many projects with source inside Unity3D Assets folder or many projects with DLLs in the final Unity3D project. At least this time I got the details.

If you want to improve your team workflow with Unity3D you must spend a day watching these videos one by one. There is a lot of interesting details and what to think about. There’s no silver bullet but there is real world experience which speakers gladly share with you.


團結趨於崩潰建設一個大型項目。這就是為什麼他們分開,比賽進入了幾個項目:入口點的項目,資產項目,代碼項目。

切入點的項目很簡單,包含最小的東西,以顯示加載屏幕或錯誤畫面。負荷資產包從代碼項目的資產項目和DLL。

內容項目得到的DLL的拷貝,它們被用於資產導出到束和有外部工具來重建資產。

有沒有在統一的項目沒有一個單一的源文件。

這使得構建定制的框架,使用命名空間,自定義編譯預處理和混淆器(如果需要)。

但也有問題,像一些從MonoBehavior類沒有顯示在Unity3D IDE深深衍生這種方法,難以調試,等等。

#如果預處理器指令來排除特定於平台的代碼。

自定義GUI相對大小和位置的控制。保存並使用ScriptableObjects加載。

很多通過ScriptableObjects這是可序列化的,可編輯樣行為,而不是依賴於一個遊戲對象處理的外部數據。

團結11:死後 – 走私卡車


一個項目建設的所有平台。我覺得這個項目並不大,所以他們沒有看到統一崩潰了。

還有這是用玩家創造,實際上附帶的版本級別關卡編輯器。

資產設置工具來配置資產導入參數為每個平台。例如,背景紋理可以是半角用於iPhone構建以提高性能。

特定於平台的屬性可以附加到對象的特殊1.行為進行配置。例如,您可以指定對象的大小取決於該項目是否被編譯為iOS或PC。

自定義構建過程使他們能夠使用的數據來自3和4的實際建造之前設置所需的屬性和刪除未使用的資產。這保證了從PC構建的資產不會去的iOS版本增加它的大小。

在演講結束時,他們建議有2份該項目針對不同的構建目標的,如果你有很多的資產。因為從PC格式轉換到iOS格式需要花費大量的時間。

更新:最近他們發布了多平台工具包的資源商店。


凝聚11:鐵血聯盟在線工程的大型網絡遊戲玩家


大型遊戲有不同的問題:自動構建,光映射烘焙這需要4天時間才能完成。

整體大項目構建失敗。 (嘿,在那裡做了)

該項目被分成幾個小項目:代碼庫,資產項目(S)。這種方法允許客戶端和服務器之間共享代碼。 Unity3D.NET項目採用3.5和從4.0服務器代碼中被引用。資產項目被編譯成資產包,以與代碼中使用。

程序員不用每天花一個小時等待資產需要進口。

代碼項目Unity3D Assets文件夾之外保持獨立的Visual Studio解決方案。它允許使用名稱空間(不適用於MonoBehaviors雖然)。此外,他們使用單元測試與修改SharpUnit框架。有問題內置Unity3D類。

代碼的項目和資產項目之間共享代碼是分開的卻是他們所引用的DLL庫的另一個項目。

獨立VS項目被配置來構建DLL文件到臨時文件夾不被Unity3D加載,並造成與現有的源文件名衝突。

還有它執行的光照貼圖烘焙及資產包出口平行平均縮短建造時間一項先進的自動生成系統。

凝聚11:創建一個瀏覽器準備的FPS網絡遊戲在Unity幻燈片


再次,沒有人使用內建的統一GUI系統。

遊戲看起來真的很酷問:

有一個自定義的接口來構建資產包。

他們利用其保存到XML和從服務器加載後ScriptableObjects。

工具藝術家是成功的關鍵。

凝聚11:簡介編輯腳本,攜手12:高級編輯器腳本,攜手13:高級編輯器腳本 – 完全必須看到,如果你想創建自己的編輯器工具。介紹如何創建自定義的行為督察,假人繪製三維場景中,甚至創建自定義編輯器窗口。


團結11:SHADOWGUN:渲染技術和優化的挑戰(PDF) – 很多低級別的細節,如果你想優化你的遊戲設備。


結論


現在我有時間去思考方式使用什麼:單一配置的項目,很多項目源裡面Unity3D Assets文件夾或多個項目,最終Unity3D項目的DLL。至少這一次我得到了詳細信息。

如果你想提高你的團隊的工作流程與Unity3D,你必須花一天的時間觀看這些影片一個接一個。有很多有趣的細節,什麼思考的問題。有沒有靈丹妙藥,但有實際經驗的揚聲器很樂意與大家分享。



使用Unity3D開發大型遊戲的秘訣?

Wednesday, November 19, 2014

convert NSMutableData to NSData

-(NSData*)FunTest


NSMutableData *theData = [NSMutableData data];

char bytesToAppend[5] = 0x01, 0xf0, 0x64, 0x0, 0x6a;

[theData appendBytes:bytesToAppend length:sizeof(bytesToAppend)];

[theData appendBytes:bytesToAppend length:sizeof(bytesToAppend)];

NSData *immutableData = [NSData dataWithData:theData];

return immutableData;



convert NSMutableData to NSData

Convert NSString to int Decimal Value ,iOS



-(void)FunTest
NSString* mDataStaring = @"1234";
NSString *subStr =@"";
NSUInteger tlen=mDataStaring.length;
for(int i=0;i<tlen;i=i+2)
subStr = [mDataStaring substringWithRange:NSMakeRange(i, 2)];
int value=[self Fun_ConvertStringToInt:subStr];
NSLog(@"value=%d\n", value);



-(int)Fun_ConvertStringToInt:(NSString*)iDataStaring
NSData* theData=[self bytesStringToData:iDataStaring];

int *values = [theData bytes];
NSUInteger cnt = [theData length];
return values[0];

-(NSData*)bytesStringToData:(NSString*)bytesString



Screen Shot 2014-11-20 at 10.56.00 AM



Convert NSString to int Decimal Value ,iOS

Sunday, November 16, 2014

cocos2d 影片教學

cocos2d 影片教學


  1. cocos2d 1 download

  2. cocos2d 2 download-js 影片

  3. cocos2d 3 download android ndk 軟體 影片

  4. cocos2d 4 cocos2d-x unzip 解壓縮設定 影片

  5. ocos2d 5 download 和下載  python  影片


  6. cocos2d 6 android Setup 設定安卓系統的開發環境 影片


  7. cocos2d 7 android TestAPP 開發安卓應用程式 影片

  8. cocos2d 8 HelloCpp libcocos2dx 設定android 版本的 libcocos2d-x 函示庫 影片

  9. cocos2d 9 setup sh 建立編譯ocos2d-x的環境設定 影片

  10. cocos2d 10 Cygwin download 在Windows 系統中設定linux 編譯環境 影片

  11. cocos2d 11 PathSetup 路徑設定 教學影片

  12. cocos2d 12 CreateMyCocos2dAPP 建立第一個 Cocos2d-X 的程式 教學影片

 


 


 


 


 



cocos2d 影片教學

Cocos2D-X 課後補充資料

課程 source code



Cocos2D-X 課後補充資料

Support for TMX maps Tiled Map

 



Unity 3D


  • Orthello Pro (2D framework) offers Tiled map support.

  • Tiled Tilemaps library by Karnak Games adds support for Orthogonal TMX maps to Unity, with automatic collision detection.

  • Tiled To Unity is a 3D pipeline for Tiled maps. It uses prefabs as tiles, and can place decorations dynamically on tiles. Supports multiple layers (including object layers).

  • Tiled2Unity exports TMX files to Unity with support for (non-simple) collisions.

  • UniTMX imports TMX files into a mesh.

  • X-UniTMX supports almost all Tiled 0.10 features. Imports TMX/XML files into Sprite Objects or Meshes.

 


AndEngine


Android-java


  • AndroidTMXLoader loads TMX data into an object and renders to an Android Bitmap (limited functionality)

  • libtiled-java port is a port of the libtiled-java to be used on Android phones.

C/C++


  • TMXParser General *.tmx tileset data loader. Intended to be used with TSXParser for external tileset loading. (No internal tileset support)

  • TSXParser General *.tsx tileset data loader. Intended to be used with TMXParser.

  • allegro_tiled integrates Tiled support with Allegro 5.

  • TMX XML and JSON map loader with Allegro5 and SDL2 examples (BSD).

C++


D


  • tiledMap.d simple single-layer and single-tileset example to load a map and its tileset in D language. It also contains basic rendering logic using DSFML

cocos2d


Construct 2 – Scirra


  • Construct 2, since the Beta Release 149, officially supports TMX maps, and importing it by simple dragging the file inside the editor. Official Note

Eclipse


Flash/Flixel


Game Maker


Haskell


Haxe


  • HaxePunk Tiled Loader for HaxePunk

  • HaxeFlixel

  • Flambe Tiled support for Flambe

  • OpenFL “openfl-tiled” is a library, which gives OpenFL developers the ability to use the Tiled Map Editor.

  • OpenFL + Tiled + Flixel Experimental glue to use “openfl-tiled” with HaxeFlixel

HTML5


  • Canvas Engine A framework to create video games in HTML5 Canvas

  • chesterGL A simple WebGL/canvas game library

  • KineticJs-Ext A multi-canvas based game rendering library

  • melonJS A lightweight HTML5 game engine

  • Platypus Engine A robust orthogonal tile game engine with game entity library.

  • sprite.js A game framework for image sprites.

  • TMXjs A JavaScript, jQuery and RequireJS-based TMX (Tile Map XML) parser and renderer.

  • chem-tmx Plugin for chem game engine.

  • GameJs JavaScript library for game programming; a thin wrapper to draw on HTML5 canvas and other useful modules for game development

  • Crafty JavaScript HTML5 Game Engine; supports loading Tiled maps through an external component TiledMapBuilder.

  • Phaser A fast, free and fun open source framework supporting both JavaScript and TypeScript.

indielib-crossplatform


Java


LÖVE / Lua


MOAI SDK / Lua


Microsoft XNA/.NET


  • FlatRedBall Engine TMXGlue tool by Domenic Datti loads TMX maps into the FlatRedBall engine, complete with node networks, pathfinding, and shapecollection support via object layers.

  • TiledMax by Aimee Bailey, a .NET library for parsing TMX maps without dependencies on Windows or XNA

  • TMX Map Loader XNA for Windows Phone 7/8 by Lawrence Li. Ready to use, fully implemented XNA Content Pipeline library for TMX files on Windows Phone 7/8.

  • XTiled by Michael C. Neel and Dylan Wolf, XNA library for loading and rendering TMX maps

  • XNA map loader by Kevin Gadd, extended by Stephen Belanger and Zach Musgrave

  • TiledSharp: Yet another C# TMX importer library, with Tiled 0.9.1 support. TiledSharp is a generic parser which can be used in any framework, but it cannot be used to render the maps.

  • TmxCSharp: Useful for multi-layer orthographic tile engines. No framework dependencies, used with a custom OpenTK tile engine soon to be open source, tested with Tiled 0.8.1 (multiple output formats). MIT license.

  • NTiled: Generic parser for 0.9.1 tiled maps. Available via NuGet.

Monkey X


  • bit.tiled Loads TMX file as objects. Aims to be fully compatible with native TMX files.

  • Diddy is an extensive framework for Monkey X that contains a module for loading and rendering TMX files. Supports orthogonal and isometric maps as both CSV and Base64 (uncompressed).

Node.js


PHP


  • PHP TMX Viewer by sebbu : render the map as an image (allow some modifications as well)

Pike


  • TMX parser: a simple loader for TMX maps (CSV format only).

Python/Pygame


  • Pygame map loader by dr0id

  • PyTMX by Leif Theden (bitcraft)

  • pytmxlib: library for programmatic manipulation of TMX maps

  • tmx.py by Richard Jones, from his 2012 PyCon ‘Introduction to Game Development’ talk.

Python/Pyglet


Ruby


SFML


  • STP (SFML TMX Parser) by edoren

Slick2D


Sprite Kit Framework


  • Kobold Kit is a Sprite Kit game engine with a complete TMX object model (create, load & save TMX maps) and an optimized renderer for orthogonal tilemaps. Isometric support forthcoming.

  • JSTileMap is a lightweight SpriteKit implementation of the TMX format supporting iOS 7 and OS X 10.9 and above.

TERRA Engine (Delphi/Pascal)



Vala


  • librpg A library to load and handle spritesets (own format) and orthogonal TMX maps.

 




Support for TMX maps Tiled Map

Tuesday, November 11, 2014

將Android 投射Mirror到 大電視上

如果你有一台蘋果Apple TV 盒子的話,你可能已經聽說過的Airplay功能,它允許您以無線方式反映在顯示器上您的iOS和Mac OS X設備在Apple TV上的。你可以是照片,影片,電影,

方便讓移動設備的內容,顯示到電視的大屏幕,獲得更好的觀看經驗,

但是,如果你持有Android設備呢?現在,如果你有Android 4.4.2,有一個應用程序,可以讓你流和截屏在你的Android顯示,以蘋果電視:MirrorOp Sender


Screen Shot 2014-11-12 at 3.50.03 PM

參考資料 here



將Android 投射Mirror到 大電視上

Compatibility Test Suite

Screen Shot 2014-11-12 at 3.34.54 PM

references: https://source.android.com/compatibility/cts-intro.html#how-does-the-cts-work



Compatibility Test Suite

20 美金的樹苺派

Raspberry Pi基金會於周一(2014/11/10)推出新版本的Model A+單板電腦,,售價為20美元。


Model A+與Model A一樣都是使用時脈為700MHz的BCM2835應用處理器並配備256MB記憶體,但它的長度只有65mm,小於Model A的86mm,同時也消耗更少的電力。它相容於HAT(Hardware Attached on Top)擴充卡標準,具備40pin的輸出/入(GPIO)接腳,內建micro SD插槽,而且整合了更好的音頻電路,重量只有23公克。


目前Raspberry Pi 家族有:

Model A(25美元)

Model B(35美元)

Model B+(35美元)

Model A+。Model A+


目前可以在此購買Model A+Farnell這裡


Model A+於英國製造,將可透過英國的Farnell與美國的MCM等通路購買,外界認為該版本非常適合低耗電的運算應用。


新創業者Kano推出了基於Raspberry Pi的Kano Kit電腦與程式套件,而Mozilla也宣布將打造支援Raspberry Pi的PiFxOS作業系統。


Screen Shot 2014-11-12 at 2.12.29 PM



20 美金的樹苺派

Wednesday, November 5, 2014

【iFrogLab】 的 ios iBeacon展示

展示功能:


  • iFrogLAB 的 Bluetooth BLE 模組成為Apple iBeacon 的能力

  • 並且可以透過 iOS 來發現iFrogLAB iBeacon

  • 偵測距離遠近,可以同時偵測多個iBeacon。

影片展示



功能效果圖


2014-11-04 16.13.25



【iFrogLab】 的 ios iBeacon展示

【iFrogLab】BLE Aluba 硬體模組 藍芽4.0 ,提供賣場商品資訊功能,並能即時下單

【iFrogLab】BLE Aluba 硬體模組 藍芽4.0 ,提供賣場商品資訊功能,並能即時下單


展示功能:


  • iFrogLAB BLE Aluba 模組成為Apple iBeacon 的能力

  • 當用戶手拿iOS走到商場中,當接近商品時,用戶就能即時知道商品資訊

  • 並且可以即時下單和購買

  • 有後台管理平台,商品資訊、金流、購買運送等機制

範例程式


完整的iOS 範例程式,請在購買後,主動跟服務人員索取。


影片展示



功能效果圖


2014-11-06 11.42.03


2014-11-06 11.42.47


2014-11-06 11.42.38


2014-11-06 11.42.25



【iFrogLab】BLE Aluba 硬體模組 藍芽4.0 ,提供賣場商品資訊功能,並能即時下單

車子都可以用3D 印表機生產

在今年2014/9月 芝加哥國際車展 International Manufacturing Technology Show 2014 (ITMS)

展示了用3D 印表機生產的一台車子,一台花了44小時,就可以生產
Screen Shot 2014-11-06 at 10.28.27 AM


Screen Shot 2014-11-06 at 10.28.18 AM


Screen Shot 2014-11-06 at 10.28.08 AM


Screen Shot 2014-11-06 at 10.28.02 AM

資料來源 這裡



車子都可以用3D 印表機生產

Tuesday, November 4, 2014

簡易3D 設計工具


mxd3d


  • 網址:http://marketplace.mxd3d.com/

  • 簡易程度: 最容易

  • 費用:免費

  • 安裝:網頁免安裝

Screen Shot 2014-11-05 at 1.10.05 PM



01如何使用ios與藍芽4.0 BLE (iFrogLAB iBeacon ) 做iBeacon

iFrogLAB iBeacon 方案與ios原始程式碼 正式版1.0 release


本範例展示:


  • iFrogLAB 的 Bluetooth BLE 模組成為Apple iBeacon 的能力

  • 並且可以透過 iOS 來發現iFrogLAB iBeacon

  • 偵測距離遠近,可以同時偵測多個iBeacon。

iOS 範例程式與原始程式


  • iOS 範例程式與遠使程式碼可以在此下載

購買硬體


  • 可以直接留言,我們的客服人員會馬上跟您接洽

  • 或到我們的線上購物商城 馬上購買

影片展示



功能效果圖


2014-11-04 16.13.25



01如何使用ios與藍芽4.0 BLE (iFrogLAB iBeacon ) 做iBeacon

Sunday, November 2, 2014

柯博文雜貨店

在「Arduino 互動設計專題與實戰,深入Arduino 的全方位指南」 和 「Raspberry Pi 最佳入門與實戰應用 -深入Raspberry Pi 的全方面的指南」的書上市後,接到很多讀者都詢問書中的設備和零件可以在那邊購買的到,所以為了方便讀者,就建立了「柯博文雜貨店」的線上購物的網站,方便以後書和文章如果提到的設備時,各位就可以在此購買取得。


Screen Shot 2014-11-02 at 11.16.50 PM



柯博文雜貨店

1.1Cocos2D-X 介紹


現在到處都看到3C電子產品,圍繞在你的週邊,不管是AndroidiOS是當今智慧型終端的兩大主流平台,還是而網頁、部落格、Facebook的網路,還是在電視機上面玩的 XBox 360, Wii, PS3的次世代遊樂器主機,


如果注意過每個人手上的APP幾乎,都是遊戲居多,也因此您可以看到各大公司已經透過Cocos2d-x 開發出多款受玩家歡迎的遊戲,也期待各位能在新的移動設備遊戲趨勢潮流下,霸佔玩家的荷包。


1-11-1Screen Shot 2014-11-02 at 11.08.09 PM


1-1 cocos2d-x 首頁


1.2Cocos2D-X 特色


Cocos2d-x這幾年快速的崛起,這是因為Cocos2d-x強大的設計能力能讓開發者,在短時間之內把想法,具體轉變成遊戲的開發函示庫,只要透過同一個開發程式,就可以將2D遊戲發設計出來。目前ocos2d家族分成二大類。


1.Cocos2d-x:


用來撰寫Android,IOS,BlackBerry,Bada,Marmalade,Windows,Linux方面的程式,大部分的開發者都專注在AndroidIOS,使用語言為C++,可跨平台,也就是說只要寫一套程式碼就能發佈到google playapp store販賣,免費且開源,使用類別簡單,你只要掌握4個基本類別就能寫出自己的遊戲


Cocos2d-x可以同時在多個平台上:


  • Microsoft WindowsLinux MAC OS X的上面都可以執行。

  • 可執行在蘋果 iPhone / iPad 和 谷歌Android

Screen Shot 2014-11-02 at 11.08.16 PM


1-2 Cocos2d-x完成之後可以發布的平台


2. Cocos2d-js:


Cocos2d-x 的另一個分支Cocos2d-js ,目標是透過Javascript 在網頁上執行,


主要用來撰寫桌上瀏覽器(網頁)的程式,使用語言為javascript,免費且開源。


Cocos2d-js可以同時在多個平台上的網頁執行:


  • WindowsLinux 和、MAC OS X的作業系統平台上的網頁執行。

  • 蘋果 iPhone / iPad 、谷歌Android 的作業系統上的網頁執行。

Screen Shot 2014-11-02 at 11.08.18 PM


1-3Cocos2d-js完成之後可以發布的網頁



下載和安裝Cocos studio

如果你要下載Cocos studio ,請到官方網站http://cocostudio.org/download.html 上,就可以免費下載。


Screen Shot 2014-11-02 at 10.36.32 PM


 


 


點選你要的版本後,就可以下載。


順利下載後,請點該檔案就夠進行安裝。


Screen Shot 2014-11-02 at 10.43.35 PM


請點選 installer.app後,就可會出現Cocos Studio 安裝視窗,請點選install 進行安裝。


Screen Shot 2014-11-02 at 10.45.04 PM


等待整個安裝完畢後,就會出現如下圖所示。


Screen Shot 2014-11-02 at 10.46.54 PM


完成後,請點選complete 按鈕。並且在Applications\Cocos 的路徑中,就會看到Cocos Studio 2.app 的執行程式。


 


Screen Shot 2014-11-02 at 10.56.16 PM



下載和安裝Cocos studio

Saturday, November 1, 2014

台灣樹苺派社群 RaspberryPiTW

台灣樹苺派社群RaspberryPiTW 臉書討論區 開張 這裡

樹苺派的研究、分享與討論的社群,歡迎加入



台灣樹苺派社群 RaspberryPiTW

Wednesday, October 29, 2014

討論區


討論區

模組產商洗排的新機會Google Ara Modular

Google 在2014/10/29 發佈了一個傳說中的專案- Ara Modular ,讓用戶可以依照自己的喜好來決定手機的上面硬體,也就是以後買手機就像是自助餐一樣,可以自行挑配菜了。


Screen Shot 2014-10-30 at 9.06.10 AM


詳細的資料,需要等到2015年1月的時候Googlw Ara Developer 大會時,會發佈詳細的資料。 參考資料在此


看來這一波機會,會讓很多模組廠商也能依照Ara 的規範,成為Android 的一員。



模組產商洗排的新機會Google Ara Modular

Tuesday, October 28, 2014

Beaglebone Black是Beagleboard系列最新的成員。這片精巧的開放源碼開發板搭載了1GHz時脈的德州儀器  Sitara AM3358 ARM Cortex-A8 processor、512M DDR3記憶體,並內建4G Flash,預載為Beaglebone Black量身打造的Linux Angstrom,

可以在Beaglebone Black上運行熱門的Android、Ubuntu或其他相容的Linux環境。


並且是目前對學習Android移植、Android 底層修改最友善、資料公布程度最好的版子,並且實際產品可以


Screen Shot 2014-10-29 at 11.15.14 AM

官方網站:

PDF 這裡



Sunday, October 12, 2014

Android NDK的處理方法經驗談

隨著Android NDK 提供許多的新設備和新功能,並且針對了 ARM的設備提供了效能上的改進,在此列出開發的經驗談,希望對您有所幫助。


不要急的轉換為C語言

除非您計劃移植現有的C++應用程序或計畫開發全新的跨平台的APP,否則不要倉促在初期,急的把專案寫成C語言,建議是先在JAVA 把專案完成,並把效能較慢的函數,獨立出來一個測試的APP,再把該功能用C語言來處理,記得!請用數據來代替猜測,請用把執行的時間,用Log 記錄下來,調整再調整,改善執行的效率。


關注目標

一般的設備都是使用ARMv7,這意思是可以使用ARM 的 v7版本和功能。再最新版的NDK 10b增加了ARMv7和NEON程式範例支持,可以實現關鍵程式和多媒體的功能都有對應的組合語言指定集 。並且 NDK也提供跨不同CPU 的處理方法,可以在編輯程式或執行時,可以識別執行的CPU。


調整問題點

請用工具或時間函數來分析程式,一個一個函數處理和優化程式,不要一口氣大改,或者重新開發,只要把有問題的JAVA 程式翻寫為C 語言,就可以讓用戶在沒有感覺的情況下,加強執行效率。


使用Java的異常處理

開發時難免都會有bug, 在開發NDK時,請多多使用Java 的try… catch ,即時在裡面呼叫C語言時,萬一有問題時,頂多退回到Java 層做例外處理,也不會導致APP 被強制退出。


優化架構

事實上Eclipse 的JAVA 除錯環境真的太好了,而NDK 的C語言環境在除錯和測試上,目前還沒有好的工具。所以架構、UI使用者介面等大方向的部分,還請在Java層面優化和處理。


記憶體分配要小心

Java的記憶體盡用Java來分配,而C語言的盡用C來分配,減少互相分享記憶體、和記憶體指向的分配,以免有leak 記憶體洩漏或指針的位置錯誤的情況發生。


謹慎採用多線程

在開發初期,請謹慎採用多線程,以免因為造成除錯和開發的困難度,當然在開發測試的後期,將程式改成多線程,可以在多核心的CPU上會有更棒的執行效果。但切記,多線程會加重系統負載,Android系統自身會創建幾條線程去運行一個應用程序,如果都在等待事件的觸發事件的執行線程,會削弱它們的運行能力,適得其反地降低整體用戶體驗。


Java層的線程


如果將邏輯分為多個線程,應盡可能通過Java執行,而不要採用Pthreads。使用Java VM管理訪問可以降低風險,且有更多的語言層工具。如果您擔心設置成本,採用現有的小型工人池應該不會太困難。切記將長期任務的更新發回到主UI線程,以確保用戶使用反應和用戶體驗。


懂得何時使用彙編程序


C或C++可以立即帶來速度提升,但是卻比Java要難以維護,可以通過將程式中的關鍵部分轉換為翻寫彙程式來實現進一步提升,但卻需要耗費時間、精力與最終受益之間做出決定,最好先發布現在的Java 版本,然後以後發布升級版,而不是永無休止的修改,這樣陷入程式正式發佈版的問題。


懂得如何使用NEON

NEON是一個非常強大的工具,在理想環境中​​,可給程式8倍的性能提升,但只適合給ARMv7 。


不排次使用ARM 組合語言

ARM 組合語言的指令集眾多,上手不容易,但是如果是APP中會有大量的數學計算,如遊戲模型的顯示、影像處理或多媒體等,這類會在一個迴圈中一直計算的程式的話,就很建議把其中的運算公式,寫成ARM 組合語言,效能會出乎想像中的好。



Android NDK的處理方法經驗談

什麼是Android NDK

什麼是Android NDK:

Android NDK (Native Development Kit)簡化工作與機器底層的程式碼。並且可以與CPU(ARM)和繪圖晶片做溝通。它的目的是幫助您創建的Lib,你可以把它想成是Android C 的函式庫Lib。


大多數的開發者都是使用Android SDK來設計應用程式,它是一個以JAVA 為基礎的程式語言,但是在開發大型專案和較複雜的應用程式時,會因為JAVA的速度或者與系統底層溝通的因素,會遇到很多問題。


 





























1 Android SDK Android NDK 的比較


 


如果要邁向頂尖的Android 開發者,很多時候是需要使用C語言來開發,尤其是Android系統底層的功能,真的很難用JAVA 寫的出來,所以要對整個Android系統深度了解,還是需要C 語言。



什麼是Android NDK
比較項目Android SDKAndroid NDK
程式語言JAVAC
執行速度
與底層Linux 溝通 如 lsmkdir Linux 指令沒有相對的API
直接呼叫linux driver沒有直接的API,需要透過HAL 的寫法,較為複雜
Users Interfae 使用者操作介面需要依賴SDK
GPS, 撥號, 地圖需要依賴SDK
跨平台開發只有在Android 平台上可以跨平台AndroidiOS
Windows Phone
開發環境Eclipse 開發環境無,需透過指令 Terminal

Wednesday, October 1, 2014



src="javascript:void(0)"

scrolling="no"

frameborder="0"

width="900"

height="700">



Tuesday, September 23, 2014

LG 手錶的的規格

Screen Shot 2014-09-24 at 10.26.55


  1. Microphone麥克風

  2. Reset Button 重置按鈕

  3. Charging Terminal 充電端

  4. Band 錶帶

  5. Buckle錶扣

LG 手錶


qualcomm 公司的 Snapdragon 400 quad-core 處理器  787MHz


Adreno 305 GPU 顯示晶片


512MB RAM 記憶體


Snapdragon 400 的規格


































CPUUp to 1.7 GHz dual-core Krait 300 CPU or up to 1.4GHz quad-core ARM® Cortex™ A7 CPU
GPUUp to Qualcomm® Adreno™ 306 GPU
DSPHexagon™ V40 or V50 DSP (up to 600MHz)
ModemIntegrated 4G LTE Advanced World Mode, supporting LTE FDD, LTE TDD, WCDMA (DC-HSPA+), CDMA1x, EV-DO Rev. B, TD-SCDMA and GSM/EDGECAT4 speeds of up to 150 Mbps

3rd Generation integrated LTE modem, with support for LTE-Broadcast and LTE multimode dual-SIM (DSDS and DSDA)”

RF3rd gen power efficient LTE multimode transceiver with Qualcomm RF360™ Front End solution for world mode bands, lower power and PCB reduction
USBUSB 2.0
BluetoothBT4.0 † Integrated digital core
WiFiQualcomm® VIVE™ 802.11n/ac† Integrated digital core
GPSQualcomm® IZat™ Gen8A
NFCSupported1
Video/Audio1080p HD video playback and capture with H.264 (AVC)720p playback with H.265 (HEVC)1

DASH is supported

CameraUp to 13.5MP
Display24-bit WXGA (1280×800) + 1080p external display1
Quick ChargeQualcomm® Quick Charge™ 2.0 technologyPM8x26

Chipset SW


Voltage In = 9V, 1.5A out

Memory/StorageLPDDR2/3 533MHz Single-channel 32-bit (4.2GBps)/eMMC 4.51 SD 3.0 (UHS-I)
Process Technology28nm LP

官方文件 這裡




LG 手錶的的規格

Google 手錶原始程式公開,並提供下載

Google Wear a4.4w_r1原始程式提供下載,可以在此取得


  • android-4.4w_r1這裡

  • android-msm-dory-3.10-kitkat-wear 下載

 


 


 


 


 


 


 


 


Screen Shot 2014-09-24 at 10.11.07


 


 


Screen Shot 2014-09-24 at 10.16.30



Google 手錶原始程式公開,並提供下載

新竹工研院 , 物聯網與穿戴裝置技術、趨勢研討會 (簡報下載)

感謝各位參與103年9月23日在 工研院 , 物聯網與穿戴裝置技術、趨勢研討會,

因與會人士希望能我能提供當時的簡報資料, 請在此下載
簡報1
簡報2



新竹工研院 , 物聯網與穿戴裝置技術、趨勢研討會 (簡報下載)

Sunday, September 21, 2014

柯博文老师的新书(简体版)- Android 手机/平板电脑开发新挑战。

柯博文老師的新書(简体版)–Android 手机/平板电脑开发新挑战


download


 


 


 


 



柯博文老师的新书(简体版)- Android 手机/平板电脑开发新挑战。

Monday, September 15, 2014

柯博文老師的新書(9月底上市)- Raspberry Pi 最佳入門與實戰應用 -深入Raspberry Pi 的全方面的指南。

 


 


 



Raspberry Pi 最佳入門與實戰應用

-深入Raspberry Pi 的全方面的指南。




  • 作者: 柯博文

  • 出版社:碁峰資訊

  • 出版日期:2014-09-25

  • 語言:繁體中文

  • ISBN: ?

  • 定價:?元

  • 博客來: ? 元

  • 益大資訊: ? 元


Screen Shot 2014-09-15 at 11.01.50





 


Chapter 01 認識 Raspberry Pi









1.1 什麼是 Raspberry Pi?………………………………………………………… 1-2




1.2 Raspberry Pi可以用在什麼地方?…………………………………………..1-6


1.3 Raspberry Pi應用實例…………………………………………………………1-6


 













Chapter 02 準備作業系統和開機 SD 卡

2.1 作業系統 .................................................................................... 2-2


2.2 下載 Raspberry Pi 的作業系統 ............................................ 2-7


2.3 映像檔解壓縮 .................................................................. 2-8


2.4 準備啟動用的 SD 卡 ......................................................... 2-8


2.5 格式化 SD 卡 ................................................................. 2-10


2.6 下載 Win32DiskImager 軟體............................................ 2-11


2.7 在 PC 把資料寫入 SD 卡 .................................................. 2-13


2.8 在 PC 把 SD 卡備份成 img 檔案 ....................................... 2-15


2.9 在 Mac 把資料寫入 SD 卡................................................ 2-16


2.10 在 Mac 把 SD 卡備份成 img 檔案 ..................................... 2-18


 


 





Chapter 03 相關設定


 





3.1 打開電源開機 ............................................................................. 3-2






  3.1.1 Raspberry Pi 無法看到畫面,但是有看到 LED 燈光的閃爍 (調整螢幕顯示模式)....................................................... 3-3


3.1.2 連一個 LED 燈光都沒有閃爍,也沒有動靜 .......................... 3-6


3.1.3 LED 燈光只有亮幾個,但螢幕沒有動靜............................... 3-6





  3.1.4 常見問題- SD卡不相容....................................................3-7





3.2設定 Raspberry Pi ........................................................................3-7




  3.1.4 常見問題- SD卡不相容....................................................3-7


3.2.1  改變鍵盤.........................................................................3-8


3.2.2  改變語系.......................................................................3-11


3.2.3  其他設定:時間、啟動程式設定、啟動照相機、CPU 超頻 .. 3-12


3.2.4  關機 ............................................................................. 3-13


3.2.5  更新 Raspberry Pi 的 Firmware 版本 .................................. 3-14


3.2.6  更新 SD 卡的容量........................................................... 3-14


3.2.7  進階的設定.................................................................... 3-15


3.3 Raspberry Pi的網路設定.............................................................3-16


3.3.1  取得 Raspberry Pi 網路位置 IP .......................................... 3-16


3.3.2  如何將 Raspberry Pi 設定固定網路位置 IP .......................... 3-17


3.3.3  在 Raspberry Pi 設定無線網路卡.......................................3-18


3.4 使用 SSH 遠端控制 Raspberry Pi .................................................. 3-20


3.4.1  在 Raspberry Pi 架設 SSH ............................................... 3-20


3.4.2  在 PC、Mac 和 Linux 使用 SSH 遠端控制 Raspberry Pi ......... 3-23


3.4.3  在 iOS 遠端控制 Raspberry Pi ......................................... 3-24


3.4.4  在 Android 遠端控制 Raspberry Pi ..................................... 3-24


3.4.5  Windows PC 上使用 putty 遠端連線 .................................. 3-26


3.4.6  Windows 軟體 WinSCP 檔案管理上傳和下載...................... 3-28


3.4.7  常見問題解決方案:出現Warning:RemoteHostIdentification Has Changed error and solution ......................................3-30


3.5 VNC 遠端控制程式架設 ............................................................. 3-31


3.5.1  架設VNC server.............................................................3-31


3.5.2  VNC Viewer...................................................................3-34


3.5.3Raspberry Pi常見問題................................................................3-37


3.6.1  Raspberry Pi 如何關機? ................................................... 3-37


3.6.2  自製電源供應器插座....................................................... 3-38


Chapter 04 圖形介面


4.1 Raspbian 桌面圖形作業系統 .........................................................4-2


4.2 Raspbian 的應用程式 - Accessories ................................................4-3


4.3  Raspbian 的應用程式 - Education 教育........................................... 4-8


4.4  Raspbian 的應用程式 - Graphics 繪圖 .......................................... 4-12


4.5  Raspbian 的應用程式 - Internet 網路 ............................................ 4-13


4.6  Raspbian 的應用程式 - Other 其他 .............................................. 4-20


4.7  Raspbian 的應用程式 - Programming 程式開發 ............................. 4-21


4.8  Raspbian 的應用程式 - Sound & Video 聲音與影像 ........................ 4-22


4.9  Raspbian 的應用程式 - System Tools 系統工具 .............................. 4-23


4.10  Raspbian 的應用程式 - Preferences 設定....................................... 4-24


4.11  Raspbian 的應用程式 - Run 和 Logout .......................................... 4-29


4.12  Raspbian 的應用程式 – 筆者推薦 ................................................ 4-30


4.12.1 Chromium.....................................................................4-30


4.12.2 Adobe Flash Player - Gnash ............................................ 4-32


4.13  The Pi Store 線上商店系統 - 推薦軟體.......................................... 4-34


4.13.1 LibreOffice-文書處理軟體.............................................4-35


4.13.2 Freeciv-遊戲................................................................4-36


4.13.3 VirtualHere-檔案分享....................................................4-36


4.13.4 GrafX2-繪圖軟體.........................................................4-37


Chapter05 Linux命令列環境與操作


5.1 檔案和路徑 ................................................................................ 5-2

5.1.1 ls - 檔案複製 ................................................................... 5-2

5.1.2 cd - 移動路徑 .................................................................. 5-4

5.1.3 mkdir - 建立目錄.............................................................. 5-5

5.1.4 cp - 檔案複製 .................................................................. 5-6

5.1.5 rm - 檔案刪除.................................................................. 5-8

5.1.6 rmdir - 刪除文件夾........................................................... 5-9

5.1.7 mv - 檔案或路徑的搬移 .................................................. 5-11

5.1.8 find - 找檔案 ................................................................. 5-12

5.1.9 df - 查看硬碟空間 .......................................................... 5-14

5.2 系統管理.................................................................................. 5-15

5.2.1 sudo 和 su 超級管理者 .................................................... 5-15

5.2.2 passwd - 修改密碼 ......................................................... 5-16

5.2.3 adduser - 建立新的登入帳號 ........................................... 5-17

5.2.4 clear - 畫面清空............................................................. 5-18

5.2.5 halt、shutdown - 關機 .................................................... 5-19

5.2.6 ps系統中的程式和Service...............................................5-20

5.2.7 Kill - 刪除系統中的程式 .................................................. 5-21

5.2.8 userdel - 刪除使用者 ...................................................... 5-21

5.3 網路管理 .................................................................................. 5-23

5.3.1 ifconfig - 網路情況 ......................................................... 5-23

5.3.2 ping - 了解現在網路連線的情況.......................................5-24

5.4 檔案壓縮 .................................................................................. 5-25

5.4.1 tar 壓縮 targz ................................................................. 5-25

5.4.2 gzip壓縮.......................................................................5-27

5.5 Linux 檔案結構 ..........................................................................

5-28 5.5.1 /proc 下的檔案結構 ........................................................ 5-28


Chapter 06 架設網站伺服器


6.1 建立 Web Server 網站 ..................................................................6-2

6.2 建立 MySQL 資料庫伺服器 ...........................................................6-9

6.3 建立 FTP 伺服器 ........................................................................ 6-13


Chapter 07 電路設計

7.1 硬體 ..........................................................................................7-2

7.2 歷史 ..........................................................................................7-2

7.3 Raspberry Pi 的 GPIO ...................................................................7-3

7.4 Raspberry Pi 的 DSI Display ...........................................................7-6

7.5 Raspberry Pi 的 MIPI Camera Serial Interface 2 (CSI-2) .....................7-7

7.6 Raspberry Pi 的 P2 是 Broadcom SoC JTAG header ........................7-8

7.7 Raspberry Pi 的 P3 是 LAN9512 LAN/USB-HUB 晶片 JTAG header .....7-9


Chapter 08 使用 Python


8.1Python 程式語言的介紹 ................................................................ 8-2

8.1.1 安裝 Python 程式語言 ....................................................... 8-2

8.1.2 執行 Python 程式語言 ....................................................... 8-3

8.2 Python 程式語言教學 ................................................................... 8-5

8.2.1 Python 資料型態............................................................... 8-5

8.2.2 Python 數學計算............................................................... 8-7

8.2.3 Array 陣列 ....................................................................... 8-8

8.2.4 If...else 條件判斷語句 ..................................................... 8-10

8.2.5 range 範圍 .................................................................... 8-13

8.2.6 for 迴圈 ........................................................................ 8-14

8.2.7 while 迴圈語法............................................................... 8-19

8.2.8 def 函數 ........................................................................ 8-21

8.3 Raspberry Pi 的 GPIO 數位輸出、輸入 ......................................... 8-23

8.3.1 安裝 Python GPIO 的模組................................................ 8-23

8.3.2 第一個 Python GPIO 的程式 ............................................ 8-27

8.3.3 Python GPIO 的數位輸出 ................................................ 8-34

8.3.4 Python GPIO 數位讀取.................................................... 8-36

8.3.5 Python GPIO 數位邊緣觸發 ............................................. 8-39

8.4 Raspberry Pi 的 GPIO PWM 輸出 ................................................. 8-45

8.4.1 PWM Output ................................................................. 8-46

8.4.2 PWM 實戰 ..................................................................... 8-49

8.5 Raspberry Pi 的 GPIO Analog 類比輸出 ........................................ 8-52

8.5.1 Raspberry Pi 的 GPIO Analog 輸出 ................................... 8-52

8.5.2 Raspberry Pi 的 GPIO Analog 輸入 ................................... 8-57

8.6 Raspberry Pi 的 GPIO UART 序列埠資料傳遞................................. 8-67

8.6.1 Raspberry Pi 與 Windows PC 上序列埠做資料傳遞 .............. 8-67

8.6.2 TTY .............................................................................. 8-76

8.6.3 透過 Python 來傳遞 UART 序列資料 .................................. 8-79

8.6.4 UART 資料傳遞軟體 - Install minicom 安裝測試 ................. 8-83

8.7 Raspberry Pi 的 GPIO SPI............................................................ 8-87

8.7.1 SPI 設定 ........................................................................ 8-88

8.7.2 SPI 安裝 Python 模組 ....................................................... 8-89


Chapter 09 透過網路控制 GPIO (物聯網智慧城市運用基礎)

9.1 實戰 - 遠端居家安全控制 ............................................................. 9-2

9-2 網頁呼叫 Linux 指令.....................................................................9-4

9.3 Python 執行時帶參數....................................................................9-7

9.4 透過 PHP 呼叫 Python 的 CGI ...................................................... 9-10

9.5 透過網頁呼叫 Raspberry Pi 的 GPIO ............................................. 9-13


Chapter 10 使用 Scratch

10.1 在 Raspberry Pi 執行 Scratch........................................................ 10-2 Scratch控制10.2 Raspberry Pi GPIO...................................................10-5 開機時自動執行Scratch的遊戲(架設10.3 Scratch遊樂器主機)........10-12


Chapter 11 Raspberry Pi 上使用 Java、Shell Script 語言和連接 PC

11.1 Shell Script介紹........................................................................11-2

11.1.1 使用 File System 來控制 GPIO ......................................... 11-4

11.1.2 寫成Shell Script.............................................................11-9

11.2 Java 與 Arduino 互動 ............................................................... 11-12

11.2.1 在 Raspberry Pi 安裝和使用 Java..................................... 11-13

11.3 在 Raspberry Pi安裝和使用 Java Eclipse.....................................11-15

11.4 Java 語言控制 Raspberry 的 GPIO ............................................. 11-23

11.4.1 Java語言控制Raspberry的GPIO輸入輸出....................11-26

11.4.2 Java控制Raspberry的GPIOSerial序列埠資料傳遞.........11-34

11.5 PC電腦與Raspberry Pi互傳資料...............................................11-41


Chapter 10 使用 Scratch




Chapter 12 與 Arduino 結合

12.1 什麼是Arduino?......................................................................12-2

12.2 Arduino 讀取光敏電阻................................................................ 12-6

12.3 實戰 Raspberry Pi 與 Arduino 合作,透過 GPIO RX/TX 取得感應器

資料 ...................................................................................... 12-15

12.4 Raspberry Pi 透過 USB 讀取周邊設備資料,以 Arduino 為例.......... 12-18


Chapter 13 Raspberry Pi 實戰應用

13.1 架設網路檔案伺服器.................................................................13-2

13.2 架設網路攝影機......................................................................13-14

13.3 架設網路收音機......................................................................13-22

13.4 可選台的網路收音機 ............................................................... 13-25

13.5 mp3 播放器 ............................................................................ 13-31

13.6 UPnP 和 DLNA ........................................................................ 13-36

13.7 iOS 專用的 Airplay 播放器 ........................................................ 13-44

13.8 Raspberry 照相機和定時拍照 .................................................... 13-51

13.9 Raspberry DropBox .................................................................. 13-58


Chapter 14 補充資訊

14.1 不錯的 Raspberry Pi 的網站介紹.................................................. 14-2

14.2 本書秘技 - Raspberry Pi 的技巧 ................................................... 14-2

14.2.1 安裝空間不足(No space left on device 方法一).............. 14-2

14.2.2 使用整張 SD 卡空間 (No space left on device 方法二) .... 14-4


Appdendix A Raspberry Pi 圖形化開發工具- Wyliodrin


....


 


 





 


 


 


 


 


 




















柯博文老師的新書(9月底上市)- Raspberry Pi 最佳入門與實戰應用 -深入Raspberry Pi 的全方面的指南。