Upload
others
View
2
Download
0
Embed Size (px)
Citation preview
AiiojjfU 0̂)1
Chapter 1: Introduction and Reqiiirenieiit Analysis
Introduction
J2ME basics
J2ME User interface
J2ME Data management
J2ME Personal Information Manager Profile
J2ME Networking and Web Services
Project Requirement Analysis
C hapter 2: Feasibility A nalysts
Background
Defining a Java Platform for Pervasive Devices
Architecture
10
13
Connected Limited Device Corrfiguration !5
Wiiat's N ew 20
CLDC TecIino!ogy 20
Connected Device Configurations 22
CDC lech n o lo g y 27
Profiles 29
Java M E Profiles 30
M obile Information Device Profile 30
Founclation Profile 32
Personal Profile 33
Personal Basis Profile 33
InforiTmtion Module Profile 33
Digital Set Top Box Profile 33
Digital Application M anagem ent Systems 34
H ow to Start 35
Java M E APIs in N okia Devices 35
M IDP 38
M IDP 1.0 40
Description 40
Limitations 40
Packages 40
M IDP 2.0 41
Overview 41
Enhancem ents 41
Java ME Configurations 15
Schedule 42
Secure N etworking 42
M ultimedia 43
From Enhancements 44
The Game API 49
RGB Images 50
Permission and Code Signing 54
Otiier New Features 5 5
MIDP Summery 56
MIDP 3.0 57
Important questions to complete the feasibility 59
Final Decision on choosing the develop part area 62
Business Case 63
C hap te r 3 : S oftw are and H ard w are R equ iren ien f 66
Software Requirement 66
Personal Profile 66
Additional APIs Available for Java ME 67
API Groups 67
Non Standard APIs 67
Standard APIs 67
JTW I 68
Mobile Service Architecture 69
J2ME Mindittaf) 70
ill
Tools by Category
IDEs by Platform
C/C++ Com pilers
Symbian specific Tools
Nokia Tools
Portal: Tools and SDK
W indows Utilities
Other
Hard ware Re qu i re ii i e n t
Series 40 Platform
Series 40 Platform Overview
Series 40 f Editions
Series 40 Editions
Series 40 3“' Editions
Series 40 5‘'‘ Editions
Java A pplication Developers
Flash Lite Developers
M edia and Content developers
Screen Resolutions
Series 60 Platform
Qvervievv
S60 Features
71
71
73
73
73
74
74
75
75
75
76
76
76
77
78
79
79
80
81
81
83
71
IV
Sym bian O S 83
S60 P latform Services 84
S60 A pplication Services 84
S60 Java T echno logy S ervices 85
860 A pplications 85
S60 P latform T echnologies 85
C om m unications 86
M essag ing 86
B row sing 86
D evelopm ent E nvironm ents 86
C+-I- 87
Java T e d in o lo g y 87
C onten t D evelopm ent 88
O tiiers 88
UI 88
S60 E d itions 88
S60 1“‘ Edition 89
S60 2"‘‘ E dition 89
860 3’' ' E d ition 91
C om patib ility 92
C ++ A pp lication D evelopers 93
Java A pp lication D evelopers 94
V
Flash Lite F rom A dobe D evelopers 94
Python A pplication D evelopers 95
M edia and C on ten t D evelopers 95
Screen R esolu tion 96
D ifferences B etw een S60 2 '“' and 3 '‘' Edition 98
In troduction 98
Base 98
Security 99
M ultim ed ia and G raphics 100
C om m unication 100
U ser In terface 102
D ata S ynchron iza tion and D evice M anagem ent 102
L ocation 103
B row sing an d D ow nload ing 103
M essag ing 104
P IM 105
Jav a M ID P 106
D R M 106
S 60 P hones 107
S eries 60 1st E dition (V ersion 1.0) 107
S eries 60 1st E d ition (V ersion 1.2) 107
Series 60 2nd E dition (V ersion 2 .0 ) 107
VI
S60 3rd Edition (Version 3.0) 108
S60 Platform and Device fdentification Codes 109
S60 Platform identification 110
S60 product Identification 110
Chapter 4: Design and Coding 114
Event Handling 114
The Big Picture 115
Command Objects 115
Phone Book Design 118
Labyrinth Design 121
Hit Brick Design 122
Drop AirForce D esign 124
Item Objects 126
Command and Com mandListener 127
Command and CommandListener API 130
Examples Accessing commands using in our 4 Applications 130
Example Mapping Command using in our 4 A pplications 134
Example M ultiple Commands using in our 4 Applications 138
High-Level User Interface 141
Screen and its API w ith example 141
VII
Item and its API with example 145
DateField with example 147
Gauge and its AP! 151
Stringltem and its API 153
TextF ield and its API 153
Choice and ChoiceGroup and its API 155
image and Imageltem their APIs with examples 157
M ore High-Level User Interfaces 163
List, its types and API with example 166
TextBox and its API 174
Alert and AlertType and its API with example 177
Ticker and its AP! 185
Low-Level User Interface 187
Canvas 187
Creating the Canvas with example 189
Coordinate system 190
Painting on the Canvas with example 192
Communication with Application Manager 196
Evelit Handling with example 197
Graphics 204
Obtaining a Graphics Object 205
Form and its API with example 144
VII!
Drawing Lines 210
Drawing Arcs 210
Drawing Rectangles 2 1 1
Drawing Text with example 211
Drawing Images with example 219
Translating Coordinates 224
Clipping Regions with example 225
Stroke Style with example 209
Searching Techniques (Phone Book Codes Testing) 230
Searching with RecordFilter witli complete examijle 230
RecordFilter API 232
Exception Handling 249
Invalid Record ID Exception 249
Record Store Exception 249
Record Store Full Exception 250
Record Store Not Found Exception 250
Record Store Not Open Exception 250
Catching Exception with example 251
Generic Connection FrameWork 253
IX
HTTP Connection 257
Create a Connection 257
Client Request 262
Server Resjsonse 265
Connection Information with example 27!
How to Deploy a Game Through the Net 276
Connector and Connections with example 276
HTTP with example 277
SMS with example 284
Chapters.- Iniipleinentation 2S8
Implementing the Applications 288
Building the Applications 289
Testing the Applications 289
Optimizing the Applications 290
Developing the Applications 290
Bluetooth, Infrared, and Data Cables 290
Over-the-Air Provisioning 291
M R 292
JAD 293
Connection Hierarchy with example 253
M andatory Information 293
Additional Information 294
Generate JAD from JA R file 294
Phone Book Implementations 297
Labyrinth liiiplemeiitations 300
Hit Brick Implementations 302
Drop AirForce Implementations 305
C hap ter? : Eiilianceincnt 308
Enhancement 308
Securing J2M E/M IDP Applications 309
Java technology in Wireless Web Service 309
Security in Wireless Web Service 310
Guarantee data integi'ity using Digital Signatui'es 311
Handling the XML digital signature in MIDP applications 312
The Bouncy Castle Crypto APIs 313
Handling the digest 313
DSA signature example 314
An RSA signature example 318
Perfonttance concerns 322
XI
C hapter 8: Conclusion 324
XII
1(1)1
C hap ter 2:
Figure 2.1. J2M E Platform Layer
Figure 2.2. Java Platform
Figure 2.3. CLDC Wireless Platform
Figure 2.4. J2SE, CDC, CLDC, Shared Part
Figure 2..5. CDC W ireless Plattbrin
Figure 2.6. Converged services Platlbrrn
Figure 2.7. CDC Structure
Figure 2.8. CLDC Structure
Figure 2,9. MID and MIDP Structure | | '
Figure 2.ll|-rjDiainonU],l|<im Sciceu shot |
1 1 ^ / • !!'liiiure 2.1 L
Chapter,^
Sijpw^ras \ Screeh shot
n ih ^ .y j£lva MF, Mindmap
Figure 3.2. Series 40 128*160 Screen
Figure 3.3. Series 40 240*320 Screen
Figure 3.4. Schematic Diagram Series 60
Figure 3.5. Series 60 176*208 Screen
Figure 3.6. Series 60 208*176 Screen
Figure 3.7. Series 60 240*320 Screen
Figure 3.8. Series 60 320*240 Screen
Figure 3.9. Series 60 352*416 Screen
f \ Jl i j ;
0
13
15
16
17
29
32
AiUL 'v'.-
n i c e ?
"1 9
49
54
70
80
80
81
96
96
96
96
97
XII!
Figure 3.10. Series 60 416*352 Screen
Cliaj)ter 4;
Figure 4.1. Command Map Screen shot
Figure 4.2. Ornid - PhoneEJook DFD
Figure 4.3. Ornid - PhoiieBook (Search Part) DFD
Figure 4.4. Oniid - Labyrinth DFD
Figure 4.5. Omid - Hit Brick DFD
Figure 4.6. Omid - Drop AirForce DFD
Figure 4.7. Conmiand with Exit Label
Figure 4.8. Cotnmand available in Menu Screen sliot
Figure 4.9. Accessing Exit Command Screen shot
Figure 4.10. Command Exit and Back Screen shot
Figure 4.11. Different Command Map and Menu Screen shot
Figure 4,12. Displayable class Hierarchy
Figure 4 .!3 . Labyrinth Game Installation Screen shot
Figure 4.14. Gauge Screen shot
Figure 4.15. M ultiple Choice Group Sciiw i snot
J I f I ̂ I':Figure 4. F^'-jHigh-Le<.|e! User |
'Figure 4 .1 /. M t'nuljera
l<;ij,ure 4.1^
Game Screen sfiQt>
^xclusi|Vf,^lJ^t screeifsiiot
r-im piicit List Screen shot
Figure 4.20. Implicit List by array o f String and Image Screen shot
Figure 4.21. Sharing Clipboard by TextBox
Figure 4.22. High definition APIs in Labyrinth Gam e Screen shot
Figure 4.23. D isplayable Class
Figure 4.24. Coordinate system Screen shot
Figure 4.25. Pixel Drawn
Figure 4.26. CanvasClass o f Drop AirForce Game Screen shot
Figure 4.27. Immutable image inside ChoiceGroup Screen shot
116
119
120
121
123
125
127
128
133
136
140
142!'{•riL
97
...156
164
165
166
167
170
177
185
188
19i
191
204
206
XIV
Figure 4.29. Anchor Points bounding 217
Figure 4.30. Anchor Point Top/Left 218
Figure 4.31. Alert, Vibration and Graphics in Drop AirForce Game Screen shot 223
Figure 4.32. Image Anchore Point Screen shot 224
Figure 4.33. iVlethods and Anchor Application support in Drop AirForce G am e Screen shot 227
C hap ter 5:
Figure 5.1. Simple Record Search Screen shot 232
Figure 5.2. PhoneBook Application Installation Screen shot 237
Figure 5.3. First M enu o f PhoneBook Application Screen shot 246
Figure 5.4. Adding, Sorting and Help by Using TextField Screen shot 247
Figure 5.5. Connection Hierarchy 254
Figure 5,6, Local Search, Network Search by using Internet Connection Screen shot 260
Figure 5,7. Send Score to the Net in Hit Brick Game Screen shot 279
Figure 5.8, Invite and inform your friend to Piay H it Brick Game Screen shot
C h a p te rs :
Figure 4.28. Font Metrics 216
Figure 6,1, Snap shots o f Omid - Phone | i
Figure 6,1l}S^iap shots ^ f Omid/^:
'ure 6.3. iRl^o)ieB§
Pi
»ure 0,4,
oneBfiok -Heraldfiy
bna id - 'fa b y r i
okV erllQ! its'
ook VerliO
) s l^ o tsp l^ m id - t'abyrinth Verl.O
itfi^il^fs'/L-ab'yrinth Hierarchy Modules
Figure 6.6, Snap shots o f Omid - H it Brick VerLO
Figure 6.7. Snap shots o f Omid - H it Brick Verl .0
Figure 6.8, Hit Brick Hierarchy Modules
Figure 6,9, Snap shots o f O m id -D ro p AirForce VerLO
Figure 6,10, Snap shots o f Omid ~ Drop AirForce V erl ,0
Figure 6,11, Drop AirForce Hierarchy Modules
298
299
300
301
302
303
304
305
306
307
XV
i L i a i i f i j j i 'lL 'a i;L ) lle i j
C hap ter 2:
Table 2.1. CLDC Package
Table 2.2. CDC Package
Table 2.3. Foundation Profile Package
Table 2.4. Personal Profile Package
Table 2.5. MIDP Package
C hapter 4:
Table 4.1. Types of ParameterI '\ W f'j i
: / / '> ( ilTable 4.2. Command (Class
1 / "AjT6 4.3. Coraraat]
' I ,, i\)le 4.4.' Screen CU
d L is te n e r j// '
?!e 4.5J
a-js \ /
Me 4'.^ ’ item ClassT'at
Table 4.7. DateField Class
Table 4.8. Gauge Class
Table 4.9. Stringltem Class
Table 4.10. TextFieki Class
Table 4.11. TextField Complete Class
Table 4.12. ChoiceGroup Class
Table 4.13. Image Class
Table 4.14. Imagelteiii Layout
' i f
"4
4diVI if
19
23
25
26
31
:::B0
130
144
145
147
147
152
153
154
155
157
158
159
XV!
Table 4.15. Imageltern Class
Table 4.16. Layout Directive
Table 4.17. List Class
Table 4.18. Choice Types
Table 4.19. TodBox Class
Table 4.20. TextField
Table 4 .21. Alert Type forever
Table 4.22. Alert
Table 4.23. Aiert Types
Table 4.24. Alert Type Method
Table 4.25. Ticker Class
Table 4.26. Canvas Coordinate Methods
Table 4.27. Canvas Paint Methods
Table 4.28. Application Manager Comuiuuu ition..
Table 4.29. Key Codes
Table 4.30i.jj Key Code Methods
)le 4.32 j
lie 4,33|.; ./ // ,
1
'jPointer
l̂̂ a?l6 4.31. Ga)m.,4ctic
l a
l a Co or
'■ Ijtlhods' I
illy
I\ I
159
160
171
172
176
176
178
180
182
182
186
192
196
v/
_ ,'|^ablo4J4'f Stroke Style
Table 4.35. Line drawing
Table 4.36. Arc Methods
Table 4.37. Rectangle Methods
Table 4.38. Font
Table 4.39. Font Attribute
Table 4.40. Attribute Methods
Table 4.4L Text Anchor Point
Table 4.42. Drawiiig Text Methods
200
202
207
209
210
210
211
212
213
215
217
219
XVil
T able 4 .43. Im age M ethod
T able 4 .44. Im age A n ch o r P oin ts
T ab le 4 .45. T ra n sla tio n M etliods
T ab le 4 ,46. C lip p in g M ethods
Chapter 5:
T able 5.1. R e co rd F ilte r In terface
T ab le 5.2. C L D C C o n n ecto r M e th o d s
T ab le 5.3. C L D C C o n n ecto r M odes
T ab le 5.4, R eq u est M ethod
T ab le 5.5. C lien t R equest M ethods
T ab le 5.6. R e.sponse M ethods
T ab le 5.7. S erver R esp o n se M ethods
T ab le 5,8, C o n n ectio n M ethods
)
!/'i
' ( I 'i
* j / 'V
i lfD iy|;
n ‘ i: i:
1 !
%if //%
223
225
226
232
258
258
262
263
266
267
271
2 2 0
XVIII