Skip to main content

Posts

Showing posts with the label phonegap

Android Packaging: Error generating final archive resources.ap_

I'm currently trying to build a PhoneGap project I've been working on in Eclipse. However, when I try to build and run the project on the Android Emulator, I get the following error... Error generating final archive: Failed to add /Users/me/Projects/MyApp/bin/resources.ap_ Unknown Android Packaging Problem I've cleaned the project several times, removed the resources.ap_ file, as well as the contents of the gen directory. Anything else I can try? Much appreciated. <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="my.app.android" android:versionCode="1" android:versionName="1.0" > <uses-sdk android:minSdkVersion="8" /> <supports-screens android:largeScreens="true" android:normalScreens="true" android:smallScreens="true" android:res

Page contains error in android phonegap wit h jquery mobile. Please help me i m in real need

I have deployed android application made with phone gap, and I haven't problem with emulator and web browser.But when i install that application on android tablet (samsung galaxy) device it shows following error when i click on cell of table. Application Error: The web page contains an error. (file:///android_asset/www/tips_list.html?act=SET_TIPS_LIST&cid=1) In my application I am displaying list of categories in table and when user click on any cell of table it will navigate to its subcategory page. It works fine in emulator but crashes in tablet.

AJAX to Sharepoint Server with Phonegap and JQuery Mobile not working

I have the following Problem. In the Phonegap App(for Android) I want to make an AJAX-Call to connect with a Sharepoint Server, with the following Code: $.ajax({ url:"https://xxx/_vti_bin/lists.asmx", beforeSend: function( xhr ){ xhr.setRequestHeader( "SOAPAction", "http://schemas.microsoft.com/sharepoint/soap/GetListCollection" ); xhr.setRequestHeader("Content-Type","text/xml; charset=utf-8"); }, dataType:"xml", contentType: "application/xml; charset=utf-8", timeout:10000, type:'POST', cache: false, username: "username", password: "password", data: soapEnv, success:function(data) { // alert data var serializer = new XMLSerializer(); serialized = serializer.serializeToString(data); alert(serialized); }, error:function(XMLHttpRequest,textStatus, errorThrown) { // alert errors aler

PhoneGap Better Error Handling? (Android)

I'm working on a simple photo viewing app using PhoneGap on Android.. for the most part I can get it working with absolutely no problems but am finding that occasionally when loading a .gif image the page just fails and PhoneGaps just terminates the whole application with an error something along the lines of: The connection to the server was unsuccessful. (file://android_asset/www/index.html?href=424) My wonder is if I can have PhoneGap nicely handle that error by not killing the application. I'm doing what I can on the server end to make sure animated gif's don't get filtered into the application but in the event it is and the app can't handle it I can't have my application quitting on me all the time.

PhoneGap Fixed Orientation + ChildBrowser Non-Fixed Orientation (Android)

I'm creating a HTML/JS/CSS App using PhoneGap (1.4.1) for Android. Within the App I'm using the PhoneGap ChildBrowser plugin to display external content. I'd like to keep the orientation of the App to Landscape while allowing the ChildBrowser to rotate to the orientation of the device. I've tried applying different android:screenOrientation="" settings on each of the activities as below, but that doesn't seem to work. <activity android:name="com.phonegap.DroidGap" android:screenOrientation="sensorLandscape" > <intent-filter> .... </intent-filter> </activity> <activity android:name="com.phonegap.plugins.childBrowser.ChildBrowser" android:screenOrientation="sensor" > <intent-filter> .... </intent-filter> </activity> Is this even possible? Any help would be greatly appreciated!

Phonegap and Admob on iPhone

I am trying to implement AdMob Javascript on a Phonegap mobile application, however when I paste in the code I get a whitelist error in the console leading to mmv.admob.com , so clearly phonegap was blocking communication with this url so I added to phonegaps url exceptions in the plist , this then lead to a blocked communication with the url doubleclick.net so I added *.doubleclick.net so now it has lead to no url errors, just not displaying any ads at all - not even a block colour which it is meant to fallback too. Any ideas to what I am doing wrong? Thanks,

how to use global variable with phonegap navigator.notification.confirm?

i have this situation: <a href="#" onClick="submitNotification(1);">click1</a> <a href="#" onClick="submitNotification(2);">click2</a> <a href="#" onClick="submitNotification(3);">click3</a> function submitNotification(cdata){ navigator.notification.confirm( 'do you like '+cdata+' option ', submit, 'notice', 'Yes,No' ); function submit(button){ if (button == 1){ alert(id); //or alert(cdata); } else if (button == 2){ ... } } so, i click on a link, 1 or 2 ... gets send to submitNotification where i get a message: do you like 1 option or do you like 2 option or ... depending on what link i click. this function calls submitVote and sends button var to it somehow. yes means 1 and no means 2 . the problem is that i cant get id or cdata from the original link.

how to use global variable with phonegap navigator.notification.confirm?

i have this situation: <a href="#" onClick="submitNotification(1);">click1</a> <a href="#" onClick="submitNotification(2);">click2</a> <a href="#" onClick="submitNotification(3);">click3</a> function submitNotification(cdata){ navigator.notification.confirm( 'do you like '+cdata+' option ', submit, 'notice', 'Yes,No' ); function submit(button){ if (button == 1){ alert(id); //or alert(cdata); } else if (button == 2){ ... } } so, i click on a link, 1 or 2 ... gets send to submitNotification where i get a message: do you like 1 option or do you like 2 option or ... depending on what link i click. this function calls submitVote and sends button var to it somehow. yes means 1 and no means 2 . the problem is that i cant get id or cdata from the original link.

How to set device height and width for a bar chart in android

I am using phonegap to build my app.I am using flot to create charts. here is my javascript code <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <script type="text/javascript" src="flot/jquery.js"></script> <script type="text/javascript" src="flot/jquery.flot.js"></script> <script type="text/javascript" src="flot/jquery.flot.stack.js"></script> <script type="text/javascript" src="flot/jquery.flot.pie.js"></script> </head> <body> <div id="pie-example" style="width:300px;height:200px;"></div> <script type="text/javascript" src="pie_chart.js"></script> </body> </html> In this code i am giving the width and height of the bar graph.I want to give device height and width.How to do that?

Android phonegap app : unable to retrieve an image taken by the camera using my own code (not phonegap"s)

Note- even though im using phonegap, the question is not about some issue in that. Hi, im developing a android app. my app is using phonegap 1.3. mi problem... Im using phonegap apis to take a picture and display it in my app. But whats happening is due to some reason the os kills my app after the camera is launched, so that after the photo is clicked, my app is relaunched and it doesnt get the info abt the taken picture. As a workaround to this problem ( the problem ), i designed a phonegap plugin which on app start checks if the app had crashed while taking a picture (some flags in code), and if it is restarting after crash, it retrieves the Pic.jpg taken by the camera and tries to displays it. The problem is that its not able to get the right image, or even a proper .jpg file for that matter. mi code... Phonegap makes an intent to start the camera and passes the uri for the Pic.jpg that it creates into that intent which it passes to startActivityForResult. In

jQ autocomplete issue in androdi app

I struggle with the autopcomplete Plugin for jQuery. <input type="text" id="name" /> <input type="password" id=""pass" /> //... $('#name').autocomplete({source: userName}); It works all fine but when I've selected a user name I get a text focus an both the name and the password input field. As soon as I type in a char it appears in both but just in the next moment the courser jumps in the name field and continues writing in there. I tried to disable and/or unfocus the password field using jQuery's focus/focusout events as well as autcomplete's autocompleteclose events but none of these worked. My target is a phinegap honegap 1.2.0. app, jQuery 1.18.16 and jqm 1.0 for 2.0+ android. Edit I forget the most important observation. This behaviour only occurs when I select a suggestion which is displayed over the password field. So my assumption is the click/tap event will be fired for both events. autoc

How to call any objective c plugin method on click event of html button

I am new in phonegap development. I have one html page which contains one textfield and one button. I want to call my plugin method -(void)nameOfMethod:( NSMutableArray*)paramArray withDict: (NSMutableDictionary*) options which is inside the my plugin class and it getting text from my html text field and displaying alertview.I don't have have idea how to call this method via a javascript .I did a small part of coding in javascript <head><script type="text/javascript" src="encryptdata.js"></script></head> <body> <input type="password" name="confirmPassword" id="confirmPassword" value="" /> <input type="button" value="FetchR" onclick="fetchRelation()"/> </body> encryptdata.js function fetchRelation() { var getvalue=document.getElementById('confirmPassword').value; //what is next step....... to send the data to the plugin

Using Phonegap Barcode Scanner on Iphone

I'm trying to add a barcode scanner to a JQM phonegap project for iOS. I have followed the instructions listed, although I'm not 100% sure if I did the first and last steps correctly. Copy the .h, .cpp and .mm files to the Plugins directory in your project. You may need to set the compile options for zxing-all-in-one.cc to turn off optimization. I directly copied the three files into the plugins folder in xcode. It isn't giving me any errors, but it also isn't working. I have no idea how to do compiler options in xcode, so I haven't done the last step. Currently my app still runs with no errors and running the scan function opens the camera with the ui for the barcode scanner up. The problem is that it doesn't seem to be either looking for or finding barcodes, it just stays up and does nothing (until you hit cancel, then it displays the cancelled message correctly). Anyone have any ideas what's wrong or where I should look?

Using Phonegap Barcode Scanner on Iphone

I'm trying to add a barcode scanner to a JQM phonegap project for iOS. I have followed the instructions listed, although I'm not 100% sure if I did the first and last steps correctly. Copy the .h, .cpp and .mm files to the Plugins directory in your project. You may need to set the compile options for zxing-all-in-one.cc to turn off optimization. I directly copied the three files into the plugins folder in xcode. It isn't giving me any errors, but it also isn't working. I have no idea how to do compiler options in xcode, so I haven't done the last step. Currently my app still runs with no errors and running the scan function opens the camera with the ui for the barcode scanner up. The problem is that it doesn't seem to be either looking for or finding barcodes, it just stays up and does nothing (until you hit cancel, then it displays the cancelled message correctly). Anyone have any ideas what's wrong or where I should look?

Page is not found by the Iphone simulator when using ajax /Jquery Mobile-PhoneGap

I am creating a webapp for iPhone using jQuery Mobile and PhoneGap. Everything works fine in Safari for Mac and Chrome for Windows. When I go to the iPhone Simulator the problems begin. Every button with a link to any page works fine except for one called "Article.html". The only way to open this page from the app is to turn off ajax by doing rel="external". I have done everything in order to get it work. I have deleted the file and brought it back via add -> existing file with not luck. The content of the page "Article.html" is very simple and I don't think that is the problem because it doesn't even load the page. The loading symbol stays there for ever. <!DOCTYPE html> <html> <head> <!--jquery and css files are being loaded in another page--> <title>This Date in History</title> </head> <body> <div data-role="page" class="type-interior" id=