Hi,
I downloaded the crosswalk runtime library from google playstore, then I did
the following steps
1. Created a hello world project in eclipse
2. Added “xwalk_core_library_java_app_part.jar” and
“xwalk_core_library_java_library_part.jar” to build path.
3. Change my AndroidManifest.xml to be like
<application
android:name="org.xwalk.core.XWalkApplication"
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name=".MainActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
4. Change my activity_main.xml to be the following.
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context="com.example.opaosdk.MainActivity" >
<org.xwalk.core.SharedXWalkView android:id="@+id/webviewtest"
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
</org.xwalk.core.SharedXWalkView>
</RelativeLayout>
5. My MainActivity.java looks like this
package com.example.opaosdk;
import android.app.Activity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import org.xwalk.core.XWalkView;
import org.xwalk.core.XWalkActivity;
public class MainActivity extends XWalkActivity {
private SharedXWalkView mXWalkView;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
mXWalkView = (SharedXWalkView) findViewById(R.id.webviewtest);
mXWalkView.load("index.html", null);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is
present.
getMenuInflater().inflate(R.menu.main, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle action bar item clicks here. The action bar will
// automatically handle clicks on the Home/Up button, so long
// as you specify a parent activity in AndroidManifest.xml.
int id = item.getItemId();
if (id == R.id.action_settings) {
return true;
}
return super.onOptionsItemSelected(item);
}
}
But I am getting error while inflating the crosswalk webview what I am doing
wrong?
Br,
Haris
_______________________________________________
Crosswalk-help mailing list
[email protected]
https://lists.crosswalk-project.org/mailman/listinfo/crosswalk-help