Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
tips:cordova [2015/02/13 15:48] – created scipio | tips:cordova [2015/02/19 17:10] (current) – [Cordova] scipio | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ==== Cordova ==== | + | ====== Cordova |
- | === Install === | + | ===== Install |
Install nodejs and npm | Install nodejs and npm | ||
Line 23: | Line 23: | ||
</ | </ | ||
- | === Update === | + | ===== Update |
Line 30: | Line 30: | ||
</ | </ | ||
- | === Install Android SDK === | + | ===== Install Android SDK ===== |
Create / | Create / | ||
Line 39: | Line 39: | ||
- | === Project === | + | ===== Project |
- | == Create project == | + | ==== Create project |
< | < | ||
Line 66: | Line 66: | ||
</ | </ | ||
- | == Crosswalk == | + | ==== Crosswalk |
Optionally it is possible to use crosswalk instead of android webview | Optionally it is possible to use crosswalk instead of android webview | ||
Line 94: | Line 94: | ||
cd platforms/ | cd platforms/ | ||
android update project --subprojects --path . --target " | android update project --subprojects --path . --target " | ||
- | ant debug | + | ant clean debug |
cd .. # platforms/ | cd .. # platforms/ | ||
Line 103: | Line 103: | ||
</ | </ | ||
- | == Manage project == | + | ==== Manage project |
View project detail | View project detail | ||
Line 128: | Line 128: | ||
</ | </ | ||
- | == Test project == | + | ==== Test project |
< | < | ||
Line 134: | Line 134: | ||
</ | </ | ||
- | == Release == | + | ==== Release |
< | < | ||
Line 141: | Line 141: | ||
[http:// | [http:// | ||
- | == Tips == | ||
- | === GPIO === | + | |
+ | ===== Video autoplay ===== | ||
+ | |||
+ | Con ionic-crosswalk i video partono da soli con il set di src via javascript | ||
+ | <code javascript> | ||
+ | if (! $('# | ||
+ | $('# | ||
+ | } | ||
+ | $("# | ||
+ | $("# | ||
+ | </ | ||
+ | |||
+ | ==== Cordova ==== | ||
+ | |||
+ | CordovaApp.java | ||
+ | < | ||
+ | super.init(); | ||
+ | super.appView.getSettings().setMediaPlaybackRequiresUserGesture(false); | ||
+ | </ | ||
+ | |||
+ | ==== Cordova Crosswalk ==== | ||
+ | |||
+ | < | ||
+ | ... | ||
+ | super.init(); | ||
+ | getSettings(super.appView).setMediaPlaybackRequiresUserGesture(false); | ||
+ | ... | ||
+ | |||
+ | /* rende plubblica la API mascherata dalle nuove release di crosswalk */ | ||
+ | private XWalkSettings getSettings(XWalkView webView) | ||
+ | { | ||
+ | try | ||
+ | { | ||
+ | Method ___getBridge = XWalkView.class.getDeclaredMethod(" | ||
+ | ___getBridge.setAccessible(true); | ||
+ | XWalkViewBridge xWalkViewBridge = null; | ||
+ | xWalkViewBridge = (XWalkViewBridge)___getBridge.invoke(webView); | ||
+ | XWalkSettings xWalkSettings = xWalkViewBridge.getSettings(); | ||
+ | return xWalkSettings; | ||
+ | } | ||
+ | catch (Exception e) | ||
+ | { | ||
+ | e.printStackTrace(); | ||
+ | } | ||
+ | return null; | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | Posizionare un set di src dopo il device ready | ||
+ | < | ||
+ | $('# | ||
+ | </ | ||
+ | |||
+ | ===== GPIO ===== | ||
jni contain NDK project | jni contain NDK project | ||
Line 337: | Line 389: | ||
- | === Video autoplay === | ||
- | |||
- | CordovaApp.java | ||
- | < | ||
- | super.init(); | ||
- | super.appView.getSettings().setMediaPlaybackRequiresUserGesture(false); | ||
- | </ | ||
- | |||
- | Posizionare un set di src dopo il device ready | ||
- | < | ||
- | $('# | ||
- | </ | ||