2012年12月18日 星期二
2012年12月16日 星期日
test
#include <iostream>
#include <string>
using namespace std;
string GetName()
{
string FirstName, LastName, FN;
cout << "Employee's First Name: ";
cin >> FirstName;
cout << "Employee's Last Name: ";
cin >> LastName;
FN = FirstName + " " + LastName;
return FN;
}
int main()
{
string FullName;
double Hours;
double GetHours(string FullName);
FullName = GetName();
Hours = GetHours(FullName);
cout << "\nEmployee's Name: " << FullName;
cout << "\nWeekly Hours: " << Hours << " hours\n\n";
return 0;
}
double GetHours(string FullName)
{
double Mon, Tue, Wed, Thu, Fri, TotalHours;
cout << endl << FullName << "'s Weekly Hours\n";
cout << "Monday: ";
cin >> Mon;
cout << "Tuesday: ";
cin >> Tue;
cout << "Wednesday: ";
cin >> Wed;
cout << "Thursday: ";
cin >> Thu;
cout << "Friday: ";
cin >> Fri;
TotalHours = Mon + Tue + Wed + Thu + Fri;
return TotalHours;
}
2012年12月14日 星期五
2012年12月13日 星期四
Adobe AIR Native Extension (iOS)
Requirements
- Adobe AIR SDK 裡面的FlashRuntimeExtensions.jar (TODO)
- Xcode
- Xcode Template For Easily Creating iOS Adobe Air Native Extensions (ANE)
Reference (TODO)
Samples
- Native extensions for Adobe AIR(Offical)
- Native extensions for Adobe AIR(Un-Offical)
- Free AIR Native Extensions Collection
Step By Step(TODO)
Step By Step
01. 建立Cocoa Touch Static Library
02. 移除自動建立的.h檔
03. 將FlashRuntimeExtensions.h拷貝至.m檔相同目錄
04. 在.m檔中加入 #import "FlashRuntimeExtensions.h"
05. 根據FREFunction 函式定義, 實作FREFunction
06. 根據FREContextInitializer函式定義, 實作FREContextInitializer (mapping FREFunction)
07. 根據FREContextFinalizer 函式定義, 實作FREContextFinalizer
08. 根據FREInitializer 函式定義, 實作FREInitializer (mapping FREContextInitializer & FREContextFinalizer)
09. 根據FREFinalizer 函式定義, 實作FREFinalizer
10. Generating the compiled library(http://www.adobe.com/devnet/air/articles/building-ane-ios-android-pt3.html)
Debug(TODO)
Adobe AIR Native Extension (Android)
Requirements
- Adobe AIR SDK 裡面的FlashRuntimeExtensions.jar
- Eclipse for Android development
Reference
- Native Extension Android Java API Reference
- AS3 與 Java之間函式呼叫的參數傳遞與回傳值
- 存取ActionScript objects需要注意的事項
- 從Java通知AS3某事件發生(完成)
- Native Extension Thread Issue
- Coding the native side with Java
Samples
- Native extensions for Adobe AIR(Offical)
- Native extensions for Adobe AIR(Un-Offical)
- Free AIR Native Extensions Collection
Step By Step
1. 建立Android Library Project
2. 加入FlashRuntimeExtensions.jar
3. 建立對應Package
4. 實作FREFunction介面
5. 繼承FREContext類別
6. 將所有實作FREFunction介面的類別在 step 5 建立的類別中的 getFunctions 建立對應的Dictionary
7. 實作FREExtension介面, 並在createContext中回傳step5建立的類別
8. 打包成JAR
Debug
Adobe AIR native extension
API Reference
API 分析
java
Develop Native Extension for Android
1. create android library Project
2. add FlashRuntimeExtensions.jar into this project
3. create corresponding package
4. implementing the FREExtension interface
- extending the FREContext class
- implementing the FREFunction interface which you want to control