I just started a project with phonegap and I m getting a "invalid url error" message box + app crash on a html link to "http://maps.google.fr" (external link) , It works without problem on IPhone..
any ideas why?
The latest code has the new white-list feature. If you are referencing external hosts, you will have to add the host in PhoneGap.plist under the "ExternalHosts" key. Wildcards are ok. So if you are connecting to "http://phonegap.com", you have to add "phonegap.com" to the list (or use the wildcard "*.phonegap.com" which will match subdomains as well).
Related
I want to run an android app using bluemix. I followed these steps:
http://www.ibm.com/developerworks/library/mo-android-mobiledata-app/index.html#N10131
But I'm facing an exception saying that the Application ID is not found:
Exception: 07-21 13:03:04.017: E/AndroidRuntime(1776):
java.lang.RuntimeException: Unable to create application
com.ibm.bluelist.BlueListApplication:
com.ibm.mobile.services.core.internal.IBMBluemixException:
IBMBLUEMIX-0042E: Initialization failed because
I have used my own Application ID, secret and route but I'm still getting this error. Can any one please help on this?
Based on the Message ID, I think this is the full error message.
"Initialization failed because no applicationId was specified"
#whitfiea is correct. You need to make sure the AppID is correctly specified for the Mobile Cloud application you are trying to reach (as well as check the other values, the appSecret and the appRoute).
The appRoute should be something like "BlueList.mybulemix.net"
I would also suggested downloading a new set of IBM Client SDK for Android JARs for your project. I would also recommend downloading a new copy of the BlueList sample from JazzHub, as corrections have been made to the application.
One final suggestion, create a new Mobile Cloud Application Backend, just to make sure you are at the current code levels for the client-side and the cloud side.
1.Please try applicationRoute in bluelist.properties file without any prefix like http.
Make sure your application is of type Mobile Cloud under boilerplates.
Verify the below step given in article.
Your Android app will need basic network capability and permissions, so we've included the following permissions in the manifest file. Open up the AndroidManifest.xml file to take a look.
Thanks.
I created a worklight application. I tried running that application on android emulator and i am getting the following error.
[http://localhost:8080/apps/services/api/MyFirstApp/android/query] Host is not responsive.
Try to manually access the URL through the android emulator browser to verify connectivity
So i tried to enter the same url in the emulator browser, i got the following text:
/*-secure-
{"WL-Authentication-Failure": {"wl_remoteDisableRealm":{"reason":"Login Failed}}} */
Can someone help me with this?
I am using Android OS version: 4.2.2, API level: 17
I haven't changed any application settings myself..
I am trying to go to a basic login page with the url "https://jazz.net/jazz/auth/j_security_check"
This is my adapter XML:
<wl:adapter xmlns:wl="worklight.com/integration"; xmlns:http="worklight.com/integration/http"; xmlns:xsi="w3.org/2001/XMLSchema-instance"; name="RQMAdapter">
<displayName>RQMAdapter</displayName>
<description>HTTP type Worklight Adapter for jazz server</description>
<connectivity>
<connectionPolicy xsi:type="http:HTTPConnectionPolicyType">
<protocol>https</protocol>
<domain>jazz.net</domain>
</connectionPolicy>
<loadConstraints maxConcurrentConnectionsPerNode="2" />
</connectivity>
<procedure name="loginToRQM" />
</wl:adapter>
This is my scenario:
I have a requirement where I need to read information about the projects from jazz.net for a user. They are all available on the jazz server within an XML file. I need to process it to a mobile device to make it available on hand held device... So, now I am told that i will have to download some of the files from the server, so i need to have file IO on my app. I learned that we need to write this part using a Cordova plug-in in Worklight.
please let me know what else is needed for the solution... thank you
Make sure to place the actual IP address of your server machine:
Change the value for worklightServerRootURL in the file
application-descriptor.xml (located at: yourProject\apps\yourApp)
Build and deploy
Right-click on the generated Android project >> Run As >> Run application
If you are using using Worklight 5.0.5, make sure to upgrade to 5.0.6, where a fix is available when only API Level 17 is installed.
As for going to that URL, you need to explain where exactly you're trying to go to it from, and how... you need to be more descriptive. It sounds to me like you haven't gone through the Getting Started material. Please do.
I had the same problem.
I have solved it by using the real IP address of the server in the WL app instead of using localhost:
When the emulator is running your app, press the Menu button.
Select to change your server URL
Remove "localhost" and use the IP address.
Accept and try again.
This fixed my problem.
I am currently building an Android app using HTML5. Inside my app, I am providing link to a HTML file available inside tomcat server on my machine.
<div>Beep</div>
The HTML file "sample.html" has link to download a file in same file location, where the sample.html is placed.
sample.html has this --> Click to download
The problem here is, when I run my app on an android mobile, the link stays dumb and it won't initiate the download from the given path.
But, the same URL when I open in a web browser, the download starts.
Could anyone let me know why this URL is not initiating the download inside my app??
I already enabled "Allow installation of non-Market applications" in the settings of my android device.
If you are using real device you must set your url with static ip of your machine like 192.168.0.10 and in emulator 10.0.0.2
See this post.
Use 10.0.2.2 as IP for server running on the same machine as the Android emulator.
Check out following post with similar problem:
Download File inside WebView
Check out this link for setting up the mime type in tomcat.
Copied for reference:
In Tomcat 5.x and 4.x, the default mappings between MIME types and file extensions are stored in the file tomcat_home/conf/web.xml, where tomcat_home is the path under which Tomcat was installed on your server. The mappings specified there are applied to all web / WAP applications hosted on your Tomcat server. Application-specific mappings should be set in the WEB-INF/web.xml file under the directory of your web / WAP application.
Each mapping is specified with the <mime-mapping>, <extension> and <mime-type> tags. Here is an example:
<web-app>
...
<mime-mapping>
<extension>xhtml</extension>
<mime-type>application/vnd.wap.xhtml+xml</mime-type> </mime-mapping>
<mime-mapping>
<extension>wml</extension>
<mime-type>text/vnd.wap.wml</mime-type> </mime-mapping>
<mime-mapping>
<extension>wmls</extension>
<mime-type>text/vnd.wap.wmlscript</mime-type> </mime-mapping>
<mime-mapping>
<extension>wbmp</extension>
<mime-type>image/vnd.wap.wbmp</mime-type> </mime-mapping>
...
</web-app>
I'm trying to create an Android (2.2) app using Phonegap (version 1.9.0) and jQuery Mobile (1.1.0). Specifically, the app is supposed to send a GET request to an existing WCF REST service and retrieve JSON data (a list of folders) and display each item as an option in a select drop down menu.
Right now, all this works as it should when I use the desktop browser. The WCF REST service sends the correct response, the browser renders the page correctly and puts the options in the select menu as I want it to. However, when I use the following code in Android app using Phonegap:
$.getJSON('http://xxx.xxx.xxx/MobileService.svc/GetFolders?callback=?', null, function (folders) {
$.each( folders, function( i, folder ) {
$("#folders").append("<option value='"+folder.Id+"'>"+folder.Name+"</option>");
});
$("#folders").selectmenu("refresh");
});
...I get the error message when I boot the Android app (debugging on physical device):
Connection to the server was unsuccessful. ("file:///android_asset/www/index.html")
When I comment out the above $.getJSON code, the app loads fine, but the select menu is unpopulated.
I've also noticed that apparently because Phonegap uses the "file://" protocol, it is not affected by the "same-origin policy" that the "http://" protocol is...I had been using JSONP when I was working with the browser, which is why I have the callback. I don't think this should be the reason why it is failing, but I dont know. Any help will be greatly appreciated!
Things I've tried:
Changing the access origin to ".*" in the cordova.xml
Adding 'super.setIntegerProperty("loadUrlTimeoutValue", 60000);' to the activity
You can try to set your cordova.xml to "*" instead of ".*" as seen on the Getting Started Guide
Or even better:
http://xxx.xxx.xxx
It turns out in my particular case that the issue boiled down to the mobile phone being on guest wifi network that didn't have access to the network where the REST service was hosted so the connection was being blocked.
Hope that can help someone
I am create one smile application in Android + Google App Engine in eclipse. i am trying to deploy that app on Google app Engine but it show the error message
Log Cat :
Unable to update:
com.google.appengine.tools.admin.HttpIoException: Error posting to URL: https://appengine.google.com/api/appversion/getresourcelimits?app_id=AppEngineTest2&version=1&
400 Bad Request
Client Error (400)
The request is invalid for an unspecified reason.
at com.google.appengine.tools.admin.AbstractServerConnection.send1(AbstractServerConnection.java:282)
at com.google.appengine.tools.admin.AbstractServerConnection.send(AbstractServerConnection.java:235)
at com.google.appengine.tools.admin.AbstractServerConnection.post(AbstractServerConnection.java:214)
at com.google.appengine.tools.admin.ResourceLimits.remoteRequest(ResourceLimits.java:160)
at com.google.appengine.tools.admin.ResourceLimits.request(ResourceLimits.java:127)
at com.google.appengine.tools.admin.AppAdminImpl.doUpdate(AppAdminImpl.java:323)
at com.google.appengine.tools.admin.AppAdminImpl.update(AppAdminImpl.java:52)
at com.google.appengine.eclipse.core.proxy.AppEngineBridgeImpl.deploy(AppEngineBridgeImpl.java:400)
at com.google.appengine.eclipse.core.deploy.DeployProjectJob.runInWorkspace(DeployProjectJob.java:148)
at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:38)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
Any one have simple Example(with Source code ) of Android + Google App Engine (c2dm) please share it ..
I encountered the same problem as you and solved it in the following way:
Before uploading, first you have to create the application in the App Engine Administration Console (see https://developers.google.com/appengine/docs/java/gettingstarted/uploading)
Check your application id.
The Application Identifier must be between 6 and 30 characters. Only Lowercase letters, digits, and hyphens (-) are acceptable characters. Leading and trailing hyphens are prohibited. - which means that Uppercase letters are not allowed.
appengine-web.xml needs the same application id with which you have created your application in the Administration console. Put this application id between the <application> tag.
Now you can deploy the application with Eclipse
I found this recently as a bug of Eclipse or Google App Engine plugin.
Make sure that you specify the app id correctly in appengine-web.xml. It should be AppEngineTest2, not the URL (AppEngineTest2.appspot.com).