Example usage for org.apache.cordova Config getStartUrl

List of usage examples for org.apache.cordova Config getStartUrl

Introduction

In this page you can find the example usage for org.apache.cordova Config getStartUrl.

Prototype

public static String getStartUrl() 

Source Link

Usage

From source file:com.teachmatic.snapsupply.topteachers.SnapSupply.java

License:Apache License

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    super.setIntegerProperty("loadUrlTimeoutValue", 70000);
    super.setIntegerProperty("splashscreen", R.drawable.splash);
    super.loadUrl(Config.getStartUrl(), 10000);
    getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
}

From source file:com.techostic.nexttalk.NextTalk.java

License:Apache License

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    super.init();
    // Set by <content src="index.html" /> in config.xml

    /*/*from   w w  w. j a  v a 2  s .c  om*/
     * Intent i = new Intent(getApplicationContext(),
     * PhoneCallMonitorService.class);
     * getApplicationContext().startService(i);
     */

    String versionName = "";

    PackageManager packageManager = this.getPackageManager();
    try {
        PackageInfo packageInfo = packageManager.getPackageInfo(this.getPackageName(), 0);
        versionName = packageInfo.versionName;
    } catch (NameNotFoundException ex) {
    } catch (Exception e) {
    }

    super.loadUrl(Config.getStartUrl() + "#" + versionName);

}

From source file:com.techostic.nexttime.NextTime.java

License:Apache License

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    super.init();
    // Set by <content src="index.html" /> in config.xml

    /*/*from  w  w w. ja v a 2s. c  o  m*/
     * Intent i = new Intent(getApplicationContext(),
     * PhoneCallMonitorService.class);
     * getApplicationContext().startService(i);
     */

    boolean trialExpired = true;
    // expire initially :P

    SharedPreferences preferences = getPreferences(MODE_PRIVATE);
    String installDate = preferences.getString("InstallDate", null);
    if (installDate == null) {
        // First run, so save the current date
        SharedPreferences.Editor editor = preferences.edit();
        Date now = new Date();
        String dateString = formatter.format(now);
        editor.putString("InstallDate", dateString);
        // Commit the edits!
        editor.commit();

        installDate = dateString;
    }

    // This is not the 1st run, check install date
    Date before = null;
    try {
        before = (Date) formatter.parse(installDate);

        Date now = new Date();
        long diff = now.getTime() - before.getTime();
        long days = diff / ONE_DAY;
        if (days < 3) { // Less than 3 days?
            trialExpired = false;
        }

    } catch (ParseException e) {
        Log.e("trial install date", e.getMessage());
    }

    super.loadUrl(Config.getStartUrl() + "#" + trialExpired);

}

From source file:com.techostic.techocall.TechoCall.java

License:Apache License

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    super.init();
    // Set by <content src="index.html" /> in config.xml

    /* Intent i = new Intent(getApplicationContext(), PhoneCallMonitorService.class);
     getApplicationContext().startService(i);*/

    super.loadUrl(Config.getStartUrl());

}

From source file:com.tencent.push.PluginTest.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.loadUrl(Config.getStartUrl());
    // super.loadUrl("file:///android_asset/www/index.html");
    XGPushManager.registerPush(this, "userAccount", new XGIOperateCallback() {

        @Override//  w ww  . j ava  2s .  c  o  m
        public void onSuccess(Object data, int flag) {
            Log.i("TPush", "?token" + data);
        }

        @Override
        public void onFail(Object data, int flag, String msg) {
            Log.i("TPush", "?:" + flag + ",?" + msg);
        }
    });
}

From source file:com.teste.CordovaTest.java

License:Apache License

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    AlertDialog alertDialog = new AlertDialog.Builder(this).create();
    alertDialog.setTitle("Mensaginha");
    alertDialog.setMessage("Est hidratado agora");
    // Set the Icon for the Dialog
    alertDialog.setIcon(R.drawable.icon);
    alertDialog.show();/*  w ww  .j  av  a2 s  .co m*/
    // Set by <content src="index.html" /> in config.xml
    super.loadUrl(Config.getStartUrl());
    //super.loadUrl("file:///android_asset/www/index.html")
}

From source file:com.thedesignshop.mvp.MVP.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.loadUrl(Config.getStartUrl());
    //super.loadUrl("file:///android_asset/www/index.html");

    jsInterface = new JavaScriptInterface(MVP.this);

    super.appView.addJavascriptInterface(jsInterface, "JSInterface");
}

From source file:com.thinkjson.crimson.HelloWorld.java

License:Apache License

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    super.init();
    //super.setIntegerProperty("splashscreen", //);
    // Set by <content src="index.html" /> in config.xml
    super.loadUrl(Config.getStartUrl());
    //super.loadUrl("file:///android_asset/www/index.html");
}

From source file:com.tocarta.CommandCenter.CommandCenter.java

License:Apache License

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    // Set by <content src="index.html" /> in config.xml
    super.loadUrl(Config.getStartUrl());
    //        super.loadUrl("file:///android_asset/command_center/index.html");
}

From source file:com.tsuyoshi.youtubeInstantPlaylist.YoutubeInstantPlaylist.java

License:Apache License

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    super.init();
    // Set by <content src="index.html" /> in config.xml

    // this is the specific line that prevents the screen from sleeping
    getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON); // https://chris-allen-lane.com/blog/post/phonegap-prevent-an-android-devices-screen-from-sleeping

    super.loadUrl(Config.getStartUrl());
    //super.loadUrl("file:///android_asset/www/index.html");
}