Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8368689
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T13:26:47+00:00 2026-06-09T13:26:47+00:00

I had using phonegap to program one apps that try to call java function

  • 0

I had using phonegap to program one apps that try to call java function from the java script in the android 2.3.3 environment.

My problem was the the app show alert message and then crash and prompted error message below

    08-04 11:06:12.669: W/dalvikvm(551): JNI WARNING: jarray 0x40522898 points to non-array object (Ljava/lang/String;)
    08-04 11:06:12.669: I/dalvikvm(551): "WebViewCoreThread" prio=5 tid=9 NATIVE
    08-04 11:06:12.669: I/dalvikvm(551):   | group="main" sCount=0 dsCount=0 obj=0x4051dd20 self=0x2a6d88
    08-04 11:06:12.669: I/dalvikvm(551):   | sysTid=559 nice=0 sched=0/0 cgrp=default handle=2780864
    08-04 11:06:12.669: I/dalvikvm(551):   | schedstat=( 943171212 746714576 110 )
    08-04 11:06:12.680: I/dalvikvm(551):   at android.webkit.WebViewCore.nativeTouchUp(Native Method)
    08-04 11:06:12.680: I/dalvikvm(551):   at android.webkit.WebViewCore.nativeTouchUp(Native Method)
    08-04 11:06:12.680: I/dalvikvm(551):   at android.webkit.WebViewCore.access$3300(WebViewCore.java:53)
    08-04 11:06:12.680: I/dalvikvm(551):   at android.webkit.WebViewCore$EventHub$1.handleMessage(WebViewCore.java:1158)
    08-04 11:06:12.680: I/dalvikvm(551):   at android.os.Handler.dispatchMessage(Handler.java:99)
    08-04 11:06:12.680: I/dalvikvm(551):   at android.os.Looper.loop(Looper.java:123)
    08-04 11:06:12.680: I/dalvikvm(551):   at android.webkit.WebViewCore$WebCoreThread.run(WebViewCore.java:629)
    08-04 11:06:12.680: I/dalvikvm(551):   at java.lang.Thread.run(Thread.java:1019)
    08-04 11:06:12.680: E/dalvikvm(551): VM aborting

Can anyone help/advice on this issue?

Below is the code

 MainActivity.java

        import org.apache.cordova.*;

        import android.os.Bundle;
        import android.app.Activity;
        import android.view.Menu;
        import android.view.MenuItem;
        import android.support.v4.app.NavUtils;

        public class MainActivity extends DroidGap {
            private MyClass mc;

            @Override
            public void onCreate(Bundle savedInstanceState) {       

                super.onCreate(savedInstanceState);
                super.init(); 
                mc = new MyClass(this, appView);
                appView.addJavascriptInterface(mc, "MyCls");       
                super.loadUrl("file:///android_asset/www/5.html");
            }  

        }


    MyClass.java

        import org.apache.cordova.DroidGap;

        import android.content.Context;
        import android.telephony.TelephonyManager;
        import android.webkit.WebView;

        public class MyClass {
              private WebView mAppView;
              private DroidGap mGap;

              public MyClass(DroidGap gap, WebView view)
              {
                mAppView = view;
                mGap = gap;
                System.out.println("jjjjj");
              }

              public String getTelephoneNumber(){
                  return "i am android";
              }
            }

    5.html
    <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">      
        <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
        <script src="jquery.jsonp.js"></script>
    </head>

    <script>
    $(document).ready(function(){

        $("#c2").click(function(){
            alert('jjjj');
            var t = window.MyCls.getTelephoneNumber();
            alert(t );
        });
    });
    </script>

    <body>
    <br><button id="c2">Call Android Activity</button>
    </body>
    </html>

    Manifest:

    <manifest xmlns:android="http://schemas.android.com/apk/res/android"
        package="com.example.myfirstapp"
        android:versionCode="1"
        android:versionName="1.0" >

        <uses-sdk
            android:minSdkVersion="8"
            android:targetSdkVersion="15" />

        <supports-screens 
        android:largeScreens="true" 
        android:normalScreens="true" 
        android:smallScreens="true" 
        android:resizeable="true" 
        android:anyDensity="true" />
    <uses-permission android:name="android.permission.VIBRATE" />
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS" />
    <uses-permission android:name="android.permission.READ_PHONE_STATE" />
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.RECEIVE_SMS" />
    <uses-permission android:name="android.permission.RECORD_AUDIO" />
    <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
    <uses-permission android:name="android.permission.READ_CONTACTS" />
    <uses-permission android:name="android.permission.WRITE_CONTACTS" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> 
    <uses-permission android:name="android.permission.GET_ACCOUNTS" />
    <uses-permission android:name="android.permission.BROADCAST_STICKY" />

        <application
            android:icon="@drawable/ic_launcher"
            android:label="@string/app_name"
            android:theme="@style/AppTheme" >
            <activity
                android:configChanges="orientation|keyboardHidden|screenSize"
                android:name=".MainActivity"
                android:label="@string/title_activity_main" >
                <meta-data
                    android:name="android.support.PARENT_ACTIVITY"
                    android:value="MainActivity" />
                <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>

            </activity>
        </application>
    <uses-permission android:name="android.permission.INTERNET" />
    </manifest>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T13:26:48+00:00Added an answer on June 9, 2026 at 1:26 pm

    Had found out. This issue only happen on the android simulator. It was working fine in the device with android 2.3.4 and 4.0.3.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm playing with Rhino , and I've had success using Java classes from the
We had been using java standard keystore ( $JAVA_HOME/jre/lib/security/cacerts ) as the trusted store
I am trying to build and run an android project using the phonegap framework.
This is a follow up post to some problems I've had using Java built
I had been using the traditional Java TableCellRenderer approach for providing the renderers in
Has anyone had success using Flickr to embed images that users can upload to
I've had trouble using developer.android.com as a reference. Is it incomplete, or do I
I'm trying to create an Android (2.2) app using Phonegap (version 1.9.0) and jQuery
Many might have had experience using File Upload widget from Yahoo User Interface library
how to store the imagePath of the image that I had captured using the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.