能否用PhoneGap开发Windows 10 UWP应用?求相关资料及案例
Absolutely! You can definitely build Windows 10 UWP apps using PhoneGap (which is now closely tied to Apache Cordova, following Adobe's donation of the project to the Apache Foundation). Let’s cover your questions in detail:
Is PhoneGap compatible with UWP development?
Yes, 100%. PhoneGap is built on top of Apache Cordova, and Cordova officially supports the Windows platform—which includes Windows 10 UWP as a target. When you add the Windows platform to a PhoneGap/Cordova project, you can configure it to build UWP packages that run on Windows 10 desktops, tablets, and even Xbox devices.
Where to find relevant documentation?
Here are key resources to get started:
- Apache Cordova UWP Platform Guide: This is the primary source for setup, configuration, and best practices. It covers everything from installing required tools (like Visual Studio for UWP building) to adding platform-specific plugins and compiling your app into a UWP package.
- PhoneGap Legacy Documentation: While most active development now happens under Cordova, older PhoneGap guides for Windows development still apply—they’ll walk you through using PhoneGap CLI to create, test, and package UWP apps.
- CLI Command References: Use commands like
cordova platform add windowsto enable UWP support for your project, andcordova build windows -- --appx=uwpto specifically build a UWP package. These commands are well-documented in Cordova’s CLI docs.
Are there existing UWP app examples built with PhoneGap?
You’ll find plenty of real-world examples, though many are listed under Cordova since the two projects are intertwined:
- Cross-Platform Showcase Apps: Apps like Adobe PhoneGap Showcase (originally built to demo PhoneGap capabilities) have UWP versions available in the Microsoft Store.
- Open Source Samples: Search GitHub for repositories tagged with
cordovaanduwp—you’ll find small utility apps, demo projects, and even full-featured apps that you can inspect to learn how to implement UWP-specific features (like live tiles or push notifications) via Cordova plugins. - Enterprise Internal Apps: Many companies use PhoneGap/Cordova to build UWP versions of their internal tools (like inventory trackers or employee portals) to support Windows 10 devices alongside iOS and Android.
内容的提问来源于stack exchange,提问作者Lazerbrains

