SlideShare une entreprise Scribd logo
1  sur  20
Télécharger pour lire hors ligne
Developing	
  UI	
  for	
  Asha	
  Pla4orm	
  
Jussi	
  Pohjolainen	
  
Tampere	
  University	
  of	
  Applied	
  Sciences	
  
Approaches	
  
•  LCDUI	
  high-­‐level	
  components	
  

–  Limited	
  Capability	
  Device	
  UI	
  (LCDUI)	
  	
  
–  Components	
  are	
  styled	
  with	
  Asha	
  look	
  &	
  feel	
  
–  Custom	
  components	
  can	
  be	
  created	
  with	
  CustomItem	
  

•  LWUIT	
  (for	
  Nokia)	
  Components	
  

–  Lightweight	
  UI	
  Toolkit	
  (LWUIT)	
  	
  
–  More	
  comprehensive	
  component	
  set	
  
–  Can	
  be	
  branded	
  using	
  your	
  own	
  theme	
  

•  Custom	
  UI	
  on	
  (Game)Canvas	
  	
  

–  Full	
  screen	
  apps	
  
–  Everything	
  is	
  drawn	
  pixel	
  by	
  pixel	
  
–  Good	
  for	
  games	
  
LCDUI	
  
LCDUI	
  
•  Limited	
  Capability	
  Device	
  UI	
  API	
  
•  Really	
  simple	
  UI:	
  one	
  "screen"	
  visible	
  at	
  a	
  Mme	
  
•  Screen?	
  	
  
–  Display d = Display.getDisplay(this);
–  d.setCurrent(screenHere!);

•  It's	
  a	
  subclass	
  of	
  Displayable	
  class!	
  
PossibiliMes	
  
•  You	
  can	
  put	
  to	
  screen	
  
–  Alert, List, TextBox

•  Also	
  
–  Form	
  that	
  contains	
  items	
  
–  Items?	
  StringItem, TextField …	
  

•  And	
  some	
  low	
  UI	
  stuff	
  
–  Canvas
–  GameCanvas
Example	
  
Display d = Display.getDisplay(this);
List list = new List("List", List.EXCLUSIVE);
list.append("Hello", null);
list.append("World", null);
d.setCurrent(list);
Example	
  with	
  Command	
  
Display d = Display.getDisplay(this);
List list = new List("List", List.EXCLUSIVE);
list.append("Hello", null);
list.append("World", null);
Command c = new Command("Ok", Command.OK, 0);
list.addCommand(c);
d.setCurrent(list);
Listener	
  
public class Example extends MIDlet implements CommandListener {
...
protected void startApp() throws MIDletStateChangeException {
Display d = Display.getDisplay(this);
List list = new List("List", List.EXCLUSIVE);
list.append("Hello", null);
list.append("World", null);
Command ok = new Command("Ok", Command.OK, 0);
list.addCommand(ok);
list.setCommandListener(this);
d.setCurrent(list);
}
public void commandAction(Command c, Displayable d) {
// Command clicked!
}
}
LWUIT	
  
LWUIT	
  
•  LWUIT	
  is	
  an	
  open	
  source	
  API	
  for	
  UI	
  components,	
  
layouts	
  and	
  effects	
  
–  Built	
  on	
  top	
  of	
  Canvas	
  class	
  

•  Nokia	
  Asha	
  Theme	
  
•  Scales	
  to	
  different	
  screen	
  resoluMons	
  and	
  
orientaMons.	
  Support	
  for	
  touch	
  and	
  non-­‐touch	
  
•  LCDUI	
  is	
  beZer	
  opMon	
  for	
  performance	
  cri@cal	
  
apps.	
  By	
  using	
  LCDUI	
  you	
  will	
  get	
  smaller	
  binary	
  
size	
  
•  LWUIT	
  increase	
  jar	
  size	
  by	
  200	
  –	
  800	
  kb.	
  
Form	
  
•  Root	
  of	
  your	
  UI	
  
–  Title	
  –	
  ContentPane	
  –	
  Menubar	
  

•  Scrollable	
  
•  Se`ng	
  layout	
  
–  setLayout(…)

•  Adding	
  components	
  
–  addComponent(…)
Example	
  
protected void startApp() throws
MIDletStateChangeException {
Display.init(this);
Form f = new Form();
f.setTitle("Jussi's Revenge!");
f.addComponent(new Button("Play"));
f.addComponent(new Button("Highscore"));
f.addComponent(new Button("Exit"));
f.show();
}
Layout	
  
•  Layout	
  managers	
  allow	
  a	
  Container	
  to	
  arrange	
  
its	
  components	
  by	
  a	
  set	
  of	
  rules	
  that	
  would	
  be	
  
adapted	
  for	
  specific	
  screen/font	
  sizes.	
  
–  BorderLayout
–  BoxLayout
–  CoordinateLayout
–  FlowLayout
–  GridLayout
–  …	
  
Example	
  
protected void startApp() throws
MIDletStateChangeException {
Display.init(this);
Form f = new Form();
f.setTitle("Jussi's Revenge!");
// Really beautiful UI :D
f.setLayout(new GridLayout(2,2));
f.addComponent(new Button("Play"));
f.addComponent(new Button("Highscore"));
f.addComponent(new Button("Info"));
f.addComponent(new Button("Exit"));
f.show();
}
Example	
  
protected void startApp() throws
MIDletStateChangeException {
Display.init(this);
Form f = new Form();
f.setTitle("Jussi's Revenge!");
f.setLayout(new BorderLayout());
Container buttonBar = new Container(new
FlowLayout(Component.CENTER));
buttonBar.addComponent(new Button("Play"));
buttonBar.addComponent(new Button("Exit"));
Label label = new Label("Welcome!");
label.setAlignment(Component.CENTER);
f.addComponent(BorderLayout.CENTER, label);
f.addComponent(BorderLayout.SOUTH, buttonBar);
f.show();
}
Switching	
  Forms	
  
•  Create	
  mulMple	
  forms,	
  call	
  show()	
  
•  Possible	
  to	
  add	
  transiMon	
  animaMons	
  
–  form.setTransitionOutAnimator(…);
Handling	
  Back-­‐buZon	
  
Form a = new Form();
Command command = …
a.setBackCommand(command);
a.setCommandListener(this);

Contenu connexe

Tendances

Tendances (20)

Practical guide to optimization in Unity
Practical guide to optimization in UnityPractical guide to optimization in Unity
Practical guide to optimization in Unity
 
Optimizing Large Scenes in Unity
Optimizing Large Scenes in UnityOptimizing Large Scenes in Unity
Optimizing Large Scenes in Unity
 
Intro to Building Android Games using libGDX
Intro to Building Android Games using libGDXIntro to Building Android Games using libGDX
Intro to Building Android Games using libGDX
 
HoloLens Programming Tutorial: AirTap & Spatial Mapping
HoloLens Programming Tutorial: AirTap & Spatial MappingHoloLens Programming Tutorial: AirTap & Spatial Mapping
HoloLens Programming Tutorial: AirTap & Spatial Mapping
 
Aplicações assíncronas no Android com Coroutines & Jetpack
Aplicações assíncronas no Android com Coroutines & JetpackAplicações assíncronas no Android com Coroutines & Jetpack
Aplicações assíncronas no Android com Coroutines & Jetpack
 
Declarative UIs with Jetpack Compose
Declarative UIs with Jetpack ComposeDeclarative UIs with Jetpack Compose
Declarative UIs with Jetpack Compose
 
Game development -session on unity 3d
Game development -session on unity 3d Game development -session on unity 3d
Game development -session on unity 3d
 
Introdução ao Desenvolvimento Android com Kotlin
Introdução ao Desenvolvimento Android com KotlinIntrodução ao Desenvolvimento Android com Kotlin
Introdução ao Desenvolvimento Android com Kotlin
 
【Unite 2017 Tokyo】ScriptableObjectを使ってプログラマーもアーティストも幸せになろう
【Unite 2017 Tokyo】ScriptableObjectを使ってプログラマーもアーティストも幸せになろう【Unite 2017 Tokyo】ScriptableObjectを使ってプログラマーもアーティストも幸せになろう
【Unite 2017 Tokyo】ScriptableObjectを使ってプログラマーもアーティストも幸せになろう
 
【Unite 2017 Tokyo】インスタンシングを用いた美麗なグラフィックの実現方法
【Unite 2017 Tokyo】インスタンシングを用いた美麗なグラフィックの実現方法【Unite 2017 Tokyo】インスタンシングを用いた美麗なグラフィックの実現方法
【Unite 2017 Tokyo】インスタンシングを用いた美麗なグラフィックの実現方法
 
Unreal Engine Basics 04 - Behavior Trees
Unreal Engine Basics 04 - Behavior TreesUnreal Engine Basics 04 - Behavior Trees
Unreal Engine Basics 04 - Behavior Trees
 
Ufo Ship for AWS ECS
Ufo Ship for AWS ECSUfo Ship for AWS ECS
Ufo Ship for AWS ECS
 
Optimizing mobile applications - Ian Dundore, Mark Harkness
Optimizing mobile applications - Ian Dundore, Mark HarknessOptimizing mobile applications - Ian Dundore, Mark Harkness
Optimizing mobile applications - Ian Dundore, Mark Harkness
 
Next generation mobile gp us and rendering techniques - niklas smedberg
Next generation mobile gp us and rendering techniques - niklas smedbergNext generation mobile gp us and rendering techniques - niklas smedberg
Next generation mobile gp us and rendering techniques - niklas smedberg
 
Unreal Engine Basics 06 - Animation, Audio, Visual Effects
Unreal Engine Basics 06 - Animation, Audio, Visual EffectsUnreal Engine Basics 06 - Animation, Audio, Visual Effects
Unreal Engine Basics 06 - Animation, Audio, Visual Effects
 
Unreal Engine Basics 03 - Gameplay
Unreal Engine Basics 03 - GameplayUnreal Engine Basics 03 - Gameplay
Unreal Engine Basics 03 - Gameplay
 
School For Games 2015 - Unity Engine Basics
School For Games 2015 - Unity Engine BasicsSchool For Games 2015 - Unity Engine Basics
School For Games 2015 - Unity Engine Basics
 
Practical Guide for Optimizing Unity on Mobiles
Practical Guide for Optimizing Unity on MobilesPractical Guide for Optimizing Unity on Mobiles
Practical Guide for Optimizing Unity on Mobiles
 
UI Debugging - Cocoaheads Dresden (English)
UI Debugging - Cocoaheads Dresden (English)UI Debugging - Cocoaheads Dresden (English)
UI Debugging - Cocoaheads Dresden (English)
 
Eclipse Training - Introduction
Eclipse Training - IntroductionEclipse Training - Introduction
Eclipse Training - Introduction
 

En vedette

iOS Selectors Blocks and Delegation
iOS Selectors Blocks and DelegationiOS Selectors Blocks and Delegation
iOS Selectors Blocks and Delegation
Jussi Pohjolainen
 
Expanding Programming Skills (C++): Intro to Course
Expanding Programming Skills (C++): Intro to CourseExpanding Programming Skills (C++): Intro to Course
Expanding Programming Skills (C++): Intro to Course
Jussi Pohjolainen
 
iOS: Using persistant storage
iOS: Using persistant storageiOS: Using persistant storage
iOS: Using persistant storage
Jussi Pohjolainen
 
libGDX: Simple Frame Animation
libGDX: Simple Frame AnimationlibGDX: Simple Frame Animation
libGDX: Simple Frame Animation
Jussi Pohjolainen
 

En vedette (7)

iOS Selectors Blocks and Delegation
iOS Selectors Blocks and DelegationiOS Selectors Blocks and Delegation
iOS Selectors Blocks and Delegation
 
Expanding Programming Skills (C++): Intro to Course
Expanding Programming Skills (C++): Intro to CourseExpanding Programming Skills (C++): Intro to Course
Expanding Programming Skills (C++): Intro to Course
 
iOS: Using persistant storage
iOS: Using persistant storageiOS: Using persistant storage
iOS: Using persistant storage
 
Compiling Qt Apps
Compiling Qt AppsCompiling Qt Apps
Compiling Qt Apps
 
Intro to Java Technology
Intro to Java TechnologyIntro to Java Technology
Intro to Java Technology
 
Android Sensors
Android SensorsAndroid Sensors
Android Sensors
 
libGDX: Simple Frame Animation
libGDX: Simple Frame AnimationlibGDX: Simple Frame Animation
libGDX: Simple Frame Animation
 

Similaire à Intro to Asha UI

Session 210 _accessibility_for_ios
Session 210 _accessibility_for_iosSession 210 _accessibility_for_ios
Session 210 _accessibility_for_ios
cheinyeanlim
 
East Coast DevCon 2014: The Slate UI Framework - Architecture & Tools
East Coast DevCon 2014: The Slate UI Framework - Architecture & ToolsEast Coast DevCon 2014: The Slate UI Framework - Architecture & Tools
East Coast DevCon 2014: The Slate UI Framework - Architecture & Tools
Gerke Max Preussner
 

Similaire à Intro to Asha UI (20)

Gui
GuiGui
Gui
 
Plug yourself in and your app will never be the same (1 hr edition)
Plug yourself in and your app will never be the same (1 hr edition)Plug yourself in and your app will never be the same (1 hr edition)
Plug yourself in and your app will never be the same (1 hr edition)
 
Swift
SwiftSwift
Swift
 
ExtJS: La piattaforma vincente (multiple screens)
ExtJS: La piattaforma vincente (multiple screens)ExtJS: La piattaforma vincente (multiple screens)
ExtJS: La piattaforma vincente (multiple screens)
 
Programming iOS in C#
Programming iOS in C#Programming iOS in C#
Programming iOS in C#
 
Building UI for games using the new UI Builder - Unite Copenhagen 2019
Building UI for games using the new UI Builder - Unite Copenhagen 2019Building UI for games using the new UI Builder - Unite Copenhagen 2019
Building UI for games using the new UI Builder - Unite Copenhagen 2019
 
Session 210 _accessibility_for_ios
Session 210 _accessibility_for_iosSession 210 _accessibility_for_ios
Session 210 _accessibility_for_ios
 
AWT controls, Listeners
AWT controls, ListenersAWT controls, Listeners
AWT controls, Listeners
 
iOS for C# Developers - DevConnections Talk
iOS for C# Developers - DevConnections TalkiOS for C# Developers - DevConnections Talk
iOS for C# Developers - DevConnections Talk
 
Android Jumpstart Jfokus
Android Jumpstart JfokusAndroid Jumpstart Jfokus
Android Jumpstart Jfokus
 
Cross Platform Mobile Development using Flutter by Wei Meng Lee at Mobile foc...
Cross Platform Mobile Development using Flutter by Wei Meng Lee at Mobile foc...Cross Platform Mobile Development using Flutter by Wei Meng Lee at Mobile foc...
Cross Platform Mobile Development using Flutter by Wei Meng Lee at Mobile foc...
 
Java1
Java1Java1
Java1
 
Java1
Java1Java1
Java1
 
Go for building cross-platform graphical apps
Go for building cross-platform graphical appsGo for building cross-platform graphical apps
Go for building cross-platform graphical apps
 
AWT controls, Listeners
AWT controls, ListenersAWT controls, Listeners
AWT controls, Listeners
 
Develop apps for (Apple) TV
Develop apps for (Apple) TVDevelop apps for (Apple) TV
Develop apps for (Apple) TV
 
Develop apps for (Apple) TV
Develop apps for (Apple) TVDevelop apps for (Apple) TV
Develop apps for (Apple) TV
 
Qt
QtQt
Qt
 
Cross-platform mobile dev with Mono
Cross-platform mobile dev with MonoCross-platform mobile dev with Mono
Cross-platform mobile dev with Mono
 
East Coast DevCon 2014: The Slate UI Framework - Architecture & Tools
East Coast DevCon 2014: The Slate UI Framework - Architecture & ToolsEast Coast DevCon 2014: The Slate UI Framework - Architecture & Tools
East Coast DevCon 2014: The Slate UI Framework - Architecture & Tools
 

Plus de Jussi Pohjolainen

Advanced JavaScript Development
Advanced JavaScript DevelopmentAdvanced JavaScript Development
Advanced JavaScript Development
Jussi Pohjolainen
 
Creating Asha Games: Game Pausing, Orientation, Sensors and Gestures
Creating Asha Games: Game Pausing, Orientation, Sensors and GesturesCreating Asha Games: Game Pausing, Orientation, Sensors and Gestures
Creating Asha Games: Game Pausing, Orientation, Sensors and Gestures
Jussi Pohjolainen
 
Creating Games for Asha - platform
Creating Games for Asha - platformCreating Games for Asha - platform
Creating Games for Asha - platform
Jussi Pohjolainen
 
Intro to Java ME and Asha Platform
Intro to Java ME and Asha PlatformIntro to Java ME and Asha Platform
Intro to Java ME and Asha Platform
Jussi Pohjolainen
 
Quick Intro to JQuery and JQuery Mobile
Quick Intro to JQuery and JQuery MobileQuick Intro to JQuery and JQuery Mobile
Quick Intro to JQuery and JQuery Mobile
Jussi Pohjolainen
 

Plus de Jussi Pohjolainen (20)

Moved to Speakerdeck
Moved to SpeakerdeckMoved to Speakerdeck
Moved to Speakerdeck
 
Java Web Services
Java Web ServicesJava Web Services
Java Web Services
 
Box2D and libGDX
Box2D and libGDXBox2D and libGDX
Box2D and libGDX
 
libGDX: Tiled Maps
libGDX: Tiled MapslibGDX: Tiled Maps
libGDX: Tiled Maps
 
libGDX: User Input and Frame by Frame Animation
libGDX: User Input and Frame by Frame AnimationlibGDX: User Input and Frame by Frame Animation
libGDX: User Input and Frame by Frame Animation
 
Advanced JavaScript Development
Advanced JavaScript DevelopmentAdvanced JavaScript Development
Advanced JavaScript Development
 
Introduction to JavaScript
Introduction to JavaScriptIntroduction to JavaScript
Introduction to JavaScript
 
Introduction to AngularJS
Introduction to AngularJSIntroduction to AngularJS
Introduction to AngularJS
 
libGDX: Scene2D
libGDX: Scene2DlibGDX: Scene2D
libGDX: Scene2D
 
libGDX: Simple Frame Animation
libGDX: Simple Frame AnimationlibGDX: Simple Frame Animation
libGDX: Simple Frame Animation
 
libGDX: User Input
libGDX: User InputlibGDX: User Input
libGDX: User Input
 
Implementing a Simple Game using libGDX
Implementing a Simple Game using libGDXImplementing a Simple Game using libGDX
Implementing a Simple Game using libGDX
 
Android Threading
Android ThreadingAndroid Threading
Android Threading
 
Creating Asha Games: Game Pausing, Orientation, Sensors and Gestures
Creating Asha Games: Game Pausing, Orientation, Sensors and GesturesCreating Asha Games: Game Pausing, Orientation, Sensors and Gestures
Creating Asha Games: Game Pausing, Orientation, Sensors and Gestures
 
Creating Games for Asha - platform
Creating Games for Asha - platformCreating Games for Asha - platform
Creating Games for Asha - platform
 
Intro to Java ME and Asha Platform
Intro to Java ME and Asha PlatformIntro to Java ME and Asha Platform
Intro to Java ME and Asha Platform
 
Intro to PhoneGap
Intro to PhoneGapIntro to PhoneGap
Intro to PhoneGap
 
Quick Intro to JQuery and JQuery Mobile
Quick Intro to JQuery and JQuery MobileQuick Intro to JQuery and JQuery Mobile
Quick Intro to JQuery and JQuery Mobile
 
JavaScript Inheritance
JavaScript InheritanceJavaScript Inheritance
JavaScript Inheritance
 
JS OO and Closures
JS OO and ClosuresJS OO and Closures
JS OO and Closures
 

Dernier

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 

Dernier (20)

Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
 
Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdf
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 

Intro to Asha UI

  • 1. Developing  UI  for  Asha  Pla4orm   Jussi  Pohjolainen   Tampere  University  of  Applied  Sciences  
  • 2. Approaches   •  LCDUI  high-­‐level  components   –  Limited  Capability  Device  UI  (LCDUI)     –  Components  are  styled  with  Asha  look  &  feel   –  Custom  components  can  be  created  with  CustomItem   •  LWUIT  (for  Nokia)  Components   –  Lightweight  UI  Toolkit  (LWUIT)     –  More  comprehensive  component  set   –  Can  be  branded  using  your  own  theme   •  Custom  UI  on  (Game)Canvas     –  Full  screen  apps   –  Everything  is  drawn  pixel  by  pixel   –  Good  for  games  
  • 4. LCDUI   •  Limited  Capability  Device  UI  API   •  Really  simple  UI:  one  "screen"  visible  at  a  Mme   •  Screen?     –  Display d = Display.getDisplay(this); –  d.setCurrent(screenHere!); •  It's  a  subclass  of  Displayable  class!  
  • 5.
  • 6. PossibiliMes   •  You  can  put  to  screen   –  Alert, List, TextBox •  Also   –  Form  that  contains  items   –  Items?  StringItem, TextField …   •  And  some  low  UI  stuff   –  Canvas –  GameCanvas
  • 7. Example   Display d = Display.getDisplay(this); List list = new List("List", List.EXCLUSIVE); list.append("Hello", null); list.append("World", null); d.setCurrent(list);
  • 8. Example  with  Command   Display d = Display.getDisplay(this); List list = new List("List", List.EXCLUSIVE); list.append("Hello", null); list.append("World", null); Command c = new Command("Ok", Command.OK, 0); list.addCommand(c); d.setCurrent(list);
  • 9. Listener   public class Example extends MIDlet implements CommandListener { ... protected void startApp() throws MIDletStateChangeException { Display d = Display.getDisplay(this); List list = new List("List", List.EXCLUSIVE); list.append("Hello", null); list.append("World", null); Command ok = new Command("Ok", Command.OK, 0); list.addCommand(ok); list.setCommandListener(this); d.setCurrent(list); } public void commandAction(Command c, Displayable d) { // Command clicked! } }
  • 11. LWUIT   •  LWUIT  is  an  open  source  API  for  UI  components,   layouts  and  effects   –  Built  on  top  of  Canvas  class   •  Nokia  Asha  Theme   •  Scales  to  different  screen  resoluMons  and   orientaMons.  Support  for  touch  and  non-­‐touch   •  LCDUI  is  beZer  opMon  for  performance  cri@cal   apps.  By  using  LCDUI  you  will  get  smaller  binary   size   •  LWUIT  increase  jar  size  by  200  –  800  kb.  
  • 12.
  • 13.
  • 14. Form   •  Root  of  your  UI   –  Title  –  ContentPane  –  Menubar   •  Scrollable   •  Se`ng  layout   –  setLayout(…) •  Adding  components   –  addComponent(…)
  • 15. Example   protected void startApp() throws MIDletStateChangeException { Display.init(this); Form f = new Form(); f.setTitle("Jussi's Revenge!"); f.addComponent(new Button("Play")); f.addComponent(new Button("Highscore")); f.addComponent(new Button("Exit")); f.show(); }
  • 16. Layout   •  Layout  managers  allow  a  Container  to  arrange   its  components  by  a  set  of  rules  that  would  be   adapted  for  specific  screen/font  sizes.   –  BorderLayout –  BoxLayout –  CoordinateLayout –  FlowLayout –  GridLayout –  …  
  • 17. Example   protected void startApp() throws MIDletStateChangeException { Display.init(this); Form f = new Form(); f.setTitle("Jussi's Revenge!"); // Really beautiful UI :D f.setLayout(new GridLayout(2,2)); f.addComponent(new Button("Play")); f.addComponent(new Button("Highscore")); f.addComponent(new Button("Info")); f.addComponent(new Button("Exit")); f.show(); }
  • 18. Example   protected void startApp() throws MIDletStateChangeException { Display.init(this); Form f = new Form(); f.setTitle("Jussi's Revenge!"); f.setLayout(new BorderLayout()); Container buttonBar = new Container(new FlowLayout(Component.CENTER)); buttonBar.addComponent(new Button("Play")); buttonBar.addComponent(new Button("Exit")); Label label = new Label("Welcome!"); label.setAlignment(Component.CENTER); f.addComponent(BorderLayout.CENTER, label); f.addComponent(BorderLayout.SOUTH, buttonBar); f.show(); }
  • 19. Switching  Forms   •  Create  mulMple  forms,  call  show()   •  Possible  to  add  transiMon  animaMons   –  form.setTransitionOutAnimator(…);
  • 20. Handling  Back-­‐buZon   Form a = new Form(); Command command = … a.setBackCommand(command); a.setCommandListener(this);