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

Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
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 WoodJuan lago vázquez
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024SynarionITSolutions
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
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 FresherRemote DBA Services
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
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 SavingEdi Saputra
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 

Recently uploaded (20)

Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
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
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
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
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
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
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 

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/