Changes

Jump to: navigation, search

BlackBerry : Develop Simple Apps

2,647 bytes added, 21:21, 26 February 2011
no edit summary
{{Ecl_activities|type=BlackBerry|type-repo=mobile-blackberry}} __NOTOC__
== Understanding the Java Application files ==
 
In order to build BlackBerry applications on Eclipse, one must understand the basic files and their roles:
 
* '''''alx''' Files''
 
The .alx file is the application descriptor that provides information about the application and the location of the application's .cod files.BB Eclipse plug-in automatically generates the file.
 
Example:
 
<source lang="xml">
 
<loader version="1.0">
<application id="BBLab">
<name >
</name>
<description >
</description>
<version > 0.0.1 </version>
<vendor > ECL500 Course </vendor>
<copyright >
Copyright (c) 2011
</copyright>
<fileset Java="1.52" _blackberryVersion="[6.0.0)">
<directory >
6.0.0
</directory>
<files >
BBLab.cod
</files>
</fileset>
</application>
</loader>
</source>
------
 
* '''.cod ''' Files''
 
A .cod file contains compiled and packaged application code.
The standalone application loader tool requires these files to install the BlackBerry Java Application.
The file is similar with a jar file, but has a proprietary format.
 
--------------
 
* '''''.jad''' Files''
 
When deploying BlackBerry applications to a device the BlackBerry Application Web Loader, BlackBerry browser, and BlackBerry App World use the .jad file, that is a simple text file. It contains information needed to verify the application files during the deployment process.
<source lang="xml">
Manifest-Version: 1.0
RIM-COD-Module-Name: BBLab
RIM-COD-Module-Dependencies: net_rim_cldc
MIDlet-Jar-Size: 12403
MIDlet-1: ,img/cs_logo.png,
RIM-COD-Creation-Time: 1298760710
MIDlet-Jar-URL: BBLab.jar
RIM-COD-URL: BBLab.cod
RIM-COD-SHA1: 73 cd f1 b7 b0 35 0c c3 a6 a5 42 53 5e 83 a1 e7 4c 02 7e d2
RIM-COD-Size: 6404
MicroEdition-Configuration: CLDC-1.1
MIDlet-Version: 0.0.1
MIDlet-Name: BBLab
MIDlet-Vendor: Vendor
MicroEdition-Profile: MIDP-2.0
RIM-MIDlet-Flags-1: 0
</source>
-------------
== Read Code from the BlackBerry Samples ==
------------------
=== Touch ===
[http://docs.blackberry.com/en/developers/deliverables/16179/Touch_sample_app_overview_663486_11.jsp Overview]
Location data is read from a text file and parsed using a string tokenizer class. The data is then used to constructMapFieldDemoSite objects corresponding to RIM® locations around the world. A given site is drawn as a polygon superimposed on the map that is currently displayed.
----------------
 
=== Memory ===
[http://docs.blackberry.com/en/developers/deliverables/10012/Memory_sample_app_overview_693111_11.jsp Overview]
 
'''The memory sample application demonstrates the best practices for memory use for multiple records'''. The sample application uses the Low Memory Manager to deallocate memory containing outdated data and group objects using the ObjectGroup API.
 
The sample application manages data for a fictional business and keeps records for each order that the business places. To see the effects of running the Low Memory Manager without exhausting flash memory, object handles, or persistent object handles, three menu items are provided that execute the same methods as the Low Memory Manager.
----------------

Navigation menu