-
Notifications
You must be signed in to change notification settings - Fork 60
Create Project
-
recommended workspace
./ |-cordova-js/ ............ |-cordova-plugin-toast/ .. |-cordova-sectv-orsay/ ... |-cordova-sectv-tizen/ ... |-cordova-tv-webos/ ...... |-grunt-cordova-sectv/ ...
-
create empty project
# Create cordova project $ cordova create TestApp $ cd TestApp # Beware of hidden file $ cp -rf ../grunt-cordova-sectv/sample/. ./ $ npm install ../grunt-cordova-sectv # Grunt task for build and package # Install dependency modules $ npm install # For toast browser simulator $ cordova platform add browser # Mandatory plugins for using browser simulator (not for other platforms) $ cordova plugin add cordova-plugin-device $ cordova plugin add cordova-plugin-network-information $ cordova plugin add cordova-plugin-globalization # Add toast plugin $ cordova plugin add ../cordova-plugin-toast
-
create project with sample media template (ex. media sample in cordova-plugin-toast)
# Create cordova project $ cordova create sampleMedia --template=cordova-plugin-toast/sample/media $ cd sampleMedia # Beware of hidden file $ cp -rf ../grunt-cordova-sectv/sample/. ./ $ npm install ../grunt-cordova-sectv # Grunt task for build and package # Install dependency modules $ npm install # For toast browser simulator $ cordova platform add browser # Mandatory plugins for using browser simulator (not for other platforms) $ cordova plugin add cordova-plugin-device $ cordova plugin add cordova-plugin-network-information $ cordova plugin add cordova-plugin-globalization # Add toast plugin $ cordova plugin add ../cordova-plugin-toast
-
www/index.html Please note that
cordova.js
,toast.js
should be placed bottom of body tag. (If placed to head tag, It causes timing issue.)<!-- REMOVE meta tag for setting CSP(Content-Security-Policy) <meta http-equiv="Content-Security-Policy" content="default-src 'self' data: gap: https://ssl.gstatic.com 'unsafe-eval'; style-src 'self' 'unsafe-inline'; media-src *"> --> <!-- Please add below script tags to body tag (not head tag) --> <body> ... <script type="text/javascript" src="cordova.js"></script> <!-- Add toast.js to use toast api --> <script type="text/javascript" src="toast.js"></script> ... </body>
-
It is sometimes necessary to add something to each platform which maybe not mandatory but needed.
-
Mandatory elements
-
In
config.xml
of your Cordova project, please add elements in each platform tag. And these elements will be automatically added to each platform when preparing.- In case orasy and tizen, elements format is XML tag.
- In case webos, elements format is JSON.
<platform name="sectv-orsay"> <multiapp>y</multiapp> </platform> <platform name="sectv-tizen"> <tizen:metadata key="http://samsung.com/tv/metadata/prelaunch.support" value="true" /> </platform> <platform name="tv-webos"> {"appDescription": "This is an sample application"} </platform>
-
For more details, please see the config.xml reference on Cordova site.
uuuu
Getting Started
Converting Tizen to Toast
- Prepare to convert
- Tizen API: AVPlay
- Tizen API: DrmInfo(Deprecated)
- Tizen API: Application
- Tizen API: TVInputDevice
- Tizen API: TVAudioControl
- Tizen API: TVWindow
- Tizen API: TVChannel
- Tizen API: IME
- Tizen API: ProductInfo
- Tizen API: Network
- How to detect platform
Converting Legacy to Toast
- Prepare to convert
- Legacy API: AVPlay
- Legacy API: TVInfo
- Legacy API: Common
- Legacy API: InputDevice
- Legacy API: AudioControl
- Legacy API: TVWindow
- Legacy API: TVChannel
- Legacy API: IME
- How to detect platform
API Reference
- supported cordova plugin
- toast.Media
- toast.MediaPlugin
- toast.drminfo(Deprecated)
- toast.application
- toast.inputdevice
- toast.tvaudiocontrol
- toast.tvwindow
- toast.tvchannel
- toast.billing
Supported platforms
Sample App
Contribution
Frequently Asked Questions