AeroGear 在 Windows 10 方面的新特性
Windows 10 ***個(gè)預(yù)覽版已經(jīng)發(fā)布很長(zhǎng)時(shí)間了,而且也很快發(fā)布最終版本(29 July)。AeroGear 開(kāi)發(fā)可以關(guān)注一下***的一些改進(jìn),其中***的改進(jìn)是不再需要 2 個(gè)不同的二進(jìn)制包,同樣的代碼可以在 Windows 桌面,平板和手機(jī)上運(yùn)行(甚至是 Xbox)。這意味著如果你想遷移你的應(yīng)用,或者你有 `#if`狀態(tài),你需要修改他們,運(yùn)行下面代碼檢測(cè):
- using Windows.Foundation.Metadata;
- // you used to have
- #if WINDOWS_PHONE_APP
- // something for hardware buttons
- #endif
- // now you can use Metadata to make it a runtime check
- if (ApiInformation.IsTypePresent("Windows.Phone.UI.Input.HardwareButtons"))
- {
- HardwareButtons.BackButtonPressed += BackButtonHandler;
- }
runtime-check.cs hosted with ❤ by GitHub
想要使用 Mobile specific API 你需要添加 Mobile Extension SDK:
這不是說(shuō)你的應(yīng)用不能在桌面運(yùn)行,所以你需要運(yùn)行上面的測(cè)試,你也可以選擇繼續(xù)只在手機(jī)上運(yùn)行。
Visual Studio 2015 還不能自動(dòng)處理這些,這里提供一個(gè)強(qiáng)大的 shell script,可以把很多事情自動(dòng)化處理。
還有一個(gè) Windows 10 方面的新特性是 'metro' 應(yīng)用不再默認(rèn)全屏幕啟動(dòng)。
更多 Windows 10 方面的新特性請(qǐng)看這里。