List of usage examples for org.apache.cordova Config getStartUrl
public static String getStartUrl()
From source file:org.n52.sosmobileclient.MobileSWC.java
License:Apache License
@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); super.init(); // Set by <content src="index.html" /> in config.xml super.setIntegerProperty("splashscreen", R.drawable.splash); super.loadUrl(Config.getStartUrl()); //super.loadUrl(Config.getStartUrl()); //super.loadUrl("file:///android_asset/www/index.html") }
From source file:org.nctsn.spa.example.java
License:Apache License
@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); // Set by <content src="index.html" /> in config.xml super.setIntegerProperty("loadUrlTimeoutValue", 60000); super.setIntegerProperty("splashscreen", R.drawable.splash); super.loadUrl(Config.getStartUrl(), 20000); //super.loadUrl("file:///android_asset/www/index.html") }
From source file:org.openmoney.omlets.mobile.omlets.java
License:Apache License
@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); // Set by <content src="index.html" /> in config.xml super.setIntegerProperty("splashscreen", R.drawable.screen_portrait); super.loadUrl(Config.getStartUrl()); //super.loadUrl("file:///android_asset/www/index.html") }
From source file:org.organizzy.client.android.MainActivity.java
License:Apache License
@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); super.init(); try {// w w w . ja v a 2s. c o m version = getPackageManager().getPackageInfo(getPackageName(), 0).versionName; } catch (PackageManager.NameNotFoundException e) { version = "1.0"; } WebSettings w = this.appView.getSettings(); String userAgent = String.format(" OrganizzyMobile/%s (lang=%s) (tz=%s)", version, Locale.getDefault().getLanguage(), TimeZone.getDefault().getID()); w.setUserAgentString(w.getUserAgentString() + userAgent); w.setCacheMode(WebSettings.LOAD_CACHE_ELSE_NETWORK); super.appView.addJavascriptInterface(new JavascriptObject(this), "_organizzy"); super.loadUrl(Config.getStartUrl()); receiveIntent(getIntent()); AlarmService.registerService(this); }
From source file:org.rti.kidsthrive.Kiwi.java
License:Apache License
@Override public void onCreate(Bundle savedInstanceState) { int id = this.getApplicationContext().getResources().getIdentifier("APP_VERSION", "string", this.getActivity().getPackageName()); // Log.d(TAG, "APP_VERSION id: " + id); String appVersion = this.getApplicationContext().getResources().getString(id); Log.d(TAG, "appVersion: " + appVersion); SharedPreferences sharedPreferences = this.getPreferences(this.getApplicationContext().MODE_PRIVATE); int appVersionPref = Integer.parseInt(sharedPreferences.getString("APP_VERSION", "0")); Log.d(TAG, "appVersionPref: " + appVersionPref); if ((appVersionPref != Integer.parseInt(appVersion))) { // you are updating Log.d(TAG, "Updating the app."); // check if we need to wipe the cache id = this.getApplicationContext().getResources().getIdentifier("WIPE_CACHE", "string", this.getActivity().getPackageName()); Log.d(TAG, "WIPE_CACHE id: " + id); String wipeCache = this.getApplicationContext().getResources().getString(id); Log.d(TAG, "wipeCache: " + wipeCache); if (Integer.parseInt(wipeCache) == 1) { Log.d(TAG, "wiping the cache: "); // super.clearCache(); // just add This Line clearApplicationData();/*from w w w. j av a 2s . com*/ } // set APP_VERSION = 2 and your new values SharedPreferences.Editor editor = sharedPreferences.edit(); editor.putString("APP_VERSION", appVersion); editor.commit(); } else { // you are not updating Log.d(TAG, "Not updating the app."); } super.onCreate(savedInstanceState); super.init(); // Set by <content src="index.html" /> in config.xml super.loadUrl(Config.getStartUrl()); //super.loadUrl("file:///android_asset/www/index.html"); }
From source file:org.rti.kidsthrive.Kiwi.java
License:Apache License
@Override public void onReceivedError(int errorCode, String description, String failingUrl) { if (failingUrl.contains("#")) { Log.v("LOG", "Config.getStartUrl():" + Config.getStartUrl()); Log.v("LOG", "failing url:" + failingUrl); final int sdkVersion = Integer.parseInt(Build.VERSION.SDK); if (sdkVersion > Build.VERSION_CODES.GINGERBREAD) { String[] temp;//from w w w . ja v a 2 s .com temp = failingUrl.split("#"); Log.v("LOG", "load page without internal link:" + temp[0]); super.loadUrl(temp[0]); // load page without internal link try { Thread.sleep(400); } catch (InterruptedException e) { e.printStackTrace(); } } Log.v("LOG", "try again failing url:" + failingUrl); super.loadUrl(failingUrl); // try again } else { Log.v("LOG", "failing url does not contain #, loading regular url."); super.loadUrl(Config.getStartUrl()); } }
From source file:org.rti.kiwi.tt.KiwiPrintsTT.java
License:Apache License
@Override public void onCreate(Bundle savedInstanceState) { int id = this.getApplicationContext().getResources().getIdentifier("APP_VERSION", "string", this.getActivity().getPackageName()); // Log.d(TAG, "APP_VERSION id: " + id); String appVersion = this.getApplicationContext().getResources().getString(id); Log.d(TAG, "appVersion: " + appVersion); SharedPreferences sharedPreferences = this.getPreferences(this.getApplicationContext().MODE_PRIVATE); // kudos: http://pulse7.net/android/android-application-shortcut-home-screen/ boolean isFirstTime = true; isFirstTime = sharedPreferences.getBoolean("isFirstTime", true); if (isFirstTime) { // Create explicit intent which will be used to call Our application // when some one clicked on short cut Intent shortcutIntent = new Intent(getApplicationContext(), KiwiPrintsTT.class); shortcutIntent.setAction(Intent.ACTION_MAIN); Intent intent = new Intent(); // Create Implicit intent and assign Shortcut Application Name, Icon intent.putExtra(Intent.EXTRA_SHORTCUT_INTENT, shortcutIntent); intent.putExtra(Intent.EXTRA_SHORTCUT_NAME, "KiwiPrintsTT"); intent.putExtra(Intent.EXTRA_SHORTCUT_ICON_RESOURCE, Intent.ShortcutIconResource.fromContext(getApplicationContext(), R.drawable.icon)); intent.setAction("com.android.launcher.action.INSTALL_SHORTCUT"); getApplicationContext().sendBroadcast(intent); // Set preference to inform that we have created shortcut on // Homescreen SharedPreferences.Editor editor = sharedPreferences.edit(); editor.putBoolean("isFirstTime", false); editor.commit();// ww w . j av a 2 s . c o m } int appVersionPref = Integer.parseInt(sharedPreferences.getString("APP_VERSION", "0")); Log.d(TAG, "appVersionPref: " + appVersionPref); if ((appVersionPref != Integer.parseInt(appVersion))) { // you are updating Log.d(TAG, "Updating the app."); // check if we need to wipe the cache id = this.getApplicationContext().getResources().getIdentifier("WIPE_CACHE", "string", this.getActivity().getPackageName()); Log.d(TAG, "WIPE_CACHE id: " + id); String wipeCache = this.getApplicationContext().getResources().getString(id); Log.d(TAG, "wipeCache: " + wipeCache); if (Integer.parseInt(wipeCache) == 1) { Log.d(TAG, "wiping the cache: "); // super.clearCache(); // just add This Line clearApplicationData(); } // set APP_VERSION = 2 and your new values SharedPreferences.Editor editor = sharedPreferences.edit(); editor.putString("APP_VERSION", appVersion); editor.commit(); } else { // you are not updating Log.d(TAG, "Not updating the app."); } super.onCreate(savedInstanceState); super.init(); // Set by <content src="index.html" /> in config.xml super.loadUrl(Config.getStartUrl()); //super.loadUrl("file:///android_asset/www/index.html"); }
From source file:org.rti.olutindo_app.Olutindo.java
License:Apache License
@Override public void onCreate(Bundle savedInstanceState) { Config.init(this); // Show the title bar, or else the ActionBar will be null on Android 4.x //setBooleanProperty("showTitle", true); super.onCreate(savedInstanceState); //ActionBarSherlockMenuPlugin.setOnInitListener(this); // Set by <content src="index.html" /> in config.xml //super.loadUrl(Config.getStartUrl()); //super.loadUrl("file:///android_asset/www/index.html") // load html page via jsHybugger content provider //super.loadUrl("content://jsHybugger.org/" + Config.getStartUrl()); // requestWindowFeature(Window.FEATURE_ACTION_BAR); setContentView(R.layout.main);/* www .jav a 2 s . co m*/ appView = (CordovaWebView) findViewById(R.id.uBridgeView); //getActionBar(); //getSupportActionBar(); appView.loadUrl(Config.getStartUrl()); }
From source file:org.unhandyandy.vennws.VennWS.java
License:Apache License
@Override public void onCreate(Bundle savedInstanceState) { Display display = getWindowManager().getDefaultDisplay(); Point size = new Point(); display.getSize(size);//from w w w .j a v a2 s. c o m int width = size.x; int height = size.y; //String argsStr = "{\"width\":" + width + ",\"height\":" + height + "}"; String argsStr = "%7B\"width\"%3A" + width + "%2C\"height\"%3A" + height + "%7D"; super.onCreate(savedInstanceState); //Set by <content src="venn01.html" /> in config.xml super.loadUrl(Config.getStartUrl()); super.loadUrl("file:///android_asset/www/venn01.html?" + argsStr); }
From source file:org.winterfantasy.winterfantasyruntime.WinterFantasyRunTime.java
License:Apache License
@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); super.init(); getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON); // Set by <content src="index.html" /> in config.xml super.loadUrl(Config.getStartUrl()); //super.loadUrl("file:///android_asset/www/TossPaper/index.html"); }