tag:blogger.com,1999:blog-72386855013225666.post2093721151453589170..comments2023-04-18T05:16:02.299-04:00Comments on Simon Mac Donald: What's New in PhoneGap Android 2.2.0Simon MacDonaldhttp://www.blogger.com/profile/14749383583517044214noreply@blogger.comBlogger56125tag:blogger.com,1999:blog-72386855013225666.post-21410989502431166192013-02-20T09:52:48.016-05:002013-02-20T09:52:48.016-05:00This comment has been removed by the author.Simon MacDonaldhttps://www.blogger.com/profile/14749383583517044214noreply@blogger.comtag:blogger.com,1999:blog-72386855013225666.post-53753466636901011912013-02-20T09:52:12.522-05:002013-02-20T09:52:12.522-05:00@Mohsin Qureshi
Are you sure that "/data/dat...@Mohsin Qureshi<br /><br />Are you sure that "/data/data/com.suave.nexttrainer/app_database/file_0/0000000001.db" actually exists? If you run "adb shell" then cd to "/data/data/com.suave.nexttrainer/app_database/file_0" do you see the file? You'll have to do that on the emulator if you don't have a rooted phone.Simon MacDonaldhttps://www.blogger.com/profile/14749383583517044214noreply@blogger.comtag:blogger.com,1999:blog-72386855013225666.post-31680883129501053452013-02-20T04:55:12.110-05:002013-02-20T04:55:12.110-05:00i do like that but in my log cat it shows this .
i...i do like that but in my log cat it shows this .<br />its the path of sever on which i have to upload the database file "http://nextrainer.com/nexdbbackup/upload.php"<br /><br /><br />02-20 01:50:51.194: E/FileTransfer(1624): {"target":"http:\/\/nextrainer.com\/nexdbbackup\/upload.php","source":"file:\/\/\/data\/data\/com.suave.nexttrainer\/app_database\/file_0\/0000000001.db","code":1}<br />02-20 01:50:51.194: E/FileTransfer(1624): java.io.FileNotFoundException: /data/data/com.suave.nexttrainer/app_database/file_0/0000000001.db: open failed: ENOENT (No such file or directory)<br />Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-72386855013225666.post-61163855761764613502013-02-19T11:22:26.421-05:002013-02-19T11:22:26.421-05:00@Mohsin Qureshi
Two things:
1) try using
"...@Mohsin Qureshi<br /><br />Two things:<br /><br />1) try using <br /><br />"var imageURI = "file:///data/data/com.suave.nexttrainer/app_database/file_0/0000000001.db"; <br /><br />2) Is com.suave.netxtrainer your app package? Because only that app can read from that directory.Simon MacDonaldhttps://www.blogger.com/profile/14749383583517044214noreply@blogger.comtag:blogger.com,1999:blog-72386855013225666.post-81959413637561417992013-02-19T09:28:40.460-05:002013-02-19T09:28:40.460-05:00how can i send you my code whats your email?
funct...how can i send you my code whats your email?<br />function uploadPicture() {<br /> alert('uploading file');<br /> // Get URI of picture to upload<br /> var img = document.getElementById('camera_image');<br /> // var imageURI = img.src;<br /> <br /> //"/data/data/com.suave.nexttrainer/app_database/file_0/0000000001.db";<br /> <br /> var imageURI = "/data/data/com.suave.nexttrainer/app_database/file_0/0000000001.db";<br /> <br /> <br /> alert(imageURI);<br /> /* if (!imageURI || (img.style.display == "none")) {<br /> document.getElementById('camera_status').innerHTML = "Take picture or select picture from library first.";<br /> return;<br /> }*/<br /> <br /> // Verify server has been entered<br /> server = document.getElementById('serverUrl').value;<br /> alert('server');<br /> if (server) {<br /> <br /> // Specify transfer options<br /> var options = new FileUploadOptions();<br /> options.fileKey="file";<br /> options.fileName=imageURI.substr(imageURI.lastIndexOf('/')+1);<br /> options.mimeType="image/jpeg";<br /> options.chunkedMode = false;<br /><br /> // Transfer picture/file to server<br /> var ft = new FileTransfer();<br /> alert('ft');<br /> ft.upload(imageURI, server, function(r) {<br /> document.getElementById('camera_status').innerHTML = "Upload successful: "+r.bytesSent+" bytes uploaded."; <br /> }, function(error) {<br /> document.getElementById('camera_status').innerHTML = "Upload failed: Code = "+error.code; <br /> }, options);<br /> }Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-72386855013225666.post-26778462370302195462013-02-19T09:20:57.484-05:002013-02-19T09:20:57.484-05:00@Mohsin Qureshi
Show some code.@Mohsin Qureshi<br /><br />Show some code.Simon MacDonaldhttps://www.blogger.com/profile/14749383583517044214noreply@blogger.comtag:blogger.com,1999:blog-72386855013225666.post-7190424331358443812013-02-19T05:38:55.900-05:002013-02-19T05:38:55.900-05:00i am uploading 000000001.db file to server by usin...i am uploading 000000001.db file to server by using file transfer api of phonegap but it gives me error <br />file not found error code=1<br />can anyone help me out how to get rid of this fucking things. Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-72386855013225666.post-60656878719973691312013-02-07T16:17:15.653-05:002013-02-07T16:17:15.653-05:00Thank you Simon! It is comforting to know that I w...Thank you Simon! It is comforting to know that I was not wrong.. Even if my problem is still there! :)<br />I'll try your VideoPlayer plugin for sure: I read many beatiful comments about it and i'm looking forward to try it! I really hope it will help me with my app! I'll let you know.<br />Thank you very much!Gabrielehttps://www.blogger.com/profile/12624184672396783944noreply@blogger.comtag:blogger.com,1999:blog-72386855013225666.post-88661556572797231032013-02-07T08:58:49.420-05:002013-02-07T08:58:49.420-05:00@Gabriele
Welcome to Android fragmentation. If y...@Gabriele <br /><br />Welcome to Android fragmentation. If you want a consistent, unfortunately fullscreen, appearance you could use my VideoPlayer plugin.<br />Simon MacDonaldhttps://www.blogger.com/profile/14749383583517044214noreply@blogger.comtag:blogger.com,1999:blog-72386855013225666.post-80825497518825682232013-02-06T14:58:53.442-05:002013-02-06T14:58:53.442-05:00Hi, I appreciate very much the improvements made o...Hi, I appreciate very much the improvements made on html5 video tag support. <br />I spent the last couple of days (and nights) facing problems related to the integration of a video in an Android PhoneGap Application i'm developing. My base platform is Android 4.0.3 and 4.0.4. <br />After finding the correct encoding (webm video) I realized that the video playback result is actually very different from one device to another. In my Asus Transformer (as well as on Samsung Galaxy Note) the video is rendered inline in the phonegap webview (the video is inside the page and has the correct size, set to 320x180 pixels, just for example). The, very excited by this incredible result, I tested my app on another device (Zenithink ZPad C91 tablet) and the video is shown fullscreen... :'( <br />Checking the LogCat I fount this:<br />MediaPlayer error(-38, 0)<br />setScreenOnWhilePlaying(true) is ineffective without a SurfaceHolder<br /><br />I googled a little bit but I can't figure out what is wrong. Maybe you can give me a clue or can suggest how to fix this problem.<br /><br />Do you plan to work on phonegap and video tag support?<br /><br />Thankyou very much<br /><br />Best RegardsGabrielehttps://www.blogger.com/profile/12624184672396783944noreply@blogger.comtag:blogger.com,1999:blog-72386855013225666.post-3616621368729240542013-02-05T09:20:55.187-05:002013-02-05T09:20:55.187-05:00@Tommi Joutsiniemi
No worries, just happy it is ...@Tommi Joutsiniemi <br /><br />No worries, just happy it is working for you.Simon MacDonaldhttps://www.blogger.com/profile/14749383583517044214noreply@blogger.comtag:blogger.com,1999:blog-72386855013225666.post-61472729711355221582013-02-05T09:19:28.865-05:002013-02-05T09:19:28.865-05:00ta-DAA!
screenSize did it, thank you so much!
I ...ta-DAA!<br /><br />screenSize did it, thank you so much!<br /><br />I have a simple app which was generated with the latest ST ("sencha generate"), and merged to a newly generated PhoneGap project ("create" in PhoneGap). (BTW, the magic was to have www and android folders side by side at app's root, and then make a symbolic link from android/assets/www point to that www - that way it should be relatively easy to use that same www folder on a possible future iPhone version of the app.)<br /><br />Anyway, here's how I probably managed to get confused: I had 2.2 as the target SDK at some point (initially, after I generated the skeleton), and I had to edit the manifest to make my app work. Then when I changed the target SDK to v4.2 I undid those changes but apparently forgot to bring back screenSize.<br /><br />I hope I didn't blame PhoneGap at any point, it works perfectly...<br /><br />Thank You again<br /><br />Cheers<br />Tommi<br />Anonymoushttps://www.blogger.com/profile/05121889633878339454noreply@blogger.comtag:blogger.com,1999:blog-72386855013225666.post-73282488615978286122013-02-05T09:02:31.076-05:002013-02-05T09:02:31.076-05:00@Tommi Joutsiniemi
You are missing "screenS...@Tommi Joutsiniemi <br /><br />You are missing "screenSize" from the config changes. I guess I wasn't clear about the API level thing. When you target 17 you can have screenSize in the manifest without impacting your ability to run on an API 7 level phone. Try adding it in and seeing if the problem goes away. Simon MacDonaldhttps://www.blogger.com/profile/14749383583517044214noreply@blogger.comtag:blogger.com,1999:blog-72386855013225666.post-79003565647742289662013-02-05T04:07:41.531-05:002013-02-05T04:07:41.531-05:00My AndroidManifest.xml:
https://dl.dropbox.com/u/5...My AndroidManifest.xml:<br />https://dl.dropbox.com/u/5306505/AndroidManifest.xml<br /><br />I tested my app on v2.2 emulator and reorientation works OK. On my v4.1 HTC one X device it doesn't. Do you think I should create a v4.2 emulator and find a v2.2 device to test... would that reveal something, possibly?Anonymoushttps://www.blogger.com/profile/05121889633878339454noreply@blogger.comtag:blogger.com,1999:blog-72386855013225666.post-14720225362851734422013-01-31T09:16:01.617-05:002013-01-31T09:16:01.617-05:00@Tommi Joutsiniemi
Paste up your manifest somewh...@Tommi Joutsiniemi <br /><br />Paste up your manifest somewhere I can take a look. Don't do it in the comments as it doesn't accept xml.Simon MacDonaldhttps://www.blogger.com/profile/14749383583517044214noreply@blogger.comtag:blogger.com,1999:blog-72386855013225666.post-11045275083720030662013-01-31T08:36:47.151-05:002013-01-31T08:36:47.151-05:00That is exactly how I do it. But still, this must ...That is exactly how I do it. But still, this must be a problem in my setup if nobody else has this reload problem. I just have no idea where to look. I am using Sencha Touch 2.1 commercial and phonegap 2.3.0 (also tested with 2.4.0rc1). I basically have the default Sencha-generated app with PhoneGap integration.<br /><br />Cheers<br />Tommi<br />Anonymoushttps://www.blogger.com/profile/05121889633878339454noreply@blogger.comtag:blogger.com,1999:blog-72386855013225666.post-50399096089222910872013-01-31T08:19:30.048-05:002013-01-31T08:19:30.048-05:00@Tommi Joutsiniemi
It sounds like you are doing ...@Tommi Joutsiniemi <br /><br />It sounds like you are doing it wrong. You should always build with the latest SDK in this case API level 17. Then you can set a minimum SDK of 7. This will allow you to have all of those config changes I mentioned in your manifest and you app will work on Android 2.1 or greater.Simon MacDonaldhttps://www.blogger.com/profile/14749383583517044214noreply@blogger.comtag:blogger.com,1999:blog-72386855013225666.post-34858689641044726902013-01-31T05:06:15.769-05:002013-01-31T05:06:15.769-05:00Yes, I applied the android:configChanges into my m...Yes, I applied the android:configChanges into my main activity, but without screenSize, because my minimum SDk version is 7. I also had to remove hardware acceleration from the manifest for the same reason.<br /><br />Still no fix, my app reloads completely when I reorient the device.<br />Anonymoushttps://www.blogger.com/profile/05121889633878339454noreply@blogger.comtag:blogger.com,1999:blog-72386855013225666.post-13765366414949598822013-01-30T16:23:53.371-05:002013-01-30T16:23:53.371-05:00@Tommi Joutsiniemi
Did you apply the following c...@Tommi Joutsiniemi <br /><br />Did you apply the following config changes to your main activity?<br /><br />android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale"Simon MacDonaldhttps://www.blogger.com/profile/14749383583517044214noreply@blogger.comtag:blogger.com,1999:blog-72386855013225666.post-80053460264754356352013-01-30T16:18:50.406-05:002013-01-30T16:18:50.406-05:00Prasad Wagh described how the app always reloads c...Prasad Wagh described how the app always reloads completely on orientation change - is there a fix for that?<br /><br />I am having trouble with the orientation always reloading my app completely.<br /><br />Thank YouAnonymoushttps://www.blogger.com/profile/05121889633878339454noreply@blogger.comtag:blogger.com,1999:blog-72386855013225666.post-30300680153028598672012-12-30T21:45:52.144-05:002012-12-30T21:45:52.144-05:00@Mayur Panchal
It is possible but I've never...@Mayur Panchal <br /><br />It is possible but I've never done it. I really hate Facebook. You should try Dave's plugin:<br /><br />https://github.com/davejohnson/phonegap-plugin-facebook-connect/Simon MacDonaldhttps://www.blogger.com/profile/14749383583517044214noreply@blogger.comtag:blogger.com,1999:blog-72386855013225666.post-82894499118186518802012-12-28T02:10:08.071-05:002012-12-28T02:10:08.071-05:00Hi Simon,
Is it possible to "integrate facebo...Hi Simon,<br />Is it possible to "integrate facebook check in functionality " in phonegap ..?Anonymoushttps://www.blogger.com/profile/11468451201347583492noreply@blogger.comtag:blogger.com,1999:blog-72386855013225666.post-25773917863280028002012-12-11T11:05:52.090-05:002012-12-11T11:05:52.090-05:00Thanks a lot Simon.Thanks a lot Simon.Akorede Ismael Olusola Enitan Jimohhttps://www.blogger.com/profile/14332657754156692524noreply@blogger.comtag:blogger.com,1999:blog-72386855013225666.post-76781561494097663642012-12-10T10:24:19.956-05:002012-12-10T10:24:19.956-05:00@Akorede Ismael Olusola Enitan Jimoh
It's pre...@Akorede Ismael Olusola Enitan Jimoh<br /><br />It's pretty obvious from the error: " ReferenceError: loadingStatus is not defined". In a nutshell that means that object has not been created at the point you are trying to use it.Simon MacDonaldhttps://www.blogger.com/profile/14749383583517044214noreply@blogger.comtag:blogger.com,1999:blog-72386855013225666.post-73445040734717527652012-12-10T05:37:37.018-05:002012-12-10T05:37:37.018-05:00Hi Simon,
Please I am creating a fileUpload with ...Hi Simon,<br /><br />Please I am creating a fileUpload with the code below:<br /><br /><br />File Transfer Example<br /><br /><br /> // Wait for Cordova to load<br /> //<br /> document.addEventListener("deviceready", onDeviceReady, false);<br /><br /> // Cordova is ready<br /> //<br /> function onDeviceReady() {<br /><br /> // Retrieve image file location from specified source<br /> navigator.camera.getPicture(uploadPhoto,<br /> function(message) { alert('get picture failed'); },<br /> { quality: 50, <br /> destinationType: navigator.camera.DestinationType.FILE_URI,<br /> sourceType: navigator.camera.PictureSourceType.PHOTOLIBRARY }<br /> );<br /><br /> }<br /><br /> function uploadPhoto(imageURI) {<br /> var options = new FileUploadOptions();<br /> options.fileKey="file";<br /> options.fileName=imageURI.substr(imageURI.lastIndexOf('/')+1);<br /> options.mimeType="image/jpeg";<br /><br /> var params = {};<br /> params.value1 = "test";<br /> params.value2 = "param";<br /><br /> options.params = params;<br /><br /> var ft = new FileTransfer();<br /> ft.onprogress = function(progressEvent) {<br /> if (progressEvent.lengthComputable) {<br /> loadingStatus.setPercentage(progressEvent.loaded / progressEvent.total);<br /> } else {<br /> loadingStatus.increment();<br /> }<br /> };<br /> ft.upload(imageURI, encodeURI("http://some.server.com/upload.php"), win, fail, options);<br /> }<br /><br /> function win(r) {<br /> console.log("Code = " + r.responseCode);<br /> console.log("Response = " + r.response);<br /> console.log("Sent = " + r.bytesSent);<br /> }<br /><br /> function fail(error) {<br /> alert("An error has occurred: Code = " + error.code);<br /> console.log("upload error source " + error.source);<br /> console.log("upload error target " + error.target);<br /> }<br /><br /><br /><br />However getting the following error: Web Console(9547): processMessage failed: Stack: ReferenceError: loadingStatus is not defined.<br /><br />Please am I doing something wrong here: I am aware the link is just a sample link but the error is pointed at loadingStatus?<br /><br />Thanks.<br /><br />IsmaelAkorede Ismael Olusola Enitan Jimohhttps://www.blogger.com/profile/14332657754156692524noreply@blogger.com