background preloader

Toomasb's #gamedev links

Facebook Twitter

Strategy pattern. Defines a family of algorithms,encapsulates each algorithm, andmakes the algorithms interchangeable within that family.

Strategy pattern

Strategy lets the algorithm vary independently from clients that use it.[1] Strategy is one of the patterns included in the influential book Design Patterns by Gamma et al. that popularized the concept of using patterns to describe software design. For instance, a class that performs validation on incoming data may use a strategy pattern to select a validation algorithm based on the type of data, the source of the data, user choice, or other discriminating factors.

These factors are not known for each case until run-time, and may require radically different validation to be performed. The validation strategies, encapsulated separately from the validating object, may be used by other validating objects in different areas of the system (or even different systems) without code duplication. Structure[edit] Example[edit] C#[edit] Java[edit] brakeBehavior = new Brake(); Starting an Activity. Unlike other programming paradigms in which apps are launched with a main() method, the Android system initiates code in an Activity instance by invoking specific callback methods that correspond to specific stages of its lifecycle.

Starting an Activity

There is a sequence of callback methods that start up an activity and a sequence of callback methods that tear down an activity. This lesson provides an overview of the most important lifecycle methods and shows you how to handle the first lifecycle callback that creates a new instance of your activity. Understand the Lifecycle Callbacks During the life of an activity, the system calls a core set of lifecycle methods in a sequence similar to a step pyramid. That is, each stage of the activity lifecycle is a separate step on the pyramid. Dashboards. Google Play Install Stats The Google Play Developer Console also provides detailed statistics about your users' devices.

Dashboards

Those stats may help you prioritize the device profiles for which you optimize your app. This page provides information about the relative number of devices that share a certain characteristic, such as Android version or screen size. This information may help you prioritize efforts for supporting different devices by revealing which devices are active in the Android and Google Play ecosystem. This data reflects devices running the latest Google Play Store app, which is compatible with Android 2.2 and higher. Platform Versions This section provides data about the relative number of devices running a given version of the Android platform. For information about how to target your application to devices based on platform version, read Supporting Different Platform Versions.

Data collected during a 7-day period ending on February 1, 2016. Screen Sizes and Densities. Supporting Multiple Screens. Android runs on a variety of devices that offer different screen sizes and densities.

Supporting Multiple Screens

For applications, the Android system provides a consistent development environment across devices and handles most of the work to adjust each application's user interface to the screen on which it is displayed. At the same time, the system provides APIs that allow you to control your application's UI for specific screen sizes and densities, in order to optimize your UI design for different screen configurations. Tutorials - Kilobolt. Android Game Development Tutorials. Some months ago we received an email from a fellow Java developer, Tamas Jano, asking to be part of our JCG partners program.

Android Game Development Tutorials

To our surprise he maintains a blog named “Against The Grain” debating about game development for the Android platform. I have been reading all of his articles since then and I must admit that his writings have been an inspiration and a motivation for me and my colleagues here at Java Code Geeks so as to start developing our first game for the Android platform. With this post I would like to present Tamas‘s work to our community hoping that you will be inspired and motivated just like we did! What follows is a portion of Tamas‘s introductory article titled as “A little motivation and what’s the idea behind all this.” I am certain that after reading it you will realize (just like I did) that you have many many things in common with this guy! First of all I know no great coder who is not interested in games. Where is the game you dreamed of doing 10 years ago? Byron.