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

  • SEARCH
  • Home
  • 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 8408033
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T23:31:54+00:00 2026-06-09T23:31:54+00:00

I have a barebones index.html, Anddroid Phonegap project in Eclipse that will not execute

  • 0

I have a barebones index.html, Anddroid Phonegap project in Eclipse that will not execute jQuery Mobile ajax calls. LogCat displays the following messages and the app crashes
CordovaWebView: TIMEOUT ERROR!
CordovaWebViewClient.onReceivedError: Error code=-6 Description=The connection to the server was unsuccessful.

Interesting facts:
1.) Eclipse installs and runs the app fine if I comment out the ajax call. 2.) I use the same ajax pattern in an .apk that I get by processing an html-css-javascript app through PhoneGap Build, and it works fine.

Details:
In Eclipse Juno, I have an Android PhoneGap project (it uses the ADT and cordova-1.9.0.jar) with an index.html file which incorporates the following .js files in the following order:

<script type="text/javascript" src="Scripts/cordova-1.9.0.js"></script>
<script type="text/javascript" src="Scripts/jquery-1.6.2.min.js"></script>
<script src="Scripts/temp.js" type="text/javascript"></script>

the temp.js file has this in it

$(document).ready(function(){
var theUrl = 'http://www.myDomain.biz/WebServices/gg.svc/';
console.log("theUrl + GetHelpFile = " + theUrl + "GetHelpFile");
$('div#divTarget').html("theUrl + GetHelpFile = " + theUrl + "GetHelpFile");

$.ajax({
type: "GET",
cache: false,
dataType: 'jsonp',
url: theUrl + "GetHelpFile",
contentType: "text/plain",
success: function (theJson) {
var help_file = $(theJson);
$('div#divHelpFile').html(help_file);
},
error: function ($theData) {
var tt = $theData;
alert(tt);
}
});
});

The project has

  • cordova-1.9.0.jar in its build path
  • an AndroidManifest.xml file that
    has <application><activity>s for my .java file
    android:name=”.java_activity” and for
    android:name=”org.apache.cordova.DroidGap”

and all the <uses-permissions>

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> 
<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.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.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.BROADCAST_STICKY" />

the Run configuration I am using in Eclipse targets a 4.0 AVD and that all works fine.
When I comment out the ajax call, Eclipse creates the .apk file, opens the AVD, installs the app, and it runs fine. Also, I made a website in IIS for the same index.html file, in the same directory, and the page loads in the browser and the ajax runs fine.

I increased the timeout period and that did not help

super.setIntegerProperty("loadUrlTimeoutValue", 60000);

What do you think I need to do to get the ajax call to execute in my Eclipse-Android-PhoneGap project?

Thanks

  • 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-09T23:31:55+00:00Added an answer on June 9, 2026 at 11:31 pm

    You should use different type of ajax call:

    $.get('http://yourdomain.com/index.php', function (data) {
    alert(data);
    });
    

    phonegap android ajax call doesnt work
    here is my solution.

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

Sidebar

Related Questions

I have a project that will involve heavy automation of complicated web pages. I
I have an interesting situation, well it's probably not that unique at all, but
Assume I have this barebones structure: project/ main.py providers/ __init.py__ acme1.py acme2.py acme3.py acme4.py
i'm working on a small project that might have an additional coder at some
I have some abstract base class that defines abstract functions. For example (barebones), abstract
I have a bare-bones install of jenkins on my Ubuntu server that I installed
I have a bare-bones sample project here: http://dl.dropbox.com/u/7834263/ExpandingCells.zip In this project, a UITableView has
have a problem. At first look at this HTML <div id=map style=background-image: url(map.png); width:
I'm looking for a barebones javascript example that demonstrates how the javascript plugin architecture
I have a PHP script that receives a file and returns a response. 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.