List of usage examples for org.apache.cordova CordovaWebView CORDOVA_VERSION
String CORDOVA_VERSION
To view the source code for org.apache.cordova CordovaWebView CORDOVA_VERSION.
Click Source Link
From source file:com.example.administrator.myapplication.fragment.CordovaFragment2.java
License:Apache License
/** * Called when the activity is first created. *//* w w w . j ava 2 s. com*/ @Override public void onCreate(Bundle savedInstanceState) { LOG.i(TAG, "Apache Cordova native platform version " + CordovaWebView.CORDOVA_VERSION + " is starting"); LOG.d(TAG, "CordovaActivity.onCreate()"); // need to activate preferences before super.onCreate to avoid "requestFeature() must be called before adding content" exception loadConfig(); if (getArguments() != null) { launchUrl = getArguments().getString("url"); } Log.d(TAG, " launchURL : " + launchUrl); /** if(!preferences.getBoolean("ShowTitle", false)) { getActivity().getWindow().requestFeature(Window.FEATURE_NO_TITLE); } */ /* if(preferences.getBoolean("SetFullscreen", false)) { Log.d(TAG, "The SetFullscreen configuration is deprecated in favor of Fullscreen, and will be removed in a future version."); getActivity().getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); } else if (preferences.getBoolean("Fullscreen", false)) { getActivity().getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); } else { getActivity().getWindow().setFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN, WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN); }*/ super.onCreate(savedInstanceState); cordovaInterface = makeCordovaInterface(); if (savedInstanceState != null) { cordovaInterface.restoreInstanceState(savedInstanceState); } }
From source file:com.webileapps.fragments.CordovaFragment.java
License:Apache License
/** * Called when the activity is first created. *//*from w w w. j av a 2 s . co m*/ @Override public void onCreate(Bundle savedInstanceState) { LOG.i(TAG, "Apache Cordova native platform version " + CordovaWebView.CORDOVA_VERSION + " is starting"); LOG.d(TAG, "CordovaActivity.onCreate()"); // need to activate preferences before super.onCreate to avoid "requestFeature() must be called before adding content" exception loadConfig(); if (getArguments() != null) { launchUrl = getArguments().getString("url"); } Log.d(TAG, " launchURL : " + launchUrl); /** if(!preferences.getBoolean("ShowTitle", false)) { getActivity().getWindow().requestFeature(Window.FEATURE_NO_TITLE); } */ if (preferences.getBoolean("SetFullscreen", false)) { Log.d(TAG, "The SetFullscreen configuration is deprecated in favor of Fullscreen, and will be removed in a future version."); getActivity().getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); } else if (preferences.getBoolean("Fullscreen", false)) { getActivity().getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); } else { getActivity().getWindow().setFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN, WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN); } super.onCreate(savedInstanceState); cordovaInterface = makeCordovaInterface(); if (savedInstanceState != null) { cordovaInterface.restoreInstanceState(savedInstanceState); } }
From source file:cordova.plugin.RequestLocationAccuracy.java
License:Apache License
private boolean hasPermission(String permission) throws Exception { boolean hasPermission = true; Method method = null;/*from w ww. j a v a 2s . co m*/ try { method = cordova.getClass().getMethod("hasPermission", permission.getClass()); Boolean bool = (Boolean) method.invoke(cordova, permission); hasPermission = bool.booleanValue(); } catch (NoSuchMethodException e) { Log.w(TAG, "Cordova v" + CordovaWebView.CORDOVA_VERSION + " does not support runtime permissions so defaulting to GRANTED for " + permission); } return hasPermission; }