diff -r 4d198a32ac7d -r d4809db37847 plugins/org.symbian.tools.wrttools/plugin.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/org.symbian.tools.wrttools/plugin.xml Thu Aug 19 17:48:04 2010 -0700 @@ -0,0 +1,997 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Creates a new Symbian WRT application project using one of the provided + templates + + + + + + + + + + This wizard generates an empty widget project with a minimal Info.plist, html,css and js. + + + + + + This wizard generates a basic Hello project with a minimal Info.plist, html,css and js along with WRTKit. + + org.symbian.wrtkit + + + + This wizard generates a project based on the PhoneGap library that showcases PhoneGap API usage. PhoneGap applications require WRT 1.1 or newer. + + phonegap + + + + + This wizard generates an Flickr project with a minimal Info.plist, html,css and js and WRTKit. + + org.symbian.wrtkit + + + + + This wizard generates an RSS Reader project with a minimal Info.plist, html,css and js and WRTKit. + + org.symbian.wrtkit + + + + Includes templates for high-end devices from Forum.Nokia. + + + + + + + + + + + Import WRT project created in Aptana, Adobe Dreamweaver or WRT IDE + + + + + + Create WRT project from deployable WGZ application archive + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +var contactService = device.getServiceObject("Service.Contact", + "IDataSource"); + var result = contactService.IDataSource.GetList( + { Type : "Contact", Sort : { Order : "Ascending" } } + ); + if (result.ErrorCode == 0) { + var contacts = result.ReturnValue; + for ( var contact = contacts.getNext(); contact != null; contact = contacts.getNext()) { + var firstName = contact.FirstName; + var lastName = contact.LastName; + var mobile = contact.MobilePhoneGen; + var landPhone = contact.LandPhoneGen; + var jobTitle = contact.JobTitle; + // Consult WRT documentation for other possible fields + // TODO Process contact information + } + } else { + var errorCode = result.ErrorCode; + var errorMessage = result.ErrorMessage; + // TODO Cannot retrieve contacts list + } + + + + +// This function can be passed as a callback to locationService.ILocation +// GetLocation or Trace method +function locationUpdated(transactionId, code, result) { + if (result.ErrorCode == 0) { + var longitude = result.ReturnValue.Longitude; // Longitude estimate in degrees. The value range is [+180, -180]. + var latitude = result.ReturnValue.Latitude; // Latitude estimate in degrees. The value range is [+90, -90]. + var altitude = result.ReturnValue.Altitude; // Elevation estimate in meters relative to the WGS 84 datum. + var satelliteNumView = result.ReturnValue.SatelliteNumView; // Number of satellites currently in view. + var satelliteNumViewUsed = result.ReturnValue.SatelliteNumViewUsed; // Number of satellites used to obtain the location fix. + var horizontalSpeed = result.ReturnValue.HorizontalSpeed; // Horizontal speed estimate in meters per second. This is the speed of the device at the time the location fix was obtained. + var horizontalSpeedError = result.ReturnValue.HorizontalSpeedError; // Horizontal speed error in meters per second. + var trueCourse = result.ReturnValue.TrueCourse; // Current direction of movement in degrees in relation to true north. + var trueCourseError = result.ReturnValue.TrueCourseError; // TrueCourse error in degrees. + var magneticHeading = result.ReturnValue.MagneticHeading; // Current direction of movement in degrees in relation to magnetic north. + var magneticHeadingError = result.ReturnValue.MagneticHeadingError; // MagneticHeading error in degrees. + var heading = result.ReturnValue.Heading; // Current instantaneous direction of movement in degrees in relation to true north. + var headingError = result.ReturnValue.HeadingError; // Heading error in degrees. + var magneticCourse = result.ReturnValue.MagneticCourse; // Current instantaneous direction of movement in degrees in relation to magnetic north. + var magneticCourseError = result.ReturnValue.MagneticCourseError; // MagneticCourse error in degrees + // TODO Location information was received + } else { + var errorCode = result.ErrorCode; + var errorMessage = result.ErrorMessage; + // TODO Failed to retrieve location information + } +} + + + +var phoneNumber = "+6505551214"; + var text = "Sent from WRT application"; + var messaging = device.getServiceObject("Service.Messaging", "IMessaging"); + var result = messaging.IMessaging.Send({ MessageType : "SMS", To : phoneNumber, BodyText : text }); + if (result.ErrorCode != null) { + var errorCode = result.ErrorCode; + var errorMessage = result.ErrorMessage; + // TODO Cannot send SMS message + } + + + + + +function watchBatteryNotifications() { + var sysInfo = device.getServiceObject("Service.SysInfo", "ISysInfo"); + var result = sysInfo.ISysInfo.GetNotification( { + Entity : "Battery", + Key : "BatteryStrength" + }, batteryUpdated); + if (result.ErrorCode == 0) { + var transactionId = result.TransactionID; + // TODO Use this ID to cancel notifications + } else { + var message = result.ErrorMessage; + // TODO Process error + } +} + +function batteryUpdated(tId, code, result) { + if (result.ErrorCode == 0) { + var batteryStatus = result.ReturnValue.Status; + // TODO Process battery charge level + } else { + var message = result.ErrorMessage; + // TODO Process error + } +} + + + + +// Call this function to add a callback that will be notified of orientation changes +function watchSensorNotifications() { + var sensors = device.getServiceObject("Service.Sensor", "ISensor"); + var SensorParams = { + SearchCriterion : "Orientation" // TODO Possible values (one of): + // SearchCriterion : "All" + // SearchCriterion : "AccelerometerAxis" + // SearchCriterion : "AccelerometerDoubleTapping" + // SearchCriterion : "Rotation" + }; + var result = sensors.ISensor.FindSensorChannel(SensorParams); + + if (result.ErrorCode != 0) { + var errorCode = result.ErrorCode; + var errorMessage = result.ErrorMessage; + // TODO Handle error + return null; + } + // TODO Function named "sensorCallback" will be called when device orientation changes. This function should be created. + var result2 = sensors.ISensor.RegisterForNotification( + { ChannelInfoMap : result.ReturnValue[0], + ListeningType : "ChannelData" }, sensorCallback); + if (result.ErrorCode == 0) { + var transactionId = result.TransactionID; + // TODO Use this transaction ID to cancel notifications when watching orientation is no longer needed + return transactionId; + } else { + var errorCode = result.ErrorCode; + var errorMessage = result.ErrorMessage; + // TODO Handle error + return null; + } +} + +// This function can be passed as callback to +// sensors.ISensor.RegisterForNotification method +function sensorCallback(transactionId, code, result) { + if (result.ErrorCode == 0) { + // TODO Process notification + var dataType = result.ReturnValue.DataType; // One of: "AxisData", "DoubleTappingData", "OrientationData" or "RotationData" + var orientation = result.ReturnValue.DeviceOrientation; // Orientation + // var xAxis = result.ReturnValue.XAxisData; // Accelerometer + // var yAxis = result.ReturnValue.YAxisData; // Accelerometer + // var zAxis = result.ReturnValue.ZAxisData; // Accelerometer + // var direction = result.ReturnValue.DeviceDirection; // Accelerometer double tapping + // var xRotation = result.ReturnValue.XRotation; // Rotation + // var yRotation = result.ReturnValue.YRotation; // Rotation + // var zRotation = result.ReturnValue.ZRotation; // Rotation + } else { + var errorCode = result.ErrorCode; + var errorMessage = result.ErrorMessage; + // TODO Handle error + } +} + + + + + + + +// This callback can be passed as a successCallback argument to +// navigator.accelerometer getCurrentAcceleration and watchAcceleration methods +function updateAcceleration(accel) { + var x = accel.x; + var y = accel.y; + var z = accel.z; + + // TODO process the data +} + + + + +// This method can be passed as a successCallback argument to +// navigator.contacts.find method +function displayContacts(contacts) { + for (var i=0; i < contacts.length; i++) { + var contact = contacts[i]; + var name = contact.name.formatted; + var phones = contact.name.phone; // Array of phone numbers + var name = contact.name.address; + + // TODO Insert your code here + } +} + + + + +// This method can be passed as a successCallback argument to +// navigator.geolocation getCurrentPosition or watchPosition methods +function updateLocation(position) { + var pt = position.coords; + var latitude = pt.latitude; + var longitude = pt.longitude; + var altitude = pt.altitude; + var heading = pt.heading; + var speed = pt.speed; + + // TODO Insert your code here +} + + + + +// This method can be passed as a successCallback argument to +// navigator.orientation getCurrentOrientation or watchOrientation methods +function updateOrientation(orientation) { + switch (orientation) { + case DisplayOrientation.PORTRAIT: break; + case DisplayOrientation.REVERSE_PORTRAIT: break; + case DisplayOrientation.LANDSCAPE_LEFT_UP: break; + case DisplayOrientation.LANDSCAPE_RIGHT_UP: break; + case DisplayOrientation.FACE_UP: break; + case DisplayOrientation.FACE_DOWN: break; + } + + // TODO Insert your code here +} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WRTKit UI library for Symbian WRT + + + + + + + + + + + + + + + + + + + + PhoneGap application + + + + + + + + + + + + + + + + + + + + + + +