Showing posts with label phonegap info. Show all posts
Showing posts with label phonegap info. Show all posts

Tuesday, 9 August 2011

New 'Collaborators' Feature for PhoneGap Build

We're pleased to announce that we've added multi-user support to PhoneGap Build so that you can easily add new users to projects for development or testing.

Testers can download apps and developers can change the code, rebuild the app, or do anything short of deleting it. You can, of course, revoke access to your app or change users from developers to testers.

New to PhoneGap Build? It's a cloud-based service that takes the pain out of compiling mobile apps for multiple platforms. Write your app using HTML, CSS or JavaScript, upload it to the PhoneGap Build service and magically get back app-store ready apps for Apple iOS, Google Android, Palm, Symbian, BlackBerry and more.

Haven't tried it yet? Become a beta user!

Friday, 1 July 2011

Example of Position in phonegap

Contains Position coordinates that are created by the geolocation API.Properties coords: A set of geographic coordinates. (Coordinates) timestamp: Creation timestamp for coords in milliseconds. (DOMTimeStamp)DescriptionThe Position object is created and populated by PhoneGap, and returned to the user through a callback function.Supported Platforms Android BlackBerry (OS 4.6) BlackBerry WebWorks (OS 5.0 and higher) iPhone

Thursday, 30 June 2011

Upload a File to a Remote Server with Phonegap

I recently started looking at PhoneGap as a way to build native smartphone applications without having to learn another programming language. The process, so far, has been going very well. I’ve been able to build a basic application with very little trouble. I did, however, hit a big hiccup in development when I decided to try and upload a file from a phone to a remote location.

The unfortunate part of this hiccup was that I think its primary cause is rooted in poor documentation.In this post, I want to explain how I was able to upload a photo from a phone, using PhoneGap (and PHP on the remote server), to a remote server. I am going to assume that you have some knowledge of PhoneGap and already have a method, either the Android SDK or the iPhone SDK, to test your native application.

The HTML / JavascriptRather then use a jQuery Ajax call, I am relying on PhoneGap’s FileTransfer object to post the image to a remote server. The code below is all you need to add to your “index.html” PhoneGap file for a basic upload.

Make sure, if you use the example code below, to add your server’s URL in the appropriately marked place.As you can see, the code above allows you to browse for a photo in the device’s photo library using the function getPhoto(). Once a photo is chosen, it gets POSTed as multi-part data to the server.

You will notice a couple of things. 1. I commented out the options.fileName variable. The default name for an uploaded image is “image.jpg.” Also, I’ve included some test parameters in the upload data which will be POSTed to your server as well, but these are optional.

The PHPNow that you are able to find a file and POST it to a server, you’ll need a server side script to handle the data. Here is a very basic PHP example on handling the multi-part form data (image) that was just sent from the device.

The above code uses PHP’s move_uploaded_file() to move the uploaded file from a temporary location to a new directory. To make sure it works, change “/srv/www/upload/” to a directory on your server. I usually have to pass an absolute file-path as the second variable in the move_uploaded_file() for it to work.

You can learn more about PHP uploads in a previous post of mine.FinishedAbove is a short example of how to upload a file to a remote server using PhoneGap, including how to handle that data once it gets to the server.

Re: [PhoneGap] how to add get applicationDidBecomeActive and didFinishLaunchingWithOptions methods in Phonegap

Use the latest 0.9.6.applicationdidFinishLaunchingWithOptions is there,applicationDidBecomeActive is there but in the subclass PhoneGapDelegate.

For active/inactive events, use the "pause" and "resume" events in javascript instead to handle that event:http://docs.phonegap.com/phonegap_events_events.md.html

On 2011-06-29, at 3:00 AM, Abhi wrote:>
Hi,>>
Native apps on IOS have the following methods>
- (BOOL)application:(UIApplication *)application> didFinishLaunchingWithOptions:
(NSDictionary *)launchOptions>
- (void)applicationDidBecomeActive:(UIApplication *)application>
> but Phonegap.0.9.4 has>
- (void)applicationDidFinishLaunching:(UIApplication *)application>
- (void)webViewDidFinishLoad:(UIWebView *)theWebView //this does not> trigger when app comes to foreground from background>>>>> Pls advice how to add the two triggers in Phonegap platform (required> to implement push notification all scenarios)>
- (BOOL)application:(UIApplication *)application>
didFinishLaunchingWithOptions:(NSDictionary *)launchOptions>
- (void)applicationDidBecomeActive:(UIApplication *)application>> -->

You received this message because you are subscribed to the Google>
Groups "phonegap" group.> To post to this group, send email to phonegap@googlegroups.com>
To unsubscribe from this group, send email to>
phonegap+unsubscribe@googlegroups.com>

For more options, visit this group at>
http://groups.google.com/group/phonegap?hl=en?hl=en> >

For more info on PhoneGap or to download the code go to www.phonegap.com-- You received this message because you are subscribed to the GoogleGroups "phonegap" group.To post to this group, send email to phonegap@googlegroups.com

To unsubscribe from this group, send email tophonegap+unsubscribe@googlegroups.comFor more options, visit this group athttp://groups.google.com/group/phonegap?hl=en?hl=enFor more info on PhoneGap or to download the code go to www.phonegap.com

[PhoneGap] Re: iOS UIWebview - make it faster for PhoneGap!

+1 more to the pile :DOn Jun 29, 6:50 am, Shazron Abdullah wrote:>
Every-time there's a duplicate issue in Apple's Bug Reporter (kinda like voting for it), the more likely it will be implemented next time (we hope). Mine was duped. So please file an issue, it will only take 5 mins :)>>

File an issue athttp://bugreporter.apple.comand login with your Apple ID. Click on "New Problem">> Title: >

UIWebview: should support Nitro Javascript>> Product:> iPhone SDK>> Classification:> Feature (New)>> Description:> Enable Nitro Javascript for the UIWebview component, like Mobile Safari and home-screen web-apps.--

You received this message because you are subscribed to the GoogleGroups "phonegap" group.To post to this group, send email to phonegap@googlegroups.com

To unsubscribe from this group, send email tophonegap+unsubscribe@googlegroups.comFor more options, visit this group athttp://groups.google.com/group/phonegap?hl=en?hl=enFor more info on PhoneGap or to download the code go to www.phonegap.com

[PhoneGap] Re: Calling plugin method synchronously

Here is my correspondence with ShazronYou can use static libraries only, no third-party dynamic librariesare allowed. Apple's dynamic libraries are allowed of course (thingslike UIKit, etc that are part of the SDK) but not your own.- Hide quoted text -On Tue, Jun 28, 2011 at 5:01 AM, Sumedh wrote:> Hi Shazron,>> I wanted to know whether i can use shared libraries with phonegap plugins.>> What about Dynamic link Libraries, are they allowed as part of an iphone> app. I am not getting appropriate information about this.>> thanks.>> On Mon, Jun 27, 2011 at 6:03 PM, Sumedh wrote:>>>> Thanks sir.>>>>>> On Mon, Jun 27, 2011 at 5:31 PM, Shazron Abdullah>> wrote:>>>>>> Also i see PhoneGap uses UIWebvVew, so there are limits on scripts>>> executions, like 10 sec and 10 MB, can we set this values?>>>>>> No.>>>>>> Can i build my custom webkit for ios, so that i can have access to>>> jscore. I have done it on windows, and linux... I hope i can do same for MAC>>> OSX, but don't have any idea about IOS. Can you throw some light on this?>>>>>> You could. Look at the Couchbase (CouchDB) for iOS project, might be some>>> info there.********************************No, everything is async. It's a limitation on how PhoneGap works (atleast on iOS). For Android, it's possible but I'm not familiar withit.--Shazron AbdullahOn Monday, June 27, 2011 at 3:30 AM, Sumedh wrote:> Hi Shazron,>> I was going through plugins, all available plugin examples utility functions seems to be called in a thread and then return back the result in callback. Can i have a plugin which will return back the result to the caller, for which i hope call to plugin utility functions should be in the same thread.>> Hoping for a reply. Thanks.-- You received this message because you are subscribed to the GoogleGroups "phonegap" group.To post to this group, send email to phonegap@googlegroups.comTo unsubscribe from this group, send email tophonegap+unsubscribe@googlegroups.comFor more options, visit this group athttp://groups.google.com/group/phonegap?hl=en?hl=enFor more info on PhoneGap or to download the code go to www.phonegap.com

Re: [PhoneGap] Coverage Into using Phonegap.

Hey Drew,You are right. I didn't execute "document.addEventListener("deviceready", onDeviceReady, false);" in the HTML file. Rather this was called in another file.

Now I got it working. Thanks for all your time :)--
You received this message because you are subscribed to the GoogleGroups "phonegap" group.

To post to this group, send email to phonegap@googlegroups.com
To unsubscribe from this group, send email tophonegap+unsubscribe@googlegroups.com
For more options, visit this group athttp://groups.google.com/group/phonegap?hl=en?hl=en
For more info on PhoneGap or to download the code go to www.phonegap.com

[PhoneGap] Re: BlackBerry WebWorks - eclipse Issues

Hi,1. I'm using blackberry.app.exit() in my BB-Webworks App. and it is working for me.2. Here is the sample code for JS-WSDL communication. function wssample(){try{var oXmlHttp = new XMLHttpRequest(); // Create a function that will receive data sent from the serveroXmlHttp.onreadystatechange = function(){if(oXmlHttp.readyState == 4){alert(oXmlHttp.responseText);}};oXmlHttp.open("POST", "http://10.55.55.55/AuthenticationService.svc", false); oXmlHttp.setRequestHeader("Content-Type", "text/xml"); oXmlHttp.setRequestHeader("SOAPAction", "http://tempuri.org/IAuthenticationService/AuthenticateUser"); var str=" \ \ \ \ adminadmin \ admin \ \ \ \"; oXmlHttp.send(str); }catch(e){document.getElementById("ex").innerHTML = "Exception- "+e.toString(); }}Do not forget to add the url in config.xml-- You received this message because you are subscribed to the GoogleGroups "phonegap" group.To post to this group, send email to phonegap@googlegroups.comTo unsubscribe from this group, send email tophonegap+unsubscribe@googlegroups.comFor more options, visit this group athttp://groups.google.com/group/phonegap?hl=en?hl=en For more info on PhoneGap or to download the code go to www.phonegap.com

[PhoneGap] Re: how to add get applicationDidBecomeActive and didFinishLaunchingWithOptions methods in Phonegap

cd ~/Documents/phonegap-iphone/git remote updategit merge origin/mastermake, reinstall the pkg, reload, clean & rebuildOn Jun 30, 10:40 am, Abhilash Vijayakumar wrote:> Ok thank you. Any recommended way to convert an existing Phonegap.0.9.4 app> to Phonegap.0.9.6 app> Can Phonegap0.9.4 and 0.9.6 templates co-exist in xcode3.2.6 ?> Pls advice> Regards> Abhilash Vijayakumar>> On Wed, Jun 29, 2011 at 6:17 PM, Shazron Abdullah <>>>> shazron.abdul...@nitobi.com> wrote:> > Use the latest 0.9.6.> > applicationdidFinishLaunchingWithOptions is there,> > applicationDidBecomeActive is there but in the subclass PhoneGapDelegate.>> > For active/inactive events, use the "pause" and "resume" events in> > javascript instead to handle that event:> >http://docs.phonegap.com/phonegap_events_events.md.html>> > On 2011-06-29, at 3:00 AM, Abhi wrote:>> > > Hi,>> > > Native apps on IOS have the following methods> > > - (BOOL)application:(UIApplication *)application> > > didFinishLaunchingWithOptions:(NSDictionary *)launchOptions> > > - (void)applicationDidBecomeActive:(UIApplication *)application>> > > but Phonegap.0.9.4 has> > > - (void)applicationDidFinishLaunching:(UIApplication *)application> > > - (void)webViewDidFinishLoad:(UIWebView *)theWebView //this does not> > > trigger when app comes to foreground from background>> > > Pls advice how to add the two triggers in Phonegap platform (required> > > to implement push notification all scenarios)> > > - (BOOL)application:(UIApplication *)application> > > didFinishLaunchingWithOptions:(NSDictionary *)launchOptions> > > - (void)applicationDidBecomeActive:(UIApplication *)application>> > > --> > > You received this message because you are subscribed to the Google> > > Groups "phonegap" group.> > > To post to this group, send email to phonegap@googlegroups.com> > > To unsubscribe from this group, send email to> > > phonegap+unsubscribe@googlegroups.com> > > For more options, visit this group at> > >http://groups.google.com/group/phonegap?hl=en?hl=en>> > > For more info on PhoneGap or to download the code go towww.phonegap.com>> > --> > You received this message because you are subscribed to the Google> > Groups "phonegap" group.> > To post to this group, send email to phonegap@googlegroups.com> > To unsubscribe from this group, send email to> > phonegap+unsubscribe@googlegroups.com> > For more options, visit this group at> >http://groups.google.com/group/phonegap?hl=en?hl=en>> > For more info on PhoneGap or to download the code go towww.phonegap.com-- You received this message because you are subscribed to the GoogleGroups "phonegap" group.To post to this group, send email to phonegap@googlegroups.comTo unsubscribe from this group, send email tophonegap+unsubscribe@googlegroups.comFor more options, visit this group athttp://groups.google.com/group/phonegap?hl=en?hl=enFor more info on PhoneGap or to download the code go to www.phonegap.com

[PhoneGap] Re: emailComposer plugin

On Nov 2, 7:18 pm, Nick McCloud wrote:> You will need to add MessageUI.framework to your project if it is not> already included.>> Just add the .m.h files to your project ( you can add them directly to> your own project, you don't need to put them in phonegap lib ).>> Place the .js file in your app root, and include it from your html.>> This is intended to also demonstrate how to pass arguments to native> code using the options/map object. Please review the js file to> understand the interface you can call, and reply with any questions.>> On Nov 2, 4:45 pm, jamie_mcdonnell wrote:>>>> > Hi there,>> > can anyone please post a simple example for implementing the> > emailComposrer plugin?>> > It would really help me / others get going...>> > Many thanks>> > Jamie-- You received this message because you are subscribed to the GoogleGroups "phonegap" group.To post to this group, send email to phonegap@googlegroups.comTo unsubscribe from this group, send email tophonegap+unsubscribe@googlegroups.comFor more options, visit this group athttp://groups.google.com/group/phonegap?hl=en?hl=enFor more info on PhoneGap or to download the code go to www.phonegap.com

Sunday, 26 June 2011

camera tutorial (phonegap)

Capture

Provides access to the audio, image, and video capture capabilities of the device.

Objects

Capture
CaptureAudioOptions
CaptureImageOptions
CaptureVideoOptions
CaptureCB
CaptureErrorCB
ConfigurationData
MediaFile
MediaFileData

Methods

capture.captureAudio
capture.captureImage
capture.captureVideo
MediaFile.getFormatData

Scope

The capture object is assigned to the navigator.device object, and therefore has global scope.

// The global capture object
var capture = navigator.device.capture;

Properties

supportedAudioModes: The audio recording formats supported by the device. (ConfigurationData[])
supportedImageModes: The recording image sizes and formats supported by the device. (ConfigurationData[])
supportedVideoModes: The recording video resolutions and formats supported by the device. (ConfigurationData[])

Methods

capture.captureAudio: Launch the device audio recording application for recording audio clip(s).
capture.captureImage: Launch the device camera application for taking image(s).
capture.captureVideo: Launch the device video recorder application for recording video(s).

Supported Platforms

Android
BlackBerry WebWorks (OS 5.0 and higher)

capture.captureAudio

Start the audio recorder application and return information about captured audio clip file(s).

navigator.device.capture.captureAudio(
CaptureCB captureSuccess, CaptureErrorCB captureError, [CaptureAudioOptions options]
);

Description

This method starts an asynchronous operation to capture audio recordings using the device's default audio recording application. The operation allows the device user to capture multiple recordings in a single session.

The capture operation ends when either the user exits the audio recording application, or the maximum number of recordings, specified by the limit parameter in CaptureAudioOptions, has been reached. If no value is provided for the limit parameter, a default value of one (1) is used, and the capture operation will terminate after the user records a single audio clip.

When the capture operation is finished, it will invoke the CaptureCB callback with an array of MediaFile objects describing each captured audio clip file. If the operation is terminated by the user before an audio clip is captured, the CaptureErrorCB callback will be invoked with a CaptureError object with the CaptureError.CAPTURE_NO_MEDIA_FILES error code.
Supported Platforms

Android
BlackBerry WebWorks (OS 5.0 and higher)

Quick Example

// capture callback
var captureSuccess = function(mediaFiles) {
var i, path, len;
for (i = 0, len = mediaFiles.length; i < len; i += 1) { path = mediaFiles[i].fullPath; // do something interesting with the file } }; // capture error callback var captureError = function(error) { navigator.notification.alert('Error code: ' + error.code, null, 'Capture Error'); }; // start audio capture navigator.device.capture.captureAudio(captureSuccess, captureError, {limit:2}); Full Example


Capture Audio







Twitter Delicious Facebook Digg Stumbleupon Favorites More