- Visual C++源码
- Visual Basic源码
- C++ Builder源码
- Java源码
- Delphi源码
- C/C++源码
- PHP源码
- Perl源码
- Python源码
- Asm源码
- Pascal源码
- Borland C++源码
- Others源码
- SQL源码
- VBScript源码
- JavaScript源码
- ASP/ASPX源码
- C#源码
- Flash/ActionScript源码
- matlab源码
- PowerBuilder源码
- LabView源码
- Flex源码
- MathCAD源码
- VBA源码
- IDL源码
- Lisp/Scheme源码
- VHDL源码
- Objective-C源码
- Fortran源码
- tcl/tk源码
- QT源码
README.txt
资源名称:bluetooth.zip [点击查看]
上传用户:szyfpy
上传日期:2021-03-01
资源大小:240k
文件大小:7k
源码类别:
通讯/手机编程
开发平台:
Java
- // Copyright 2004 Nokia Corporation.
- //
- // THIS SOURCE CODE IS PROVIDED 'AS IS', WITH NO WARRANTIES WHATSOEVER,
- // EXPRESS OR IMPLIED, INCLUDING ANY WARRANTY OF MERCHANTABILITY, FITNESS
- // FOR ANY PARTICULAR PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE
- // OR TRADE PRACTICE, RELATING TO THE SOURCE CODE OR ANY WARRANTY OTHERWISE
- // ARISING OUT OF ANY PROPOSAL, SPECIFICATION, OR SAMPLE AND WITH NO
- // OBLIGATION OF NOKIA TO PROVIDE THE LICENSEE WITH ANY MAINTENANCE OR
- // SUPPORT. FURTHERMORE, NOKIA MAKES NO WARRANTY THAT EXERCISE OF THE
- // RIGHTS GRANTED HEREUNDER DOES NOT INFRINGE OR MAY NOT CAUSE INFRINGEMENT
- // OF ANY PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OWNED OR CONTROLLED
- // BY THIRD PARTIES
- //
- // Furthermore, information provided in this source code is preliminary,
- // and may be changed substantially prior to final release. Nokia Corporation
- // retains the right to make changes to this source code at
- // any time, without notice. This source code is provided for informational
- // purposes only.
- //
- // Nokia and Nokia Connecting People are registered trademarks of Nokia
- // Corporation.
- // Java and all Java-based marks are trademarks or registered trademarks of
- // Sun Microsystems, Inc.
- // Other product and company names mentioned herein may be trademarks or
- // trade names of their respective owners.
- //
- // A non-exclusive, non-transferable, worldwide, limited license is hereby
- // granted to the Licensee to download, print, reproduce and modify the
- // source code. The licensee has the right to market, sell, distribute and
- // make available the source code in original or modified form only when
- // incorporated into the programs developed by the Licensee. No other
- // license, express or implied, by estoppel or otherwise, to any other
- // intellectual property rights is granted herein.
- Release Notes: btsppEcho MIDlet (March 2004)
- ===============================================================
- These notes are only intended as a brief guide for building and running
- the example. A more detailed description of the design of this MIDlet
- example has been provided as a separate design document.
- 1. Build environment
- --------------------
- 'JBuilder' with 'MobileSet' plus 'Nokia Developers Suite
- for J2ME' were used to build and run the MIDlet on a Windows test
- environment. Installation, configuration and use of these tools is beyond
- the scope of the release notes.
- A build.xml file is also included to build the MIDlet using ant
- It uses the MIDP tasks included in the Antenna project. It can be found
- at http://antenna.sourceforge.net. Copy the antenna-bin.jar file to
- the ANT_HOME/lib directory
- If necessary to customize some properties build.properties can be used
- 2. Building and running the example using JBuilder
- --------------------------------------------------
- Step 1. Open the BtsppEcho.jpx project
- This project contains all the .java source files contained
- in the subdirectory '.src...'
- Notes:
- - The 'Project' / 'Project Properties' windows can be used
- to set project properties related to building and running a MIDlet.
- - (The 'Tools' / 'Nokia Developer's Suite for J2ME(TM)' /
- 'Create Application Descriptor' can be used to create a .jad and
- .jar files. These have already been created as a convienence.)
- Step 2. Building the MIDlet
- These JBuilder mechanisms were used to build the MIDlet classfiles:
- 'Project' / 'Make Project "btsppEcho.jpx"'
- 'Project' / 'Rebuild Project "btsppEcho.jpx"'
- You should see a message like: 'Build succeeded. Build took 4 seconds.'
- Once the project has been built at least once as in Step 1,
- one can use:
- 'Tools' / 'Nokia Developer's Suite for J2ME' / 'Recreate'
- to recreate the jar file.
- Step 3. Running the MIDlet
- Use this mechanism to run the example:
- 'Run' / 'Run Project'
- The 'Project' / 'Project Properties' / 'Run' / 'MIDlet' tab
- may be used to run the example using via the .jad and .jar files.
- For a Bluetooth piconet, start running the 'Bluetooth slaves' first
- (i.e. the 'application-level clients' in this example) and then start the
- 'Bluetooth master' (i.e. the 'application-level server' in this example)
- and initiate the Bluetooth connections from the master to the slaves.
- Step 4. Preparing the MIDlet for OTA download
- One may wish to perform various optional steps at this point,
- such as obfuscation, optimized compiling, jar file compression, etc.
- These are beyond the scope of these release notes.
- Because a variety of methods could be used to create the final .jad
- and .jar files used for OTA downloading of the MIDlet:
- - I recommend checking that the attributes in the .jad and
- .jar manifest files are correct, and that they match EXACTLY when
- present in both. One should think about the reasons why some
- arbitrary actual MIDP device might refuse to run a MIDlet
- (JAR size mismatches, attribute mismatches, etc.)
- - The 'check.sh' script gives a model of the types of things one
- might want to double-check (e.g. attribute values should match,
- MIDlet-Jar-Size should match the actual size, MIDlet-Jar-URL
- should be correct, etc.) in the process of preparing .jad and
- .jar files for use in OTA downloading. It is a guide and may
- not be an exhaustive list.
- - It is worth emphasizing that the mandatory parameters of the
- .jad and .jar manifest files should be present, should be correct,
- and should match for those attributes which are present in both.
- The MIDP specification covers the mandatory .jad and .jar
- manifest attributes.
- Consult the relevant documentation of your build tools, for any
- other questions or issues that may arise.
- 3. Building and running the example using ant
- ---------------------------------------------
- Having ant and antenna installed the MIDlet can be built using the
- 'ant' or ant 'build' command.
- For a clean build use the
- 'ant cleanbuild' command
- 4. Other notes
- --------------
- This MIDlet does Class of Device (COD) filtering after 'device
- inquiry' and before 'service discovery'. This is essential in a real
- MIDlet, so the MIDlet don't search to see if a game service is
- running on any arbitrary nearby Bluetooth device (e.g. headset, etc.),
- but just one the ones where the service is most likely to be found.
- See the related code for the COD filtering in method
- 'deviceDiscovered' of class 'example.btsppecho.ServiceDiscoveryList'.
- However the 'Series 60 MIDP Concept Emulator Beta 0.3.1' doesn't
- seem to return values from methods DeviceClass.getMajorDeviceClass()
- and DeviceClass.getMinorDeviceClass() that one might
- expect from a real mobile phone. That means the COD filtering
- code fails when using that beta version of the emulator. As a
- workaround if you use that emulator, you can set the parameter
- "isEmulator = true" in method 'deviceDiscovered' of class
- 'example.btsppecho.ServiceDiscoveryList' by modifying the
- Java sourcecode. If you do this, you should remember to set
- "isEmulator = false" before compiling the MIDlet for download
- onto real a MIDP phone.