SlideShare a Scribd company logo
1 of 53
Beginning Android Games

      Mario Zechner
Who am I?
Who am I?
Who am I?
Who am I?
Who am I?
Who am I?
Who am I?
Who am I?
Who am I?




   @badlogicgames
http://www.badlogicgames.com/
What I‘ll Talk About
•   Why Android?
•   What‘s in a game?
•   Android for game developers
•   Frameworks & engines
Why Android?
Why Android?
Why Android?
Why Android?




… or how to not make an infographic …
Why Android?




A Gaming Machine For Everyone!
What‘s in a Game?
What‘s in a Game?



  DESIGN
What‘s in a Game?
What‘s in a Game?
What‘s in a Game?
What‘s in a Game?
What‘s in a Game?
What‘s in a Game?
What‘s in a Game?



Technology
What‘s in a Game?
•   Window & Life-Cycle Management
•   File I/O
•   Input Devices
•   Audio
•   Graphics
•   Networking
•   Social Media Integration
•   Payment System
•   Tools
•   … you actually read all of this?
Android for Game Developers
Android for Game Developers




 + Tooling       + Performance
 + API Access    + Portability
 - Performance   - Tooling
 - Portability   - API Access
Android for Game Developers
Android for Game Developers
Android for Game Developers
• Store files in
   – APK (read-only)
   – Internal Storage (read/write, limited space)
   – External Storage (read/write)
• SharedPreferences for simple settings
• GOTCHAS
   – APK size limit (50mb)
   – Asset file compression bug until Android 2.3
   – No direct access via NDK in older Android versions
Android for Game Developers
• OnTouchListener and OnKeyListener on
  View
• SensorManager for
  compass, accelerometer, gyro, …
• USB/NFC since Android 3+
• GOTCHAS
  – Horrible Touch API
  – Multi-touch broken on many devices
Android for Game Developers
• SoundPool for sound effects
• MediaPlayer for streaming music
• OpenSL ES in C/C++
                                   setVolumeControlStream(AudioManager.STREAM_MUSIC);
                                   soundPool = new SoundPool(20, AudioManager.STREAM_MUSIC,
                                   0);

• GOTCHAS
                                   explosionId = soundPool.load(descriptor, 1);
                                   soundPool.play(explosionId, 1, 1, 0, 0, 1);


  – High latency (+100ms)
  – Broken drivers    mediaPlayer = new MediaPlayer()
                      mediaPlayer.setDataSource(descriptor.getFileDescriptor(),
                                       descriptor.getStartOffset(), descriptor.getLength());
                                   mediaPlayer.prepare();
                                   mediaPlayer.setLooping(true);
                                   mediaPlayer.start()
Android for Game Developers
                            Canvas                                         OpenGL ES
canvas.drawRGB(255, 255, 255);
paint.setColor(Color.RED);
canvas.drawLine(0, 0, canvas.getWidth()-1, canvas.getHeight()-1, paint);

paint.setStyle(Style.STROKE);
paint.setColor(0xff00ff00);
canvas.drawCircle(canvas.getWidth()/2, canvas.getHeight()/2, 40, paint);

paint.setStyle(Style.FILL);
paint.setColor(0x770000ff);
canvas.drawRect(100, 100, 200, 200, paint);




                + Ease-of-Use                                              + Performance
                - Performance                                              + 2D / 3D
                - 2D-only                                                  - Ease-of-Use
Android for Game Developers
                            Canvas                                         OpenGL ES
canvas.drawRGB(255, 255, 255);
paint.setColor(Color.RED);
canvas.drawLine(0, 0, canvas.getWidth()-1, canvas.getHeight()-1, paint);

paint.setStyle(Style.STROKE);
paint.setColor(0xff00ff00);
canvas.drawCircle(canvas.getWidth()/2, canvas.getHeight()/2, 40, paint);

paint.setStyle(Style.FILL);
paint.setColor(0x770000ff);
canvas.drawRect(100, 100, 200, 200, paint);




                + Ease-of-Use                                              + Performance
                - Performance                                              + 2D / 3D
                - 2D-only                                                  - Ease-of-Use

                     MY GOD, IT‘S FULL OF GOTCHAS
Android for Game Developers
                            Canvas                                         OpenGL ES
canvas.drawRGB(255, 255, 255);
paint.setColor(Color.RED);
canvas.drawLine(0, 0, canvas.getWidth()-1, canvas.getHeight()-1, paint);

paint.setStyle(Style.STROKE);
paint.setColor(0xff00ff00);
canvas.drawCircle(canvas.getWidth()/2, canvas.getHeight()/2, 40, paint);

paint.setStyle(Style.FILL);
paint.setColor(0x770000ff);
canvas.drawRect(100, 100, 200, 200, paint);




                + Ease-of-Use                                              + Performance
                - Performance                                              + 2D / 3D
                - 2D-only                                                  - Ease-of-Use

                     MY GOD, IT‘S FULL OF GOTCHAS
Android for Game Developers
•   Bugs in shader compilers
•   Deviations from OpenGL ES specification
•   Highly varying performance
•   GPU dependent optimizations
•   Texture compression formats
•   …
Android for Game Developers
• And if you use Java …
• Garbage Collector pauses (+200ms)
• Varying maximum heap memory
• Direct ByteBuffers and Bitmaps counted
  against Java heap
• Method call overhead
Android for Game Developers
•   A lot better since 2.2, great since 4.0
•   Concurrent GC
•   JIT
•   Tons of bug fixes
•   GOTCHA
Android for Game Developers
Android for Game Developers




       FRAGMENTATION
Android for Game Developers




Screen Sizes, Aspect Ratios, Resolutions
Android for Game Developers
•   Pick target resolution/aspect ratio
•   Stretch or Clip on other aspect ratios
•   Ship multiple asset sizes
•   We‘ve done this on the PC, we can do it on
    Android!
Android for Game Developers
Android for Game Developers
• Device-specific driver bugs (audio, OpenGL ES)
• Android version-specific bugs
• Multiple test devices (3-4)
  – PowerVR, Mali, Snapdragon, Tegra
  – Low-end to high-end phones
  – Tablet
• Or use a framework/engine!
Frameworks & Engines




       Not exhaustive, visit
http://mobilegameengines.com/
Frameworks & Engines
$$$
Free
$$$
Free
$$$
Free
Free
$$$
              Not exhaustive, visit
       http://mobilegameengines.com/
WIP
• Java (lots of C/C++ under the hood)
• Develop on the desktop 90% of the time (no
  slow deploys, no emulator madness)
• Abstraction layers
  – Low-level: OpenGL ES, file i/o, input, audio, ...
  – Mid-level: shaders, textures, linalg, …
  – High-level: fonts, sprites, scene graph, …
• Pick and choose, see feature list
http://libgdx.badlogicgames.com/features.html
Spine, 2D skeletal animation editor
https://plus.google.com/100248578810918104811
Source & Releases
http://libgdx.badlogicgames.com/download.html
Docs
http://libgdx.badlogicgames.com/documentation.html
Forum
http://badlogicgames.com/forum/
Blog
http://www.badlogicgames.com
IRC
irc.freenode.org, #libgdx
Questions?
   @badlogicgames
http://www.badlogicgames.com/

More Related Content

What's hot

Rapid Game Development with RUby and Gosu – Ruby Manor 4
Rapid Game Development with RUby and Gosu – Ruby Manor 4Rapid Game Development with RUby and Gosu – Ruby Manor 4
Rapid Game Development with RUby and Gosu – Ruby Manor 4benko
 
BeagleBoard Workshop ESC Boston 2011
BeagleBoard Workshop ESC Boston 2011BeagleBoard Workshop ESC Boston 2011
BeagleBoard Workshop ESC Boston 2011Opersys inc.
 
Android jumpstart at ESC Boston 2011
Android jumpstart at ESC Boston 2011Android jumpstart at ESC Boston 2011
Android jumpstart at ESC Boston 2011Opersys inc.
 
Android game development
Android game developmentAndroid game development
Android game developmentmilandinic
 
UI Debugging - Cocoaheads Dresden (English)
UI Debugging - Cocoaheads Dresden (English)UI Debugging - Cocoaheads Dresden (English)
UI Debugging - Cocoaheads Dresden (English)Pit Garbe
 
Begining Android Development
Begining Android DevelopmentBegining Android Development
Begining Android DevelopmentHayi Nukman
 
Leveraging Android's Linux Heritage
Leveraging Android's Linux HeritageLeveraging Android's Linux Heritage
Leveraging Android's Linux HeritageOpersys inc.
 
Embedded Android Workshop
Embedded Android WorkshopEmbedded Android Workshop
Embedded Android WorkshopOpersys inc.
 
Leveraging Android's Linux Heritage at AnDevCon3
Leveraging Android's Linux Heritage at AnDevCon3Leveraging Android's Linux Heritage at AnDevCon3
Leveraging Android's Linux Heritage at AnDevCon3Opersys inc.
 
Porting games from ps3 or web to shield and ouya [final]
Porting games from ps3 or web to shield and ouya [final]Porting games from ps3 or web to shield and ouya [final]
Porting games from ps3 or web to shield and ouya [final]Jean-Philippe Doiron
 
Embedded Android Workshop part I ESC SV 2012
Embedded Android Workshop part I ESC SV 2012Embedded Android Workshop part I ESC SV 2012
Embedded Android Workshop part I ESC SV 2012Opersys inc.
 
Android Jumpstart ESC SV 2012 Part I
Android Jumpstart ESC SV 2012 Part IAndroid Jumpstart ESC SV 2012 Part I
Android Jumpstart ESC SV 2012 Part IOpersys inc.
 
Building Android games using LibGDX
Building Android games using LibGDXBuilding Android games using LibGDX
Building Android games using LibGDXJussi Pohjolainen
 
Building Multi-platform Video Games for the Cloud
Building Multi-platform Video Games for the CloudBuilding Multi-platform Video Games for the Cloud
Building Multi-platform Video Games for the CloudChris Schalk
 
Unty3D Awesome Assets - uTomate
Unty3D Awesome Assets - uTomateUnty3D Awesome Assets - uTomate
Unty3D Awesome Assets - uTomateTaras Leskiv
 
Sikuli: Using Screenshots for GUI Automation and Testing
Sikuli: Using Screenshots for GUI Automation and TestingSikuli: Using Screenshots for GUI Automation and Testing
Sikuli: Using Screenshots for GUI Automation and Testingvgod
 
Unity3D Tips and Tricks or "You are doing it wrong!"
Unity3D Tips and Tricks or "You are doing it wrong!"Unity3D Tips and Tricks or "You are doing it wrong!"
Unity3D Tips and Tricks or "You are doing it wrong!"Taras Leskiv
 
How hard can it be - Ui development at keen games
How hard can it be - Ui development at keen gamesHow hard can it be - Ui development at keen games
How hard can it be - Ui development at keen gamesJulien Koenen
 
guadec-2015-developer-switch-dreams
guadec-2015-developer-switch-dreamsguadec-2015-developer-switch-dreams
guadec-2015-developer-switch-dreamsChristian Hergert
 

What's hot (20)

Rapid Game Development with RUby and Gosu – Ruby Manor 4
Rapid Game Development with RUby and Gosu – Ruby Manor 4Rapid Game Development with RUby and Gosu – Ruby Manor 4
Rapid Game Development with RUby and Gosu – Ruby Manor 4
 
BeagleBoard Workshop ESC Boston 2011
BeagleBoard Workshop ESC Boston 2011BeagleBoard Workshop ESC Boston 2011
BeagleBoard Workshop ESC Boston 2011
 
Android jumpstart at ESC Boston 2011
Android jumpstart at ESC Boston 2011Android jumpstart at ESC Boston 2011
Android jumpstart at ESC Boston 2011
 
Android game development
Android game developmentAndroid game development
Android game development
 
UI Debugging - Cocoaheads Dresden (English)
UI Debugging - Cocoaheads Dresden (English)UI Debugging - Cocoaheads Dresden (English)
UI Debugging - Cocoaheads Dresden (English)
 
Cyborgstack
CyborgstackCyborgstack
Cyborgstack
 
Begining Android Development
Begining Android DevelopmentBegining Android Development
Begining Android Development
 
Leveraging Android's Linux Heritage
Leveraging Android's Linux HeritageLeveraging Android's Linux Heritage
Leveraging Android's Linux Heritage
 
Embedded Android Workshop
Embedded Android WorkshopEmbedded Android Workshop
Embedded Android Workshop
 
Leveraging Android's Linux Heritage at AnDevCon3
Leveraging Android's Linux Heritage at AnDevCon3Leveraging Android's Linux Heritage at AnDevCon3
Leveraging Android's Linux Heritage at AnDevCon3
 
Porting games from ps3 or web to shield and ouya [final]
Porting games from ps3 or web to shield and ouya [final]Porting games from ps3 or web to shield and ouya [final]
Porting games from ps3 or web to shield and ouya [final]
 
Embedded Android Workshop part I ESC SV 2012
Embedded Android Workshop part I ESC SV 2012Embedded Android Workshop part I ESC SV 2012
Embedded Android Workshop part I ESC SV 2012
 
Android Jumpstart ESC SV 2012 Part I
Android Jumpstart ESC SV 2012 Part IAndroid Jumpstart ESC SV 2012 Part I
Android Jumpstart ESC SV 2012 Part I
 
Building Android games using LibGDX
Building Android games using LibGDXBuilding Android games using LibGDX
Building Android games using LibGDX
 
Building Multi-platform Video Games for the Cloud
Building Multi-platform Video Games for the CloudBuilding Multi-platform Video Games for the Cloud
Building Multi-platform Video Games for the Cloud
 
Unty3D Awesome Assets - uTomate
Unty3D Awesome Assets - uTomateUnty3D Awesome Assets - uTomate
Unty3D Awesome Assets - uTomate
 
Sikuli: Using Screenshots for GUI Automation and Testing
Sikuli: Using Screenshots for GUI Automation and TestingSikuli: Using Screenshots for GUI Automation and Testing
Sikuli: Using Screenshots for GUI Automation and Testing
 
Unity3D Tips and Tricks or "You are doing it wrong!"
Unity3D Tips and Tricks or "You are doing it wrong!"Unity3D Tips and Tricks or "You are doing it wrong!"
Unity3D Tips and Tricks or "You are doing it wrong!"
 
How hard can it be - Ui development at keen games
How hard can it be - Ui development at keen gamesHow hard can it be - Ui development at keen games
How hard can it be - Ui development at keen games
 
guadec-2015-developer-switch-dreams
guadec-2015-developer-switch-dreamsguadec-2015-developer-switch-dreams
guadec-2015-developer-switch-dreams
 

Similar to Beginning android games

Low Level Graphics & OpenGL
Low Level Graphics & OpenGLLow Level Graphics & OpenGL
Low Level Graphics & OpenGLDominic Farolino
 
GFX Part 1 - Introduction to GPU HW and OpenGL ES specifications
GFX Part 1 - Introduction to GPU HW and OpenGL ES specificationsGFX Part 1 - Introduction to GPU HW and OpenGL ES specifications
GFX Part 1 - Introduction to GPU HW and OpenGL ES specificationsPrabindh Sundareson
 
OW2con'14 - XLcoud, 3D rendering in the cloud, Marius Preda, Institut Mines T...
OW2con'14 - XLcoud, 3D rendering in the cloud, Marius Preda, Institut Mines T...OW2con'14 - XLcoud, 3D rendering in the cloud, Marius Preda, Institut Mines T...
OW2con'14 - XLcoud, 3D rendering in the cloud, Marius Preda, Institut Mines T...xlcloud
 
Y1 gd engine_terminology
Y1 gd engine_terminologyY1 gd engine_terminology
Y1 gd engine_terminologyJordanianmc
 
Pixel-Lab / Games:EDU / Michel Kripalani / Games Industry Overview and Trends
Pixel-Lab / Games:EDU / Michel Kripalani / Games Industry Overview and TrendsPixel-Lab / Games:EDU / Michel Kripalani / Games Industry Overview and Trends
Pixel-Lab / Games:EDU / Michel Kripalani / Games Industry Overview and Trendspixellab
 
Wakka Monkey - Game Development
Wakka Monkey - Game DevelopmentWakka Monkey - Game Development
Wakka Monkey - Game DevelopmentWakka Monkey
 
Wakka Monkey - Game Development
Wakka Monkey - Game DevelopmentWakka Monkey - Game Development
Wakka Monkey - Game DevelopmentWakka Monkey
 
Presentation 1 22nd August 2008
Presentation 1   22nd August 2008Presentation 1   22nd August 2008
Presentation 1 22nd August 2008carlyle o
 
BINARY DATA ADVENTURES IN BROWSER JAVASCRIPT
BINARY DATA ADVENTURES  IN BROWSER JAVASCRIPTBINARY DATA ADVENTURES  IN BROWSER JAVASCRIPT
BINARY DATA ADVENTURES IN BROWSER JAVASCRIPTOr Hiltch
 
Knock knock on GameDev gateway! - Introduction to Game development
Knock knock on GameDev gateway! - Introduction to Game developmentKnock knock on GameDev gateway! - Introduction to Game development
Knock knock on GameDev gateway! - Introduction to Game developmentMamdouh Tarabishi
 
Absolutist: Porting to major platforms within a minute
Absolutist: Porting to major platforms within a minuteAbsolutist: Porting to major platforms within a minute
Absolutist: Porting to major platforms within a minuteDevGAMM Conference
 
The next generation of GPU APIs for Game Engines
The next generation of GPU APIs for Game EnginesThe next generation of GPU APIs for Game Engines
The next generation of GPU APIs for Game EnginesPooya Eimandar
 
Knock Knock on GameDev Gate
Knock Knock on GameDev GateKnock Knock on GameDev Gate
Knock Knock on GameDev GateBeMyApp
 

Similar to Beginning android games (20)

Low Level Graphics & OpenGL
Low Level Graphics & OpenGLLow Level Graphics & OpenGL
Low Level Graphics & OpenGL
 
CreateJS
CreateJSCreateJS
CreateJS
 
Gtug
GtugGtug
Gtug
 
GFX Part 1 - Introduction to GPU HW and OpenGL ES specifications
GFX Part 1 - Introduction to GPU HW and OpenGL ES specificationsGFX Part 1 - Introduction to GPU HW and OpenGL ES specifications
GFX Part 1 - Introduction to GPU HW and OpenGL ES specifications
 
Engine terminology
Engine terminologyEngine terminology
Engine terminology
 
Industry awareness
Industry awarenessIndustry awareness
Industry awareness
 
OW2con'14 - XLcoud, 3D rendering in the cloud, Marius Preda, Institut Mines T...
OW2con'14 - XLcoud, 3D rendering in the cloud, Marius Preda, Institut Mines T...OW2con'14 - XLcoud, 3D rendering in the cloud, Marius Preda, Institut Mines T...
OW2con'14 - XLcoud, 3D rendering in the cloud, Marius Preda, Institut Mines T...
 
Y1 gd engine_terminology
Y1 gd engine_terminologyY1 gd engine_terminology
Y1 gd engine_terminology
 
Pixel-Lab / Games:EDU / Michel Kripalani / Games Industry Overview and Trends
Pixel-Lab / Games:EDU / Michel Kripalani / Games Industry Overview and TrendsPixel-Lab / Games:EDU / Michel Kripalani / Games Industry Overview and Trends
Pixel-Lab / Games:EDU / Michel Kripalani / Games Industry Overview and Trends
 
Cocos2d programming
Cocos2d programmingCocos2d programming
Cocos2d programming
 
XRobots
XRobotsXRobots
XRobots
 
Wakka Monkey - Game Development
Wakka Monkey - Game DevelopmentWakka Monkey - Game Development
Wakka Monkey - Game Development
 
Wakka Monkey - Game Development
Wakka Monkey - Game DevelopmentWakka Monkey - Game Development
Wakka Monkey - Game Development
 
Cocos2d game programming 2
Cocos2d game programming 2Cocos2d game programming 2
Cocos2d game programming 2
 
Presentation 1 22nd August 2008
Presentation 1   22nd August 2008Presentation 1   22nd August 2008
Presentation 1 22nd August 2008
 
BINARY DATA ADVENTURES IN BROWSER JAVASCRIPT
BINARY DATA ADVENTURES  IN BROWSER JAVASCRIPTBINARY DATA ADVENTURES  IN BROWSER JAVASCRIPT
BINARY DATA ADVENTURES IN BROWSER JAVASCRIPT
 
Knock knock on GameDev gateway! - Introduction to Game development
Knock knock on GameDev gateway! - Introduction to Game developmentKnock knock on GameDev gateway! - Introduction to Game development
Knock knock on GameDev gateway! - Introduction to Game development
 
Absolutist: Porting to major platforms within a minute
Absolutist: Porting to major platforms within a minuteAbsolutist: Porting to major platforms within a minute
Absolutist: Porting to major platforms within a minute
 
The next generation of GPU APIs for Game Engines
The next generation of GPU APIs for Game EnginesThe next generation of GPU APIs for Game Engines
The next generation of GPU APIs for Game Engines
 
Knock Knock on GameDev Gate
Knock Knock on GameDev GateKnock Knock on GameDev Gate
Knock Knock on GameDev Gate
 

Recently uploaded

Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfSeasiaInfotech2
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesZilliz
 

Recently uploaded (20)

Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdf
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector Databases
 

Beginning android games

  • 1. Beginning Android Games Mario Zechner
  • 10. Who am I? @badlogicgames http://www.badlogicgames.com/
  • 11. What I‘ll Talk About • Why Android? • What‘s in a game? • Android for game developers • Frameworks & engines
  • 15. Why Android? … or how to not make an infographic …
  • 16. Why Android? A Gaming Machine For Everyone!
  • 17. What‘s in a Game?
  • 18. What‘s in a Game? DESIGN
  • 19. What‘s in a Game?
  • 20. What‘s in a Game?
  • 21. What‘s in a Game?
  • 22. What‘s in a Game?
  • 23. What‘s in a Game?
  • 24. What‘s in a Game?
  • 25. What‘s in a Game? Technology
  • 26. What‘s in a Game? • Window & Life-Cycle Management • File I/O • Input Devices • Audio • Graphics • Networking • Social Media Integration • Payment System • Tools • … you actually read all of this?
  • 27. Android for Game Developers
  • 28. Android for Game Developers + Tooling + Performance + API Access + Portability - Performance - Tooling - Portability - API Access
  • 29. Android for Game Developers
  • 30. Android for Game Developers
  • 31. Android for Game Developers • Store files in – APK (read-only) – Internal Storage (read/write, limited space) – External Storage (read/write) • SharedPreferences for simple settings • GOTCHAS – APK size limit (50mb) – Asset file compression bug until Android 2.3 – No direct access via NDK in older Android versions
  • 32. Android for Game Developers • OnTouchListener and OnKeyListener on View • SensorManager for compass, accelerometer, gyro, … • USB/NFC since Android 3+ • GOTCHAS – Horrible Touch API – Multi-touch broken on many devices
  • 33. Android for Game Developers • SoundPool for sound effects • MediaPlayer for streaming music • OpenSL ES in C/C++ setVolumeControlStream(AudioManager.STREAM_MUSIC); soundPool = new SoundPool(20, AudioManager.STREAM_MUSIC, 0); • GOTCHAS explosionId = soundPool.load(descriptor, 1); soundPool.play(explosionId, 1, 1, 0, 0, 1); – High latency (+100ms) – Broken drivers mediaPlayer = new MediaPlayer() mediaPlayer.setDataSource(descriptor.getFileDescriptor(), descriptor.getStartOffset(), descriptor.getLength()); mediaPlayer.prepare(); mediaPlayer.setLooping(true); mediaPlayer.start()
  • 34. Android for Game Developers Canvas OpenGL ES canvas.drawRGB(255, 255, 255); paint.setColor(Color.RED); canvas.drawLine(0, 0, canvas.getWidth()-1, canvas.getHeight()-1, paint); paint.setStyle(Style.STROKE); paint.setColor(0xff00ff00); canvas.drawCircle(canvas.getWidth()/2, canvas.getHeight()/2, 40, paint); paint.setStyle(Style.FILL); paint.setColor(0x770000ff); canvas.drawRect(100, 100, 200, 200, paint); + Ease-of-Use + Performance - Performance + 2D / 3D - 2D-only - Ease-of-Use
  • 35. Android for Game Developers Canvas OpenGL ES canvas.drawRGB(255, 255, 255); paint.setColor(Color.RED); canvas.drawLine(0, 0, canvas.getWidth()-1, canvas.getHeight()-1, paint); paint.setStyle(Style.STROKE); paint.setColor(0xff00ff00); canvas.drawCircle(canvas.getWidth()/2, canvas.getHeight()/2, 40, paint); paint.setStyle(Style.FILL); paint.setColor(0x770000ff); canvas.drawRect(100, 100, 200, 200, paint); + Ease-of-Use + Performance - Performance + 2D / 3D - 2D-only - Ease-of-Use MY GOD, IT‘S FULL OF GOTCHAS
  • 36. Android for Game Developers Canvas OpenGL ES canvas.drawRGB(255, 255, 255); paint.setColor(Color.RED); canvas.drawLine(0, 0, canvas.getWidth()-1, canvas.getHeight()-1, paint); paint.setStyle(Style.STROKE); paint.setColor(0xff00ff00); canvas.drawCircle(canvas.getWidth()/2, canvas.getHeight()/2, 40, paint); paint.setStyle(Style.FILL); paint.setColor(0x770000ff); canvas.drawRect(100, 100, 200, 200, paint); + Ease-of-Use + Performance - Performance + 2D / 3D - 2D-only - Ease-of-Use MY GOD, IT‘S FULL OF GOTCHAS
  • 37. Android for Game Developers • Bugs in shader compilers • Deviations from OpenGL ES specification • Highly varying performance • GPU dependent optimizations • Texture compression formats • …
  • 38. Android for Game Developers • And if you use Java … • Garbage Collector pauses (+200ms) • Varying maximum heap memory • Direct ByteBuffers and Bitmaps counted against Java heap • Method call overhead
  • 39. Android for Game Developers • A lot better since 2.2, great since 4.0 • Concurrent GC • JIT • Tons of bug fixes • GOTCHA
  • 40. Android for Game Developers
  • 41. Android for Game Developers FRAGMENTATION
  • 42. Android for Game Developers Screen Sizes, Aspect Ratios, Resolutions
  • 43. Android for Game Developers • Pick target resolution/aspect ratio • Stretch or Clip on other aspect ratios • Ship multiple asset sizes • We‘ve done this on the PC, we can do it on Android!
  • 44. Android for Game Developers
  • 45. Android for Game Developers • Device-specific driver bugs (audio, OpenGL ES) • Android version-specific bugs • Multiple test devices (3-4) – PowerVR, Mali, Snapdragon, Tegra – Low-end to high-end phones – Tablet • Or use a framework/engine!
  • 46. Frameworks & Engines Not exhaustive, visit http://mobilegameengines.com/
  • 47. Frameworks & Engines $$$ Free $$$ Free $$$ Free Free $$$ Not exhaustive, visit http://mobilegameengines.com/
  • 48. WIP
  • 49. • Java (lots of C/C++ under the hood) • Develop on the desktop 90% of the time (no slow deploys, no emulator madness) • Abstraction layers – Low-level: OpenGL ES, file i/o, input, audio, ... – Mid-level: shaders, textures, linalg, … – High-level: fonts, sprites, scene graph, … • Pick and choose, see feature list http://libgdx.badlogicgames.com/features.html
  • 50.
  • 51. Spine, 2D skeletal animation editor https://plus.google.com/100248578810918104811
  • 53. Questions? @badlogicgames http://www.badlogicgames.com/