Tag: JDE

auto-run startup application

BlackBerry application support auto-run at every startup.

if you want to create background application only use this [1]:

To create an auto-start application using the BlackBerry® Java® Plug-in for Eclipse®
  1. Double click on BlackBerry_App_Descriptor.xml found in the BlackBerry project.
  2. On the Application tab, check off Auto-run on startup.
  3. If you do not want an application icon to be shown on the home screen check the Do not display the application icon on the BlackBerry home screen check box.

To create an auto-start application using the BlackBerry JDE
   1. In the BlackBerry JDE, right-click the project and select Properties.
   2. On the Application tab, check the Auto-run on Startup check box.
   3. If you want your application to run in the background, and not appear on the ribbon, check the System Module check box.

else, if you want to create background application & ui application use this [2]:

The BlackBerry architecture allows applications to be started automatically in the background by the system without requiring the user to explicitly initialize them. This allows application threads to always run in the background with no user interface component. Alternate Entry Points can be used to launch the user interface (UI) component of the auto-started application when the user selects the icon from the ribbon. This feature allows application threads to be launched in the background that can be used for actions like listening for incoming push messages, pre-processing data, or initializing network communications with a server host.

After creating the projects for the original application, you will have to create another project for the UI entry point. Assuming that the thread to be run exists in the same project as the original application, follow these steps:

   1. Right-click the project node and select Properties.
   2. In the Properties window, select the Application tab.
   3. Verify the following options are checked: Auto-run on startup and System module (to register the thread with the system).
   4. Create another project under the same folder as the original project. Right-click the new project node and select Properties.
   5. Select the Application tab and select Alternate CLDC Application Entry Point from the Project type drop-down list. As shown in the attached file, select the name of the original project (for example, trafficreporter) from the Alternate entry point for drop-down list. Also specify the arguments that would launch the application using this alternate entry point (for example: gui).
   6. Modify the main() method of the original project as follows:

      public static void main(String[] args) {
           if ( args != null && args.length > 0 && args[0].equals("gui") ){
                // code to initialize the app
                theApp.enterEventDispatcher();
           } else {
                // code to launch the background thread }
           }
      }
   7. Add your application icon file to the this new entry point application and make it the ribbon icon.

The entry point application now consists only of an application icon and a parameter to pass to the main() method of the main application. There is no source code associated with this project. The main application contains all of the source code, including the thread to be started automatically.

Now, whenever the device is started, this main() method will be executed without any arguments, and the background thread will start. When the application icon is clicked from the main ribbon, the main() method will be executed with the argument specified in the above code sample ("gui") and the application can pop a screen to the foreground.

[1] http://www.blackberry.com/knowledgecenterpublic/livelink.exe/fetch/2000/348583/800901/How_To_-_Configure_an_application_to_start_automatically_when_the_device_is_turned_on.html?nodeid=800920&vernum=0
[2] http://www.blackberry.com/knowledgecenterpublic/livelink.exe/fetch/2000/348583/796557/800738/800901/How_To_-_Setup_an_alternate_entry_point_for_my_application.html?nodeid=800820


Old and New at JDE 4.6

New classes in the BlackBerry Java Development Environment version 4.6.0

net.rim.blackberry.api.messagelist.ApplicationIcon
net.rim.blackberry.api.messagelist.ApplicationIndicator
net.rim.blackberry.api.messagelist.ApplicationIndicatorRegistry
net.rim.blackberry.api.messagelist.ApplicationMessageFolder
net.rim.blackberry.api.messagelist.ApplicationMessageFolderRegistry
net.rim.blackberry.api.messagelist.ApplicationMessageSearchProperties
net.rim.blackberry.api.mms.MMS
net.rim.blackberry.api.sms.SMS
net.rim.device.api.lbs.Locator
net.rim.device.api.lbs.LocatorException
net.rim.device.api.notification.NotificationProviderRegistry
net.rim.device.api.system.Sensor
net.rim.device.api.ui.decor.Background
net.rim.device.api.ui.decor.BackgroundFactory
net.rim.device.api.ui.decor.Border
net.rim.device.api.ui.decor.BorderFactory
net.rim.device.api.util.LongVector
net.rim.device.api.util.TimeZoneUtilities

New interfaces in the BlackBerry Java Development Environment version 4.6.0

net.rim.blackberry.api.messagelist.ApplicationMessage
net.rim.blackberry.api.messagelist.ApplicationMessage$Status
net.rim.blackberry.api.messagelist.ApplicationMessageFolderListener
net.rim.blackberry.api.mms.SendListener
net.rim.blackberry.api.pdap.BlackBerryEventList
net.rim.blackberry.api.pdap.BlackBerryToDoList
net.rim.blackberry.api.pdap.ListChangeListener
net.rim.blackberry.api.sms.SendListener
net.rim.device.api.system.SensorListener

New fields in the BlackBerry Java Development Environment version 4.6.0

net.rim.blackberry.api.menuitem.ApplicationMenuItemRepository.MENUITEM_MUSIC_SERVICE_ITEM
net.rim.blackberry.api.menuitem.ApplicationMenuItemRepository.MENUITEM_VIDEO_SERVICE_ITEM
net.rim.blackberry.api.messagelist.ApplicationIndicator.VALUE_LIMIT
net.rim.blackberry.api.messagelist.ApplicationMessage$Status.DRAFT
net.rim.blackberry.api.messagelist.ApplicationMessage$Status.INCOMING
net.rim.blackberry.api.messagelist.ApplicationMessage$Status.OPENED
net.rim.blackberry.api.messagelist.ApplicationMessage$Status.OUTGOING
net.rim.blackberry.api.messagelist.ApplicationMessage$Status.UNOPENED
net.rim.blackberry.api.messagelist.ApplicationMessageFolderListener.MESSAGE_DELETED
net.rim.blackberry.api.messagelist.ApplicationMessageFolderListener.MESSAGE_MARKED_OPENED
net.rim.blackberry.api.messagelist.ApplicationMessageFolderListener.MESSAGE_MARKED_UNOPENED
net.rim.device.api.applicationcontrol.ApplicationPermissions.PERMISSION_INPUT_SIMULATION
net.rim.device.api.applicationcontrol.ApplicationPermissions.PERMISSION_INTERNET
net.rim.device.api.applicationcontrol.ApplicationPermissions.PERMISSION_LOCATION_DATA
net.rim.device.api.applicationcontrol.ApplicationPermissions.PERMISSION_ORGANIZER_DATA
net.rim.device.api.applicationcontrol.ApplicationPermissions.PERMISSION_RECORDING
net.rim.device.api.applicationcontrol.ApplicationPermissions.PERMISSION_SECURITY_DATA
net.rim.device.api.applicationcontrol.ApplicationPermissions.PERMISSION_SERVER_NETWORK
net.rim.device.api.applicationcontrol.ApplicationPermissions.PERMISSION_THEMES
net.rim.device.api.applicationcontrol.ApplicationPermissions.PERMISSION_USB
net.rim.device.api.i18n.Locale.LOCALE_th
net.rim.device.api.io.http.HttpProtocolConstants.CONTENT_TYPE_APPLICATION_VND_OMA_LOC_SUPL_INIT
net.rim.device.api.lbs.Locator.REQUEST_TIMEOUT
net.rim.device.api.lbs.LocatorException.AMBIGUOUS_ADDRESS
net.rim.device.api.lbs.LocatorException.CITY_AMBIGUOUS_PLEASE_SPECIFY_STATE
net.rim.device.api.lbs.LocatorException.CITY_NOT_FOUND
net.rim.device.api.lbs.LocatorException.CITY_NOT_SPECIFIED
net.rim.device.api.lbs.LocatorException.CITY_POSTAL_CODE_MISMATCH
net.rim.device.api.lbs.LocatorException.DATA_UNAVAILABLE
net.rim.device.api.lbs.LocatorException.DATA_UNAVAILABLE_FOR_SPECIFIED_ADMIN_LEVEL
net.rim.device.api.lbs.LocatorException.INVALID_ADDRESS_NUMBER
net.rim.device.api.lbs.LocatorException.INVALID_ADMIN_LEVEL
net.rim.device.api.lbs.LocatorException.INVALID_COORDINATE
net.rim.device.api.lbs.LocatorException.INVALID_COUNTRY
net.rim.device.api.lbs.LocatorException.INVALID_POSTAL_CODE
net.rim.device.api.lbs.LocatorException.INVALID_REQUEST
net.rim.device.api.lbs.LocatorException.INVALID_STATE
net.rim.device.api.lbs.LocatorException.INVALID_STATE_AND_COUNTRY
net.rim.device.api.lbs.LocatorException.ITEM_NOT_FOUND
net.rim.device.api.lbs.LocatorException.MALFORMED_INTERSECTION_ADDRESS
net.rim.device.api.lbs.LocatorException.MAX_LIMIT_EXCEEDED
net.rim.device.api.lbs.LocatorException.REDIRECT
net.rim.device.api.lbs.LocatorException.SERVER_INTERNAL_ERROR
net.rim.device.api.lbs.LocatorException.SPECIFY_CITY
net.rim.device.api.lbs.LocatorException.SPECIFY_COUNTRY
net.rim.device.api.lbs.LocatorException.SPECIFY_STATE_PROVINCE
net.rim.device.api.lbs.LocatorException.STATE_POSTAL_CODE_MISMATCH
net.rim.device.api.lbs.LocatorException.TOO_MANY_ITEMS
net.rim.device.api.lbs.LocatorException.UNSUPPORTED_ADDRESS_TYPE
net.rim.device.api.lbs.LocatorException.UNSUPPORTED_CHARACTER
net.rim.device.api.system.CoverageInfo.COVERAGE_BIS_B
net.rim.device.api.system.Sensor.FLIP
net.rim.device.api.system.Sensor.HOLSTER
net.rim.device.api.system.Sensor.STATE_FLIP_CLOSED
net.rim.device.api.system.Sensor.STATE_FLIP_OPEN
net.rim.device.api.system.Sensor.STATE_IN_HOLSTER
net.rim.device.api.system.Sensor.STATE_OUT_OF_HOLSTER
net.rim.device.api.ui.Field.FIELD_LEADING
net.rim.device.api.ui.Field.FIELD_TRAILING
net.rim.device.api.ui.Field.VISUAL_STATE_ACTIVE
net.rim.device.api.ui.Field.VISUAL_STATE_DISABLED
net.rim.device.api.ui.Field.VISUAL_STATE_DISABLED_FOCUS
net.rim.device.api.ui.Field.VISUAL_STATE_FOCUS
net.rim.device.api.ui.Field.VISUAL_STATE_NORMAL
net.rim.device.api.ui.decor.Background CONSTRUCTOR
net.rim.device.api.ui.decor.Background.POSITION_X_CENTER
net.rim.device.api.ui.decor.Background.POSITION_X_INHERIT
net.rim.device.api.ui.decor.Background.POSITION_X_LEFT
net.rim.device.api.ui.decor.Background.POSITION_X_RIGHT FIELD
net.rim.device.api.ui.decor.Background.POSITION_Y_BOTTOM
net.rim.device.api.ui.decor.Background.POSITION_Y_CENTER
net.rim.device.api.ui.decor.Background.POSITION_Y_INHERIT
net.rim.device.api.ui.decor.Background.POSITION_Y_TOP
net.rim.device.api.ui.decor.Background.REPEAT_BOTH
net.rim.device.api.ui.decor.Background.REPEAT_HORIZONTAL
net.rim.device.api.ui.decor.Background.REPEAT_INHERIT
net.rim.device.api.ui.decor.Background.REPEAT_NONE
net.rim.device.api.ui.decor.Background.REPEAT_SCALE_TO_FIT
net.rim.device.api.ui.decor.Background.REPEAT_VERTICAL
net.rim.device.api.ui.decor.Border.STYLE_DASHED
net.rim.device.api.ui.decor.Border.STYLE_DOTTED
net.rim.device.api.ui.decor.Border.STYLE_FILLED
net.rim.device.api.ui.decor.Border.STYLE_SOLID
net.rim.device.api.ui.decor.Border.STYLE_TRANSPARENT
net.rim.device.api.util.LongVector.capacityIncrement
net.rim.device.api.util.LongVector.elementCount
net.rim.device.api.util.LongVector.elementData
net.rim.device.api.util.TimeZoneUtilities.LONG
net.rim.device.api.util.TimeZoneUtilities.SHORT

New methods in the Blackberry Java Development Environment version 4.6.0

net.rim.blackberry.api.mail.Transport.send ( net.rim.blackberry.api.mail.Message net.rim.blackberry.api.mail.ServiceConfiguration )
net.rim.blackberry.api.messagelist.ApplicationIcon ( net.rim.device.api.system.EncodedImage )
net.rim.blackberry.api.messagelist.ApplicationIcon ( net.rim.device.api.system.EncodedImage boolean )
net.rim.blackberry.api.messagelist.ApplicationIndicator.getValue ()
net.rim.blackberry.api.messagelist.ApplicationIndicator.isVisible ()
net.rim.blackberry.api.messagelist.ApplicationIndicator.set ( net.rim.blackberry.api.messagelist.ApplicationIcon int )
net.rim.blackberry.api.messagelist.ApplicationIndicator.setIcon ( net.rim.blackberry.api.messagelist.ApplicationIcon )
net.rim.blackberry.api.messagelist.ApplicationIndicator.setValue ( int )
net.rim.blackberry.api.messagelist.ApplicationIndicator.setVisible ( boolean )
net.rim.blackberry.api.messagelist.ApplicationIndicatorRegistry.getApplicationIndicator ()
net.rim.blackberry.api.messagelist.ApplicationIndicatorRegistry.getInstance ()
net.rim.blackberry.api.messagelist.ApplicationIndicatorRegistry.register ( net.rim.blackberry.api.messagelist.ApplicationIcon boolean boolean )
net.rim.blackberry.api.messagelist.ApplicationIndicatorRegistry.unregister ()
net.rim.blackberry.api.messagelist.ApplicationMessage.getContact ()
net.rim.blackberry.api.messagelist.ApplicationMessage.getCookie ( int )
net.rim.blackberry.api.messagelist.ApplicationMessage.getPreviewPicture ()
net.rim.blackberry.api.messagelist.ApplicationMessage.getPreviewText ()
net.rim.blackberry.api.messagelist.ApplicationMessage.getStatus ()
net.rim.blackberry.api.messagelist.ApplicationMessage.getSubject ()
net.rim.blackberry.api.messagelist.ApplicationMessage.getTimestamp ()
net.rim.blackberry.api.messagelist.ApplicationMessage.getType ()
net.rim.blackberry.api.messagelist.ApplicationMessageFolder.addListener ( net.rim.blackberry.api.messagelist.ApplicationMessageFolderListener )
net.rim.blackberry.api.messagelist.ApplicationMessageFolder.addListener ( net.rim.blackberry.api.messagelist.ApplicationMessageFolderListener int net.rim.device.api.system.ApplicationDescriptor )
net.rim.blackberry.api.messagelist.ApplicationMessageFolder.fireElementAdded ( net.rim.blackberry.api.messagelist.ApplicationMessage )
net.rim.blackberry.api.messagelist.ApplicationMessageFolder.fireElementRemoved ( net.rim.blackberry.api.messagelist.ApplicationMessage )
net.rim.blackberry.api.messagelist.ApplicationMessageFolder.fireElementUpdated ( net.rim.blackberry.api.messagelist.ApplicationMessage net.rim.blackberry.api.messagelist.ApplicationMessage )
net.rim.blackberry.api.messagelist.ApplicationMessageFolder.fireReset ()
net.rim.blackberry.api.messagelist.ApplicationMessageFolder.getId ()
net.rim.blackberry.api.messagelist.ApplicationMessageFolder.getMessages ()
net.rim.blackberry.api.messagelist.ApplicationMessageFolder.getName ()
net.rim.blackberry.api.messagelist.ApplicationMessageFolder.getSearchProperties ()
net.rim.blackberry.api.messagelist.ApplicationMessageFolder.removeListener ( net.rim.blackberry.api.messagelist.ApplicationMessageFolderListener )
net.rim.blackberry.api.messagelist.ApplicationMessageFolder.setSearchProperties ( net.rim.blackberry.api.messagelist.ApplicationMessageSearchProperties )
net.rim.blackberry.api.messagelist.ApplicationMessageFolderListener.actionPerformed ( int net.rim.blackberry.api.messagelist.ApplicationMessage[] net.rim.blackberry.api.messagelist.ApplicationMessageFolder )
net.rim.blackberry.api.messagelist.ApplicationMessageFolderRegistry.getApplicationFolder ( long )
net.rim.blackberry.api.messagelist.ApplicationMessageFolderRegistry.getRootFolderName ()
net.rim.blackberry.api.messagelist.ApplicationMessageFolderRegistry.getInstance ()
net.rim.blackberry.api.messagelist.ApplicationMessageFolderRegistry.registerFolder ( long java.lang.String net.rim.device.api.collection.ReadableList )
net.rim.blackberry.api.messagelist.ApplicationMessageFolderRegistry.registerFolder ( long java.lang.String net.rim.device.api.collection.ReadableList boolean )
net.rim.blackberry.api.messagelist.ApplicationMessageFolderRegistry.registerMessageIcon ( int int net.rim.blackberry.api.messagelist.ApplicationIcon )
net.rim.blackberry.api.messagelist.ApplicationMessageFolderRegistry.registerMessageMenuItems ( int int net.rim.blackberry.api.menuitem.ApplicationMenuItem[] )
net.rim.blackberry.api.messagelist.ApplicationMessageFolderRegistry.registerMessageMenuItems ( int int net.rim.blackberry.api.menuitem.ApplicationMenuItem[] net.rim.device.api.system.ApplicationDescriptor )
net.rim.blackberry.api.messagelist.ApplicationMessageFolderRegistry.setBulkMarkOperationsSupport ( int int boolean boolean )
net.rim.blackberry.api.messagelist.ApplicationMessageFolderRegistry.setRootFolderName ( java.lang.String )
net.rim.blackberry.api.messagelist.ApplicationMessageFolderRegistry.unregisterFolder ( long )
net.rim.blackberry.api.messagelist.ApplicationMessageSearchProperties ( boolean )
net.rim.blackberry.api.messagelist.ApplicationMessageSearchProperties.isSearchByNameSupported ()
net.rim.blackberry.api.messagelist.ApplicationMessageSearchProperties.isSearchByPreviewTextSupported ()
net.rim.blackberry.api.messagelist.ApplicationMessageSearchProperties.isSearchByStatusSupported ()
net.rim.blackberry.api.messagelist.ApplicationMessageSearchProperties.isSearchBySubjectSupported ()
net.rim.blackberry.api.messagelist.ApplicationMessageSearchProperties.isSearchSupported ()
net.rim.blackberry.api.messagelist.ApplicationMessageSearchProperties.setSearchByNameSupported ( boolean )
net.rim.blackberry.api.messagelist.ApplicationMessageSearchProperties.setSearchByPreviewTextSupported ( boolean )
net.rim.blackberry.api.messagelist.ApplicationMessageSearchProperties.setSearchByStatusSupported ( boolean )
net.rim.blackberry.api.messagelist.ApplicationMessageSearchProperties.setSearchBySubjectSupported ( boolean )
net.rim.blackberry.api.messagelist.ApplicationMessageSearchProperties.setSearchSupported ( boolean )
net.rim.blackberry.api.mms.MMS.addSendListener ( net.rim.blackberry.api.mms.SendListener )
net.rim.blackberry.api.mms.MMS.removeSendListener ( net.rim.blackberry.api.mms.SendListener )
net.rim.blackberry.api.mms.SendListener.sendMessage ( javax.wireless.messaging.Message )
net.rim.blackberry.api.pdap.BlackBerryContactList.getByUID ( java.lang.String int )
net.rim.blackberry.api.pdap.BlackBerryContactList.getByUID ( java.lang.String )
net.rim.blackberry.api.pdap.BlackBerryEventList.getByUID ( java.lang.String )
net.rim.blackberry.api.pdap.BlackBerryMemoList.getByUID ( java.lang.String )
net.rim.blackberry.api.pdap.BlackBerryPIM.addListChangeListener ( net.rim.blackberry.api.pdap.ListChangeListener )
net.rim.blackberry.api.pdap.BlackBerryPIM.removeListChangeListener ( net.rim.blackberry.api.pdap.ListChangeListener )
net.rim.blackberry.api.pdap.BlackBerryToDoList.getByUID net.rim.blackberry.api.pdap.BlackBerryToDo ( java.lang.String )
net.rim.blackberry.api.pdap.ListChangeListener.defaultListChanged ( int )
net.rim.blackberry.api.sms.SMS.addSendListener ( net.rim.blackberry.api.sms.SendListener )
net.rim.blackberry.api.sms.SMS.removeSendListener ( net.rim.blackberry.api.sms.SendListener )
net.rim.blackberry.api.sms.SendListener.sendMessage ( javax.wireless.messaging.Message )
net.rim.device.api.browser.field.RenderingSession.getBrowserContent ( javax.microedition.io.HttpConnection java.io.InputStream net.rim.device.api.browser.field.RenderingApplication int )
net.rim.device.api.browser.field.RenderingSession.getBrowserContent ( javax.microedition.io.InputConnection java.io.InputStream java.lang.String net.rim.device.api.browser.field.RenderingApplication int )
net.rim.device.api.lbs.Locator.cancel ()
net.rim.device.api.lbs.Locator.geocode ( java.lang.String javax.microedition.location.Coordinates )
net.rim.device.api.lbs.Locator.geocode ( javax.microedition.location.AddressInfo javax.microedition.location.Coordinates )
net.rim.device.api.lbs.LocatorException ( int java.lang.String int )
net.rim.device.api.lbs.LocatorException.getErrorCode ()
net.rim.device.api.lbs.LocatorException.getHTTPCode ()
net.rim.device.api.servicebook.ServiceBook.getRecordByCidAndSid ( java.lang.String long boolean boolean )
net.rim.device.api.system.Bitmap.getRGB565 ( byte[] int int int int int int )
net.rim.device.api.system.Device.setTimeZone ( java.util.TimeZone )
net.rim.device.api.system.Sensor.addListener ( net.rim.device.api.system.Application net.rim.device.api.system.SensorListener int )
net.rim.device.api.system.Sensor.getState ( int )
net.rim.device.api.system.Sensor.isSupported ( int )
net.rim.device.api.system.Sensor.removeListener ( net.rim.device.api.system.Application net.rim.device.api.system.SensorListener )
net.rim.device.api.system.SensorListener.onSensorUpdate ( int int )
net.rim.device.api.ui.Field.getBackground net.rim.device.api.ui.decor.Background ( int )
net.rim.device.api.ui.Field.getBackground net.rim.device.api.ui.decor.Background ()
net.rim.device.api.ui.Field.getBorder net.rim.device.api.ui.decor.Border ( int )
net.rim.device.api.ui.Field.getBorder net.rim.device.api.ui.decor.Border ()
net.rim.device.api.ui.Field.getBorder ( net.rim.device.api.ui.XYEdges )
net.rim.device.api.ui.Field.getVisualState ()
net.rim.device.api.ui.Field.setBackground ( int net.rim.device.api.ui.decor.Background )
net.rim.device.api.ui.Field.setBackground ( net.rim.device.api.ui.decor.Background )
net.rim.device.api.ui.Field.setBorder ( int net.rim.device.api.ui.decor.Border )
net.rim.device.api.ui.Field.setBorder ( int net.rim.device.api.ui.decor.Border boolean )
net.rim.device.api.ui.Field.setBorder ( net.rim.device.api.ui.decor.Border )
net.rim.device.api.ui.Field.setBorder ( net.rim.device.api.ui.decor.Border boolean )
net.rim.device.api.ui.Field.setVisualState ( int )
net.rim.device.api.ui.XYPoint.reset ()
net.rim.device.api.ui.XYRect.reset ()
net.rim.device.api.ui.component.ActiveAutoTextEditField.invokeAction ( int )
net.rim.device.api.ui.component.ActiveRichTextField.invokeAction ( int )
net.rim.device.api.ui.decor.Background ()
net.rim.device.api.ui.decor.Background.draw ( net.rim.device.api.ui.Graphics net.rim.device.api.ui.XYRect )
net.rim.device.api.ui.decor.Background.isTransparent ()
net.rim.device.api.ui.decor.BackgroundFactory.createBitmapBackground ( net.rim.device.api.system.Bitmap )
net.rim.device.api.ui.decor.BackgroundFactory.createBitmapBackground ( net.rim.device.api.system.Bitmap int int int )
net.rim.device.api.ui.decor.BackgroundFactory.createLinearGradientBackground ( int int int int )
net.rim.device.api.ui.decor.BackgroundFactory.createSolidBackground ( int )
net.rim.device.api.ui.decor.BackgroundFactory.createSolidTransparentBackground ( int int )
net.rim.device.api.ui.decor.Border ( net.rim.device.api.ui.XYEdges int )
net.rim.device.api.ui.decor.Border.getBackground ()
net.rim.device.api.ui.decor.Border.getBottom int
net.rim.device.api.ui.decor.Border.getEdges ()
net.rim.device.api.ui.decor.Border.getEdges ( net.rim.device.api.ui.XYEdges )
net.rim.device.api.ui.decor.Border.getLeft ()
net.rim.device.api.ui.decor.Border.getRight ()
net.rim.device.api.ui.decor.Border.getStyle ()
net.rim.device.api.ui.decor.Border.getTop ()
net.rim.device.api.ui.decor.Border.isTransparent ()
net.rim.device.api.ui.decor.Border.paint ( net.rim.device.api.ui.Graphics net.rim.device.api.ui.XYRect )
net.rim.device.api.ui.decor.BorderFactory.createBevelBorder ( net.rim.device.api.ui.XYEdges )
net.rim.device.api.ui.decor.BorderFactory.createBevelBorder ( net.rim.device.api.ui.XYEdges net.rim.device.api.ui.XYEdges net.rim.device.api.ui.XYEdges )
net.rim.device.api.ui.decor.BorderFactory.createBitmapBorder ( net.rim.device.api.ui.XYEdges net.rim.device.api.system.Bitmap )
net.rim.device.api.ui.decor.BorderFactory.createBitmapBorder ( net.rim.device.api.ui.XYEdges net.rim.device.api.ui.XYEdges net.rim.device.api.system.Bitmap )
net.rim.device.api.ui.decor.BorderFactory.createRoundedBorder ( net.rim.device.api.ui.XYEdges )
net.rim.device.api.ui.decor.BorderFactory.createRoundedBorder ( net.rim.device.api.ui.XYEdges int )
net.rim.device.api.ui.decor.BorderFactory.createRoundedBorder ( net.rim.device.api.ui.XYEdges int int )
net.rim.device.api.ui.decor.BorderFactory.createSimpleBorder ( net.rim.device.api.ui.XYEdges )
net.rim.device.api.ui.decor.BorderFactory.createSimpleBorder ( net.rim.device.api.ui.XYEdges int )
net.rim.device.api.ui.decor.BorderFactory.createSimpleBorder ( net.rim.device.api.ui.XYEdges net.rim.device.api.ui.XYEdges int )
net.rim.device.api.ui.decor.BorderFactory.createSimpleBorder ( net.rim.device.api.ui.XYEdges net.rim.device.api.ui.XYEdges net.rim.device.api.ui.XYEdges )
net.rim.device.api.util.Arrays.copy ( boolean[] )
net.rim.device.api.util.Arrays.copy ( boolean[] int int )
net.rim.device.api.util.IntIntHashtable.keysToArray ( int[] )
net.rim.device.api.util.IntLongHashtable.keysToArray ( int[] )
net.rim.device.api.util.LongIntHashtable.keysToArray ( long[] )
net.rim.device.api.util.LongVector ( int )
net.rim.device.api.util.LongVector ( int int )
net.rim.device.api.util.LongVector ()
net.rim.device.api.util.LongVector.addElement ( long )
net.rim.device.api.util.LongVector.addElements ( long[] int int )
net.rim.device.api.util.LongVector.capacity ()
net.rim.device.api.util.LongVector.contains ( long )
net.rim.device.api.util.LongVector.copyInto ( int int long[] int )
net.rim.device.api.util.LongVector.elementAt ( int )
net.rim.device.api.util.LongVector.ensureCapacity ( int )
net.rim.device.api.util.LongVector.firstElement ()
net.rim.device.api.util.LongVector.getArray ()
net.rim.device.api.util.LongVector.indexOf ( long )
net.rim.device.api.util.LongVector.indexOf ( long int )
net.rim.device.api.util.LongVector.insertElementAt ( long int )
net.rim.device.api.util.LongVector.isEmpty ()
net.rim.device.api.util.LongVector.lastElement ()
net.rim.device.api.util.LongVector.lastIndexOf ( long )
net.rim.device.api.util.LongVector.lastIndexOf ( long int )
net.rim.device.api.util.LongVector.removeAllElements
net.rim.device.api.util.LongVector.removeElement ( long )
net.rim.device.api.util.LongVector.removeElementAt ( int )
net.rim.device.api.util.LongVector.setElementAt ( long int )
net.rim.device.api.util.LongVector.setSize ( int )
net.rim.device.api.util.LongVector.size ()
net.rim.device.api.util.LongVector.toArray ()
net.rim.device.api.util.LongVector.trimToSize ()
net.rim.device.api.util.MathUtilities.acos ( double )
net.rim.device.api.util.MathUtilities.asin ( double )
net.rim.device.api.util.MathUtilities.atan ( double )
net.rim.device.api.util.MathUtilities.atan2 ( double double )
net.rim.device.api.util.MathUtilities.ldexp ( double int )
net.rim.device.api.util.MathUtilities.pow ( double double )
net.rim.device.api.util.MathUtilities.round ( float )
net.rim.device.api.util.MathUtilities.round ( double )
net.rim.device.api.util.StringUtilities.toLowerCase ( java.lang.StringBuffer int int int )
net.rim.device.api.util.TimeZoneUtilities.getAvailableTimeZones ()
net.rim.device.api.util.TimeZoneUtilities.getDisplayName ( java.util.TimeZone int )
net.rim.device.api.util.TimeZoneUtilities.getDisplayNames ( int )

Removed fields in the Blackberry Java Development Environment version 4.6.0

net.rim.device.api.ui.component.TextField.NO_IM_SWITCHING

Removed methods in the BlackBerry Java Development Environment version 4.6.0

net.rim.device.api.ui.container.VerticalFieldManager.add ( net.rim.device.api.ui.Field )
net.rim.device.api.ui.container.VerticalFieldManager.delete ( net.rim.device.api.ui.Field )
net.rim.device.api.ui.container.VerticalFieldManager.deleteRange ( int int )
net.rim.device.api.ui.container.VerticalFieldManager.insert ( net.rim.device.api.ui.Field int )

[1] http://docs.blackberry.com/en/developers/deliverables/3825/


blackberry string to long

if you want to create long value for PersistentStore or PersistentObject,
you need a tools to convert a string to (hex) long value.

the tool should be available at your JDE or Eclipse plugin.
but the question is, how to generate the long value?
as we know it is SHA1 digest value of a string.

Huge Thanks to jonathanhfisher [1]

SHA1Digest sha1Digest = new SHA1Digest();
sha1Digest.update(String2Convert.getBytes(), 0, String2Convert.length());
byte[] hashValBytes = new byte[sha1Digest.getDigestSize()];
sha1Digest.doFinal(hashValBytes, 0);
long hashValLong = 0;

for( int i = 0; i < 8; i++ ) {
hashValLong |= ((long)(hashValBytes[i]) & 0x0FF)<<(8*i);
}
String hexString = "0x" + Long.toHexString(hashValLong) + "L";

the program above using (encryption) library from bouncycastle.

because I need to run that algorithm on my blackberry application,
which is already have SHA1 digest on its build library,
so I changed several parts of the code:

String sha = "my.blackberry.store.key";
SHA1Digest sha1Digest = new SHA1Digest();
sha1Digest.update(sha.getBytes(), 0, sha.length());
byte hashValBytes[] = new byte[sha1Digest.getDigestLength()];
hashValBytes = Arrays.copy(sha1Digest.getDigest());
long hashValLong = 0L;
for(int i = 0; i < 8; i++)
    hashValLong |= ((long)hashValBytes[i] & 255L) << 8 * i;
System.out.println("hexStr= 0x" + new String(longToHex(hashValLong))+"L");

you can user the longToHex converter from [2].

[1] http://www.blackberryforums.com/developer-forum/98447-convert-string-long.html
[2] http://snippets.dzone.com/posts/show/4593


  • Copyright © 1996-2010 vaks.in. All rights reserved.
    iDream theme by Templates Next | Powered by WordPress