I am trying to create a Hello World app using Phonegap but it crashes when I call run the application on emulator. I followed the guideline here. Here is what I have on MainActivity.java :
package com.example.hello;
import android.os.Bundle;
import org.apache.cordova.*;
public class HelloWorld extends CordovaActivity
{
@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");
}
}
Here is my AndroidManifest.xml :
<?xml version='1.0' encoding='utf-8'?>
<manifest android:hardwareAccelerated="true" android:versionCode="1" android:versionName="0.0.1" android:windowSoftInputMode="adjustPan" package="com.example.hello" xmlns:android="http://schemas.android.com/apk/res/android">
<supports-screens android:anyDensity="true" android:largeScreens="true" android:normalScreens="true" android:resizeable="true" android:smallScreens="true" android:xlargeScreens="true" />
<uses-permission android:name="android.permission.INTERNET" />
<application android:hardwareAccelerated="true" android:icon="@drawable/icon" android:label="@string/app_name">
<activity android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale" android:label="@string/app_name" android:launchMode="singleTop" android:name="HelloWorld" android:theme="@android:style/Theme.Black.NoTitleBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
<uses-sdk android:minSdkVersion="10" android:targetSdkVersion="20" />
</manifest>
Here is the first errors I get :
Can you tell me what is wrong with the application? Thanks.
Actually, not every Android phone ships with Chromium as WebView engine (https://developer.chrome.com/multidevice/webview/overview). For instance, my Samsung Galaxy Ace2 with Android 4.1.2 has old WebView engine. User agent string denotes some unknown Mozilla version, HTML5 apps look&feel and behavior differs from Chrome. However, PhoneGap apps do not raise errors on my phone.
I don't know why you're getting "Chromium WebView does not exist" error, but since you're on the very beginnig on your way (cause you're trying to build Hello World app using Phonegap) I want to point to another option. Using Crosswalk project allows you not to deal with various WebView engines on every android device but use embedded in your app chromium engine - always the same on every android device. The crosswalk project is available for android and tizen platforms. So to build crossplatform app (android an iOS) I would suggest to use either
This approach can eliminate pain on supporting various android devices.
See also:
http://html5hub.com/building-cordova-applications-with-crosswalk/
https://groups.google.com/forum/#!topic/phonegap/IxSuRUScbMs
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With