Commit Graph

468 Commits

Author SHA1 Message Date
Joe Bowser
431c80782e Changing the layout class so it has the screen dimensions to take into account Device Orientation 2011-05-31 15:38:03 -07:00
macdonst
9036eb8fcc Issue #94: feature request: Event for Keyboard show/hide 2011-05-30 15:12:31 -04:00
Fil Maj
4280fdf252 Fix for ticket #58: Certain 1.5/1.6 devices would throw a FileNotFoundException when taking pictures. Patch submitted by Agustin of AVANTIC (thanks!). 2011-05-26 12:42:44 -07:00
macdonst
ca5e141b5b Changing Media class to return seconds
The media commands getCurrentPosition() and getDuration() will now return seconds (float) instead of milliseconds to line up with iOS and the docs.
2011-05-27 01:54:48 +08:00
macdonst
1d79b6617b JavaScript cleanup to pass jsHint
I did my best to clean up the JavaScript so it would pass through jsHint more cleanly.  There still are issues but there are a lot fewer now.  This helped to make the JS code more consistent.
2011-05-21 02:31:24 +08:00
macdonst
6c3eefe6f9 Issue #85: window.openDatabase throws DOM Exception 18 on Android 3.1
Instead of checking the userAgent catch the exception.  If we do get an exception it will setup our version of Droid Db.
2011-05-21 02:13:03 +08:00
macdonst
2177cd0a39 Moving navigator.connection to navigator.device.connection
Android 2.2 introduces the navigation.connection interface but it does not work properly in WebView.  So in order to get the proper connection information we had to implement our own connection interface which is accessible at navigator.network.connection.
2011-05-18 03:26:31 +08:00
macdonst
6618015151 Fixing a number of issues in File API
Issue #82: The RandomAccessFile class in Android's version of Java does not write non-ASCII characters very well.  I've switched to using a FileOutputStream which seems to work just great.  Tested by myself and folks from Egypt and the Netherlands.

Issue #87: Fixed a problem where the file errors were being returned as evt.target.result.code.code.
2011-05-17 22:11:38 +08:00
macdonst
e99f75d59b Issue #85: window.openDatabase throws DOM Exception 18 on Android 3.1
The way were were detecting we were on an Android 3.0 device was not applicable for Android 3.1.  I've made and update so that any Android 3.X device will use our implementation of web sql databases instead of the built in one which thows a security error.
2011-05-16 23:14:24 +08:00
macdonst
ab8cfe01d0 Removing generated code from project
framework/gen/com/phonegap/R.java
2011-05-16 10:37:25 +08:00
macdonst
e84c59d23c Merge pull request #78 from kernelsandirs/master
Added Media.seekTo(int milliseconds);

Merging this code in now and making some notes to enhance the Media class.
2011-05-15 19:32:02 -07:00
macdonst
e81fc239a7 Setting defaults in Media Capture
Some tests of Media Capture were failing as the CaptureAudio/Image/VideoOptions objects did not have defaults set.
2011-05-14 01:10:18 +08:00
Bryce Curtis
839c577243 Need to use EclairClient for 3.x devices too. This fixes the HTML5 geolocation problem on Android 3.x. 2011-05-10 11:44:09 -05:00
macdonst
116169a4c5 Issue #79: FileWriter.seek() is broken in 0.9.5.
The FileEntry.createWriter() method passes in a FileEntry object instead of a File object. As a result the FileWriter.length was not being set properly so when you do a writer.seek(writer.length) it would go to 0, so your next write would overwrite your file.

In order to fix this issue the FileEntry.createWriter() method now makes a call to FileEntry.file() to get the correct file size.  The File object is now passed to the FileWriter constructor.
2011-05-07 00:41:57 +08:00
macdonst
346ed60f0d Android 2.2+ supports W3C Connection API
For Android version 2.2 or better the navigator.connection object already
exists. If this case we should immediately fire the onPhoneGapConnectionReady
event so we don't tie up the 'deviceready' event.
2011-05-06 04:22:38 +08:00
defrex
bde59adc04 Add docs and fixed to pass through the Google Closure Compiler without warnings 2011-05-04 16:00:03 -07:00
kernelsandirs
ffbc010d7b Added Media.seekTo(int milliseconds); 2011-05-04 11:51:26 -07:00
macdonst
bdadbbc339 Implement W3C Network Information API
Adding a new object to navigator called 'connection'.  Users can query the
connection object to find out what type of network, if any, the device is
connected to.  The connection object will be updated each time there is a
connectivity change on the device.
2011-05-04 22:23:16 +08:00
kernelsandirs
b94eedaf07 Added Media.seekTo(int milliseconds); 2011-05-03 21:27:08 -07:00
macdonst
58ecac335b Capture modifications:
Renaming supportedAudioFormats to supportedAudioModes.
Renaming supportedImageFormats to supportedImageModes.
Renaming supportedVideoFormats to supportedVideoModes.
Adding copywrite header to the Capture.java file.
2011-05-03 00:12:19 +08:00
macdonst
fd8bb2f671 Issue 72: Contact.Save: onSuccess callback is called when contact is not saved. 2011-04-29 02:08:25 +08:00
Bryce Curtis
0aacfbdd50 Update version to 0.9.5 2011-04-27 14:10:13 -05:00
macdonst
2cd116e4e7 Issue 60: Contact search unicode problem
Contact search was not working for unicode letters.  The CallbackServer was changed so that it returned url encode strings.  On the JavaScript side the PhoneGap callback handler decodes the returned string.
2011-04-25 22:22:12 +08:00
Bryce Curtis
673a8871df Ticket 136: window.openDatabase() in Android 3.0 throws SECURITY_ERR (most code written by Simon MacDonald - I just tested and checked in)
When you call window.openDatabase() on an Android 3.0 device you get and error something like this:

E/Web Console( 1791): SECURITY_ERR: DOM Exception 18: An attempt was made to break through the security policy of the user agent.

Simon worked with Pat for a bit and they think this is a WebKit or Android/WebKit interaction bug. In the meantime this fix determines if you are on Android 3.0 and uses Droid_DB if so.
2011-04-19 16:54:16 -05:00
Fil Maj
44945f9d5e Partial resolution for ticket 57: some issues with camera functionality not firing callbacks properly. 2011-04-18 18:12:01 -07:00
Roman
887f754014 Hidden NPE fixed, which appeared when someone pass null as arguments
(for such SQL as e.g. CREATE TABLE).

It is especially important when work with dome 3d party persistemce
libraries, like e.g. http://github.com/zefhemel/persistencejs which
passes these nulls.
2011-04-18 17:02:55 -07:00
macdonst
674015460f Fixing file commands so that they run async 2011-04-13 03:13:10 +08:00
macdonst
40084293c3 Ticket 127: Android FileReader/FileWriter methods should return FileError object on error. 2011-04-07 07:17:41 +08:00
Fil Maj
ed4c57e791 Woops, finger slipped. 2011-04-06 11:01:36 -07:00
Fil Maj
bf164f4161 Fix for ticket 121: Checking for null return on native openDatabase call not enough as only allowed one DB per PhoneGap app. Have to proxy openDatabase and check at runtime. 2011-04-06 10:50:24 -07:00
Bryce Curtis
626119ae3b Bug 126: NullPointerException in onDestroy() 2011-04-05 15:42:25 -05:00
macdonst
e766188689 W3C Media Capture API
An implementation of the W3C Media Capture spec:
http://dev.w3.org/2009/dap/camera/Overview-API

Capture operations are supported for audio, video, and images.  Each
capture operation launches the native audio recorder, video recorder,
or camera application, respectively.
2011-04-01 15:52:53 -04:00
macdonst
d74569ffa7 Read As Text missing load event call
FileReader.readAsText didn't call the onload callback on success.
2011-04-01 23:04:14 +08:00
macdonst
d424af03e4 Ticket 124: File Transfer multipart badly formed trips mod_security
A standard from has no trailing whitespace after a content-disposition line like so: "Content-Disposition: form-data; name="data";" however when using the extra params of Android FileTransfer a space is added on the end "Content-Disposition: form-data; name="data"; "

This fix simply removes the trailing whitespace.
2011-04-01 22:43:38 +08:00
Bryce Curtis
f6f80537c3 Merge branch 'master' of https://github.com/jos3000/phonegap-android into jos3000-master 2011-03-30 13:48:51 -05:00
Bryce Curtis
908485751b Add check to only init and run JS code once - even if included multiple times. 2011-03-30 13:29:24 -05:00
macdonst
b850d225f4 Support old way of adding service in PhoneGap 0.9.5
PhoneGap 0.9.4 replaced PluginManager.addService() with navigator.app.addService().  This is problematic with the older plugin as they are not being maintained.  I'm adding in a PluginManger JavaScript class which will implement the addService method and call navigator.app.addService() method under the hood.  This way we won't break old code.
2011-03-30 21:04:03 +08:00
Jos Shepherd
010c774988 Added native prompt() dialog support 2011-03-25 16:31:27 +00:00
macdonst
969f0c87d7 PhoneGap Android Ticket 113:
FileTransfer returns FILE_NOT_FOUND_ERR on http 500 error

For some reason on Android if you do a getInputStream() on a HTTP Connection and the server returns a 500 error it will report a FileNotFoundException.  Catching this exception and throwing an IOException so that we can report a more accurate error in JavaScript.
2011-03-24 23:31:12 +08:00
Fil Maj
b3e9794189 Fix for lighthouse ticket 115: certain versions of Android 2.2 return "null" for window.openDatabase. Hook in PhoneGap fallback for storage in this case. 2011-03-23 11:07:45 -07:00
Bryce Curtis
935295c9b8 Bug 110 - When you close an app on Android you see a JS error in logcat. 2011-03-18 17:27:36 -05:00
Fil Maj
04de2052fd As best a fix as can be made for issue 95: on HTC devices, if text input is in bottom half of page, it does not get scrolled up to top half of page when you tap it and virtual keyboard comes up. 2011-03-15 12:46:05 -07:00
Bryce Curtis
7344964c05 Add support for setting sms body using uri "sms:#?body=text". 2011-03-13 22:36:09 -05:00
macdonst
1fc56921aa Ticket #90: Move _createEvent from File to PhoneGap
Got rid of _createEvent from file.js as it is redundant code.
2011-03-10 04:26:11 +08:00
Bryce Curtis
21a34a8980 Ticket 106 - Simplify splash screen logic based upon idea from vadim. 2011-03-08 22:00:33 -06:00
Fil Maj
8d73b364f2 Issue 107: always send resume event to JS. 2011-03-07 16:50:10 -08:00
Fil Maj
fb2c25c6c6 Issue 107: Always send pause event to JS. 2011-03-07 16:48:23 -08:00
Mark Darbyshire
47ca081f36 Implement localStorage.key() and localStorage.length
This brings PhoneGap's implementation in line with the spec at http://dev.w3.org/html5/webstorage/
It makes the following demo work when you include PhoneGap: http://people.w3.org/mike/localstorage.html
I was hopeful it would make my app, which makes use of LawnChair, work, but I've had no such luck as of yet.
2011-03-07 15:55:14 -08:00
macdonst
0c3a8fb9f7 File API: System and Directories
http://www.w3.org/TR/file-system-api/

User can retrieve PERSISTENT and TEMPORARY file systems, list their
contents, and manipulate files and directories within them.

Modify existing FileWriter implementation
-----------------------------------------

  - Change the way user creates a FileWriter.  User must either pass a
    File object to the FileWriter constructor, or use the
    FileEntry.createWriter() method.

  - Drop support for the 'filePath' and 'append' parameters in the
    FileWriter constructor.  The file path is determined from either the
    File object passed to the FileWriter constructor, or the FileEntry
    object used to create the FileWriter.  To append to a file, use the
    FileWriter object's seek method:

    // writer is a FileWriter object
    // seek to length of file to append
    writer.seek(writer.length);

Replace FileMgr JavaScript APIs not specified in any File API spec
------------------------------------------------------------------

  - Remove navigator.fileMgr.createDirectory(dirName) function.  To
    create a directory, use the DirectoryEntry.getDirectory() method,
    which is part of the File API: Directories and System spec.  Set
    the Flags.create to 'true':

    // directory is a DirectoryEntry object
    directory.getDirectory(path, {create:true}, successCB, failCB);

  - Remove navigator.fileMgr.getRootPaths() function.  To retrieve the
    root file systems, use the window.requestFileSystem() function,
    which is part of the File API: Directories and System spec.

  - Remove navigator.fileMgr.getFileProperties(fileName) function.  To
    get the properties of a file, use the FileEntry.file() method, which
    is part of the File API: Directories and System spec.

  - Remove navigator.fileMgr.deleteFile(fileName) function.  To delete a
    file, use the Entry.remove() method, which is part of the File API:
    Directories and System spec.

  - Remove navigator.fileMgr.deleteDirectory(dirName) function.  To
    delete a directory, use the Entry.remove() (if it is empty), or
    DirectoryEntry.removeRecursively() methods, which are part of the
    File API: Directories and System spec.

Clean up existing FileManager native code.  Move some functionality to
file utility class.
2011-03-05 04:26:31 +08:00
Bryce Curtis
2bc7bd6768 Worked around JavaScript bridge exception for Android 2.3. Use "prompt" instead of calling objects directly. There were several objects called from JavaScript, including BrowserKey, so key events had to be reworked. 2011-02-27 20:07:24 -06:00