chromeview
chromeview copied to clipboard
Cordova/Phonegap integration
Hi,
I am really curious, this project looks great. Did you try to replace webview in phonegap apps with chromeview? Any ideas?
Thank for your answer
Michael
+1
check this out: https://github.com/thedracle/cordova-android-chromeview
Hey,
I'm fairly new to Android, but am I able to reference chromeview in a phonegap project that's already built with phonegap 3.0.0?
For Example:
Can I initialize it then replace the current super.loadUrl that Phonegap makes in the main class (well the only class in the project, I assume I initialize Chromeview this in the same method as onCreate is called) with chromeview.loadUrl?
Here's my onCreate, the Toast is entirely optional of course.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.chromeview);
chromeView = (ChromeView)findViewById(R.id.chrome_view);
chromeView.getSettings().setJavaScriptEnabled(true);
preferences = PreferenceManager.getDefaultSharedPreferences(this);
preferences.registerOnSharedPreferenceChangeListener(spChangedMain);
String url = preferences.getString("pref_Urlkey", "file:///android_asset/www/index.html");
Toast.makeText(MainActivity.this, "URL to display: " + url, Toast.LENGTH_SHORT).show();
chromeView.loadUrl(url);
}
That's awesome, just for a quick reference are you able to post your layout XML file? I can't seem to get the chromeview loading in the palette so I'm just curious how to correctly format the view.