Java ME Customers.


64 views
Uploaded on:
Category: Animals / Pets
Description
Java ME Clients. Versatile Computing. A few materials from MobEdu.net. Bruce Scharlau, ... measurement contrasted with desktop and ordinary dispersed processing. ...
Transcripts
Slide 1

Java ME Clients Mobile Computing Bruce Scharlau, University of Aberdeen, 2010 Some materials from MobEdu.net

Slide 2

Constantly changing business sector implies concentrate on learning rudiments PDAs are gone and mobiles change Bruce Scharlau, University of Aberdeen, 2010 http://www.sheldoncomics.com/file/050222.html

Slide 3

Mobile processing offers another novel measurement This is still another programming measurement contrasted with desktop and ordinary dispersed registering. Bruce Scharlau, University of Aberdeen, 2010

Slide 4

Java Family Source: http://java.sun.com/designer/onlineTraining/webcasts/pdf/toronto/bday.pdf Bruce Scharlau, University of Aberdeen, 2010

Slide 5

J2ME and J2EE interface effortlessly Source: http://java.sun.com/outlines/earlyaccess/remote/planning/designing.pdf Bruce Scharlau, University of Aberdeen, 2010

Slide 6

Java ME Components Hosting OS KVM – execution motor with improved JVM CLDC – base library MIDP – extra libraries Phone PDA MIPD Profile CLDC Configuration KVM Bruce Scharlau, University of Aberdeen, 2010

Slide 7

Configurations CLDC – Connected, constrained gadget arrangement – expect detachment CDC = Connected gadget setup – accept constantly associated Bruce Scharlau, University of Aberdeen, 2010

Slide 8

Example Java ME Stack Source: http://java.sun.com/engineer/onlineTraining/webcasts/pdf/toronto/bday.pdf Bruce Scharlau, University of Aberdeen, 2010

Slide 9

CLDC 1.0 Overview Targeted to little gadgets with 160-512kb memory accessible for Java Limited (battery) power and irregular availability in addition to a little UI (screen) Sun Java reference usage utilizing KVM Bruce Scharlau, University of Aberdeen, 2010

Slide 10

CLDC Scope contrasts from center Java Main contrasts: No drifting point support required No finish of item cases Limited blunder taking care of No string bunches, reflection, JNI Core java.* libraries I/O and systems administration Security and Internationalization New classes, javax.microedition.* Bruce Scharlau, University of Aberdeen, 2010

Slide 11

"additional" APIs can upgrade applications Just recollect that they are \'discretionary\', so may not be accessible Bruce Scharlau, University of Aberdeen, 2010 http://java.sun.com/javame/diagram/products.jsp

Slide 12

CLDC Classes need pre-check Source: http://java.sun.com/designer/onlineTraining/webcasts/pdf/toronto/bday.pdf Bruce Scharlau, University of Aberdeen, 2010

Slide 13

CLDC Networking depends on GCF CLDC utilizes GCF (Generic Connection Framework) Everything is a URL Connector.open("<protocol>://<address>:<parameters>") Protocols bolstered Filesk, HTTP, Sockets, Communication ports All predetermined in MIDP Profile HTTP and HTTPS must be upheld, the others are discretionary Bruce Scharlau, University of Aberdeen, 2010

Slide 14

Mobile Information Device Profile (MIDP) Targets two-way gadgets actualizing CLDC Provides Application model, ie lifecycle and bundling Display toolbox, UI techniques Persistent information stockpiling HTTP 1.1 systems administration utilizing CLDC GCF MIDP 1.0 broadly accessible MIDP 2.0 discharged Nov. 2002 MIDP 2.1 discharged summer 2006 MIDP 3 out in beta spring 2009 Bruce Scharlau, University of Aberdeen, 2010

Slide 15

MIDP applications (MIDlets) move from state to state executing three strategies Bruce Scharlau, University of Aberdeen, 2010

Slide 16

Midlets are bundled in containers with required assets MyApp.jar Com/bundle/classes META-INF/MANIFEST.MF Mylogo.png MyApp.jad Bruce Scharlau, University of Aberdeen, 2010

Slide 17

Jad and Manifest are comparative required records for Java ME applications AuctionMidlet.jad MIDlet-1: AuctionMIDlet,,com.auction.j2me.AuctionMIDlet MIDlet-Jar-URL: AuctionMidlet.jar MIDlet-Name: AuctionMidlet Midlet Suite MIDlet-Vendor: Midlet Suite Vendor MIDlet-Version: 1.0.0 MicroEdition-Configuration: CLDC-1.1 MicroEdition-Profile: MIDP-2.1 MIDlet-Jar-Size: 4396 Bruce Scharlau, University of Aberdeen, 2010

Slide 18

Manifest goes in the jug document MANIFEST.MF Manifest-Version: 1.0 MicroEdition-Configuration: CLDC-1.1 MIDlet-Name: AuctionMidlet Midlet Suite Ant-Version: Apache Ant 1.6.3 Created-By: 1.5.0_14-b03 (Sun Microsystems Inc.) MIDlet-Vendor: Midlet Suite Vendor MIDlet-1: AuctionMIDlet,,com.auction.j2me.AuctionMIDlet MIDlet-Version: 1.0.0 MicroEdition-Profile: MIDP-2.1 Bruce Scharlau, University of Aberdeen, 2010

Slide 19

The JAD references the JAR Download of JAD means opening: The AMS downloads the JAR by the data in the JAD Mostly the JAR and the JAD are in comparable envelope AMS =Application Management System Bruce Scharlau, University of Aberdeen, 2010

Slide 20

The JAD is approved by the AMS (Application Management System) Is the CLDC rendition right? Is the MIDP rendition right? Is there enough memory to download the MIDlet? Where is the JAR record? Where is the execution unit inside the JAR? Bruce Scharlau, University of Aberdeen, 2010

Slide 21

JAD utilized for over the air (OTA) establishment JAD watches that the application will agree and fit on the cell phone when utilizing OTA Otherwise, you can introduce the Jar record if side-stacking from PC Bruce Scharlau, University of Aberdeen, 2010

Slide 22

MIDlet Development Write Java application Compile Preverify (and muddle) Package into Jar document Create sending descriptor (jad) Deploy and keep running in toolbox or other gadget Bruce Scharlau, University of Aberdeen, 2010

Slide 23

Preverify to watch that classes are right All classes consequently preverified after code is assembled If it fizzles, then mistake message is passed back to the console Automatically bundles application utilizing name of utilization registry Bruce Scharlau, University of Aberdeen, 2010

Slide 24

Obfuscate to contract the application Renames strategies and variables with shorter names Optional and prescribed Bruce Scharlau, University of Aberdeen, 2010

Slide 25

Jar and keep running in emulator Create group with assets for arrangement Use essential or complex emulator Bruce Scharlau, University of Aberdeen, 2010

Slide 26

Run on gadget for conclusive check Running on genuine gadgets is the last check Start with low end gadget Bruce Scharlau, University of Aberdeen, 2010

Slide 27

MIDlet must actualize three techniques: import javax.microedition.midlet.*; import javax.microedition.lcdui.*; open class HelloMidlet augments MIDlet { open void startApp() { } open void pauseApp() { } open void destroyApp(boolean unlimited) { } Bruce Scharlau, University of Aberdeen, 2010

Slide 28

MIDlet needs other key parts Import the bundles import javax.microedition.midlet.*; import javax.microedition.lcdui.*; All MIDlet stretches out from the MIDlet class open class HelloMidlet broadens MIDlet actualizes CommandListener { Furthermore it executes the CommandListener class Bruce Scharlau, University of Aberdeen, 2010

Slide 29

MIDlet needs to initialise and make variables/Initialize the variables private Form structure; private Display show; private Command exitCommand ; Bruce Scharlau, University of Aberdeen, 2010

Slide 30

MIDlet use startApp() to move to dynamic express The MIDlet begins at the call of the startApp() open void startApp() { structure = new Form("Hello"); show = Display.getDisplay(this); exitCommand = new Command("Exit", Command.SCREEN, 1); form.addCommand(exitCommand); form.setCommandListener((CommandListener)this); form.append(new StringItem("Hello", "Hello World!")); display.setCurrent(form); } Commands and the StringItem is added to the Form Show the Form on the showcase Bruce Scharlau, University of Aberdeen, 2010

Slide 31

The commandAction() strategy handles the approaching summons open void commandAction(Command charge, Displayable screen) { if ( order == exitCommand ) { destroyApp(true); notifyDestroyed(); } Bruce Scharlau, University of Aberdeen, 2010

Slide 32

If it\'s not utilized abandon it discharge The accompanying techniques are unused, so we abandon them unfilled public void pauseApp() { } public void destroyApp(boolean unrestricted) { } Bruce Scharlau, University of Aberdeen, 2010

Slide 33

Before and after begin Bruce Scharlau, University of Aberdeen, 2010

Slide 34

Three levels of programming for mobiles Application level is about applications for end clients utilizing gave lower-level segments Middleware of correspondence and different libraries for conventions (bluetooth, and so on) Low-level programming, for example, pieces and gadget drivers (stage) Bruce Scharlau, University of Aberdeen, 2010

Slide 35

Class range Heap Stack App zone Run-time information Understanding the virtual machine helps advancement loads Execution motor Class loader calls *.class Scheduler loads classes into Garbage gathering Memory supervisor Bytecode translator use Bruce Scharlau, University of Aberdeen, 2010

Slide 36

Allow waste accumulation to carry out its occupation Release early, apportion late: Deallocate objects at the earliest opportunity, and designate new protests as late as would be prudent Bruce Scharlau, University of Aberdeen, 2010

Slide 37

Pay consideration regarding your memory use to enhance execution Use what is required for the application. Use single-connected rundown, rather than twofold in the event that you just need to navigate it in one bearing. Bruce Scharlau, University of Aberdeen, 2010

Slide 38

Use direct information structures to moderate memory Linear information structures use nearby memory for their segments, rather than particular memory for every thing. Straight: connected records, tables Non-direct: diagrams, trees Bruce Scharlau, University of Aberdeen, 2010

Slide 39

Avoid little classes for bigger ones There is a fundamental overhead for ANY class Inner classes cause the same issue, as does utilizing heaps of discrete special cases Bruce Scharlau, University of Aberdeen, 2010

Slide 40

Avoid conditions where conceivable