cordova-android-chromeview icon indicating copy to clipboard operation
cordova-android-chromeview copied to clipboard

Having trouble making this work

Open Spittal opened this issue 12 years ago • 10 comments
trafficstars

Hey,

I'm quite new to this, so I really have no idea how to get a project set up with this... Could you be a bit more detailed with your instructions.

I'm familiar with Cordova/Phonegap 3.0.0 building through terminal and I also am familiar on how to set up Chromeview as a library on a project. From there I'm a bit confused I'm not sure where to initialize Chromeview and I'm also not really certain when I use this Cordova-Android-Chromeview tool.

I followed the instructions as was still quite confused. If you could help me out that would be greatly appreciated.

Thanks.

Spittal avatar Aug 20 '13 20:08 Spittal

Hey Spittal,

Sorry for the lack of documentation. This is something I whipped together for the purpose of testing some HTML5 features that were lacking in WebView through a PhoneGap application.

So, in Eclipse, reference the ChromeView Project, make sure that you follow the instructions from ChromeView to install the packed files, and call the ChromeView initialize in your Application class's onCreate method.

ChromeView is the really only contentious part of this, everything else should work normally with Cordova.

  • Jason.

thedracle avatar Aug 20 '13 22:08 thedracle

Hey Thanks so much, but I'm having troubles actually building the project from your create in the bin folder. I get these errors:

jamericks:~ Jamie$ /Users/Jamie/Downloads/cordova-android-chromeview-master/bin/create ferriesTest com.kerplunc.ferriestrest ferriesTest

BUILD FAILED /Applications/Android Dev/sdk/tools/ant/build.xml:712: The following error occurred while executing this line: /Applications/Android Dev/sdk/tools/ant/build.xml:726: Compile failed; see the compiler error output for details.

Total time: 8 seconds An unexpected error occurred: ant jar > /dev/null exited with 1 Deleting project...

I have confirmed that I have ANT installed and it's the latest version as well as the latest JDK and Android SDK. Any ideas?

Spittal avatar Aug 21 '13 20:08 Spittal

Hey Sorry,

I'm actually just getting

"jamericks:bin Jamie$ npm install npm WARN package.json [email protected] No README data"

When trying to install the package... I'm fairly new to this. Any help would be awesome.

Spittal avatar Aug 22 '13 22:08 Spittal

Does the package install, that just looks like a warning to me.

thedracle avatar Aug 26 '13 15:08 thedracle

Also, I haven't built the project with ant yet, just through Eclipse. We probably need to add dependencies in the ant XMLs for bringing in ChromeView.

thedracle avatar Aug 26 '13 15:08 thedracle

Hi guys,

Phonegap + chromium would be just perfect on Android. I also have troubles to make to project work. Do you have any recommendation ?

Thanks a lot !

oeeckhoutte avatar Oct 11 '13 16:10 oeeckhoutte

I have troubles getting this as well. Is there anybody that would be kind to write a small write up of how get an example running from scratch? I am willing to pay :)

ariselseng avatar Oct 22 '13 18:10 ariselseng

Hi, I am trying to create a new project, and I cant make it work. If someone could help, would be excellent.

This are the steps I have follow:

  1. Create a jar with the src folder of chromeview using eclipse
  2. Copy the jar in cordova-android-chromeview/framework/libs
  3. Edit ExposedJsApi.java in cordova-android-chromeview/framework/src/org/apache/cordova/ExposedJsApi.java to Include this line:
import us.costan.chrome.ChromeJavascriptInterface;
  1. Building without the Tooling
android update project -p . -t android-17
ant jar
  1. Later a make in cordova-android-chromeview/bin: npm install and receive the same warning of @Spittal npm WARN package.json [email protected] No README data"
  2. create the new project: ./create /Users/user/Documents/android/startapp com.testing.startapp startapp
  3. add project to eclipse
  4. Add chromeview as a Library: Project Properties > Android in Library I add chromeview
  5. Im my project assets I add webviewchromium.pak
  6. In my app main i initialize Chromeview like this
package com.testing.startapp;
import android.os.Bundle;
import org.apache.cordova.*;
import us.costan.chrome.*;
public class startapp extends DroidGap
{
   @Override
    public void onCreate(Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);
        // Set by <content src="index.html" /> in config.xml
        ChromeView.initialize(this);
        super.loadUrl(Config.getStartUrl());
       //super.loadUrl("file:///android_asset/www/index.html")
      }
}

After all of this and run on emulator, the app only show a blank page and never show the default pages in assets/www "Device ready" in logcat show the following error screen shot 2013-11-05 at 6 14 12 pm

josedefreitasc avatar Nov 05 '13 22:11 josedefreitasc

fyi you need to increase the heap for java for ant jar

export ANT_OPTS=”-Xmx1024m -Xms512m”

antgrimmitt avatar Jan 19 '14 15:01 antgrimmitt