Wednesday, December 28, 2016

Android Design Patterns and Best Practice

Android Design Patterns and Best Practice

Key Features

  • Create efficient object interaction patterns for faster and more efficient Android development
  • Get into efficient and fast app development and start making money from your android apps
  • Implement industry-standard design patterns and best practices to reduce your app development time drastically

Book Description
Are you an Android developer with some experience under your belt? Are you wondering how the experts create efficient and good-looking apps? Then your wait will end with this book! We will teach you about different Android development patterns that will enable you to write clean code and make your app stand out from the crowd.

The book starts by introducing the Android development environment and exploring the support libraries. You will gradually explore the different design and layout patterns and get to know the best practices of how to use them together. Then you'll then develop an application that will help you grasp activities, services, and broadcasts and their roles in Android development.

Moving on, you will add user-detecting classes and APIs such as gesture detection, touch screen listeners, and sensors to your app. You will also learn to adapt your app to run on tablets and other devices and platforms, including Android Wear, auto, and TV. Finally, you will see how to connect your app to social media and explore deployment patterns as well as the best publishing and monetizing practices.

The book will start by introducing the Android development environment and exploring the support libraries. You will gradually explore the different Design and layout patterns and learn the best practices on how to use them together. You will then develop an application that will help you grasp Activities, Services and Broadcasts and their roles in Android development. Moving on, you will add user detecting classes and APIs such as at gesture detection, touch screen listeners and sensors to our app. You will also learn to adapt your app to run on tablets and other devices and platforms, including Android Wear, Auto, and TV. Finally, you will learn to connect your app to social media and explore deployment patterns and best publishing and monetizing practices.

What you will learn

  • Build a simple app and run it on real and emulated devices
  • Explore the WYSIWYG and XML approaches to material design provided within Android Studio
  • Detect user activities by using touch screen listeners, gesture detection, and reading sensors
  • Apply transitions and shared elements to employ elegant animations and efficiently use the minimal screen space of mobile devices
  • Develop apps that automatically apply the best layouts for different devices by using designated directories
  • Socialize in the digital word by connecting your app to social media
  • Make your apps available to the largest possible audience with the AppCompat support library

About the Author
Kyle Mew has been programming since the early eighties and has written for several technology websites. He has also written three radio plays and three other books on Android development.

Table of Contents

  1. Design Patterns
  2. Creational Patterns
  3. Material Patterns
  4. Layout Patterns
  5. Structural Patterns
  6. Activating Patterns
  7. Combining Patterns
  8. Composing Patterns
  9. Observing Patterns
  10. Behavioral Patterns
  11. Wearable Patterns
  12. Social Patterns
  13. Distribution Patterns


Monday, December 26, 2016

Beginning Android Games 3rd Edition

Beginning Android Games

Learn all of the basics needed to join the ranks of successful Android game developers. You'll start with game design fundamentals and Android programming basics, and then progress toward creating your own basic game engine and playable game apps that work on Android smartphones and tablets. Beginning Android Games, Third Edition gives you everything you need to branch out and write your own Android games for a variety of hardware.

Do you have an awesome idea for the next break-through mobile gaming title? Beginning Android Games will help you kick-start your project. This book will guide you through the process of making several example game apps using APIs available in Android.

What You'll Learn
  • Gain the fundamentals of game programming in the context of the Android platform
  • Use Android's APIs for graphics, audio, and user input to reflect those fundamentals
  • Develop two 2D games from scratch, based on Canvas API and OpenGL ES
  • Create a full-featured 3D game
  • Publish your games, get crash reports, and support your users
  • Complete your own playable 2D OpenGL games
Who This Book Is For
People with a basic knowledge of Java who want to write games on the Android platform. It also offers information for experienced game developers about the pitfalls and peculiarities of the platform.

Friday, December 16, 2016

Android Recipes: A Problem-Solution Approach 5th Edition

Discover more than 100 down-to-earth code recipes, covering a wide range of useful topics using complete and real-world working code examples. This book is updated to include the Android N SDK (7.0), as well as earlier releases.

Android Recipes: A Problem-Solution Approach

Crammed with insightful instruction and helpful examples, this fifth edition of Android Recipes is your guide to writing apps for one of today’s hottest mobile platforms. It offers pragmatic advice that will help you get the job done quickly and well. This can save you a great deal of work over creating a project from scratch.

Instead of abstract descriptions of complex concepts, in Android Recipes you'll find live code examples. When you start a new project you can consider copying and pasting the code and configuration files from this book and then modifying them for your own customization needs.

What You'll Learn

  • Code for Android smartphones and tablets
  • Use external libraries to save time and effort
  • Boost app performance by using the Android NDK and RenderScript
  • Design apps for performance, responsiveness, and seamlessness
  • Send data between devices and other external hardware
  • Persist application data and share it between applications
  • Capture and play back various device media items
  • Communicate with web services
  • Get the most out of your user interface

Who This Book Is For
All Android app developers.

Tuesday, December 13, 2016

Google’s Internet of Things platform: Android Things and Weave

Google announced updates to Google’s Internet of Things platform: Android Things and Weave, to know the details, refer Announcing updates to Google’s Internet of Things platform: Android Things and Weave


To get started, check out Google's IoT developer site, or go directly to the Android Things, Weave, and Google Cloud Platform sites for documentation and code samples. You can also join Google's IoT Developers Community on Google+ to get the latest updates and share and discuss ideas with other developers.


Sunday, December 11, 2016

Mastering Android Wear Application Development

Master the future of mobile devices in wearable technology

Mastering Android Wear Application Development

About This Book
  • Mastering Android Wear Development is a complete guide to wearable technology for experienced Android developers
  • Notifications, voice input, coping with round screens – all the key challenges of wearable technology are covered
  • This book describes not just how to write code for wearables, but also how to think about wearable technology and design apps that work well with the physical limitations of wearable devices
Who This Book Is For
This book is for application developers (the web, mobile, and desktop) who are interested in building new wearable apps, and mobile developers who already have apps on iTunes or Google Play Store and are looking to provide Android Wear support for their existing Android or iOS apps.

What You Will Learn
  • Understand the Wearable computing technology
  • Set up a development environment to build Android Wear apps using Android Studio
  • Master the Android Wear SDK and APIs
  • Understand the UI patterns and UX principles to build Android Wear apps
  • Work with the different form factors of wearable devices (round and square)
  • Take advantage of the sensors available on Android Wear devices
  • Develop Android Wear sample apps
  • Communicate between Android mobile and Android Wear apps
  • Get to know the steps involved in publishing Android Wear apps to the Play store
In Detail
Wearable technology is the future of mobile devices. It looks set to be a breakthrough technology, just like the iPad was before it. With the Apple Watch being widely regarded as a success, all eyes are now on Google to provide a similar device for its users. Keep your skills ahead of the competition and be one of the first to fully understand this powerful new trend. This book will give you a very solid understanding of the philosophy, thought process, development details, and methodologies involved in building well-designed, robust Android Wear applications.

We cover the advantages and disadvantages of the wearable computing paradigm and provide a good foundational knowledge for you to build practical, real-world wearable apps. You will learn about the various tools, platforms, libraries, SDKs, and technology needed to build Android Wear apps. By the end of the book, you will be an expert in building Android wearable apps.

Style and approach
This one-stop professional tutorial will teach you everything you need to know to begin designing and developing applications for this exciting new technology. Every step from development through testing to deployment is explained in depth.

Wednesday, November 30, 2016

What's New in Android 7.1

Learn about the new developer features of Android 7.1, available in the developer preview, including launcher shortcuts, the commit content API for rich media in input methods, and more.

Check out the API Overview: http://goo.gl/xa204A


Tuesday, November 22, 2016

Free ebook: Software Architecture Patterns

Whether you're a software architect or a software developer or engineer who fulfills some of the roles of a software architect in the course of your work, the more you understand about software architecture, the more capable you'll be.

Mark Richards' new report, Software Architecture Patterns, can help you learn about common software architecture patterns, how they work, the pros and cons, and when you would choose to use each one. It also introduces a few anti-patterns you'll want to know about. This report is a great way to further develop your architectural skills and become an even greater asset to your organization—and it's free.

GET YOUR FREE O'REILLY eBOOK



The success of any application or system depends on the architecture pattern you use. By describing the overall characteristics of the architecture, these patterns not only guide designers and developers on how to design components, but also determine the ways in which those components should interact.

This O’Reilly report takes a deep dive into many common software architecture patterns. Each pattern includes a full explanation of how it works, explains the pattern’s benefits and considerations, and describes the circumstances and conditions it was designed to address. The report also includes an analysis and scorecard for each pattern based on several architecture and software development quality attributes.

Patterns include:

  • Layered architecture
  • Event-driven architecture
  • Microkernel architecture
  • Microservices architecture
  • Space-based architecture
  • In addition to these specific patterns, you’ll also learn about the Architecture by Implication anti-pattern and the causes and effects of not using architecture patterns.

Mark Richards
Mark Richards is an experienced hands-on software architect involved in the architecture, design, and implementation of Microservices Architectures, Service Oriented Architectures, and distributed systems in J2EE and other technologies. He has been involved in the software industry since 1983, and has significant experience and expertise in application, integration, and enterprise architecture. Mark served as the President of the New England Java Users Group from 1999 thru 2003. He is the author of numerous technical books and videos, including "Software Architecture Fundamentals" (O’Reilly video), "Enterprise Messaging" (O’Reilly video), "Java Message Service 2nd Edition" (O’Reilly), and 97 Thinks Every Software Architect Should Know (O'Reilly). Mark has a masters degree in computer science and numerous architect and developer certifications from IBM, Sun, The Open Group, and BEA. He is a regular conference speaker at the No Fluff Just Stuff (NFJS) Symposium Series, and has spoken at over 100 conferences and user groups around the world on a variety of enterprise-related technical topics.When he is not working Mark can usually be found hiking in the White Mountains or along the Appalachian Trail.

Wednesday, November 16, 2016

Gradle Recipes for Android: Master the New Build System for Android

Gradle Recipes for Android: Master the New Build System for Android

Android adopted Gradle as the preferred build automation system a few years ago, but many Android developers are still unfamiliar with this open source tool. This hands-on guide provides a collection of Gradle recipes to help you quickly and easily accomplish the most common build tasks for your Android apps. You’ll learn how to customize project layouts, add dependencies, and generate many different versions of your app.

Gradle is based on Groovy, yet very little knowledge of the JVM language is required for you to get started. Code examples use Android SDK version 23, with emulators from Marshmallow (Android 6) or Lollipop (Android 5). If you’re comfortable with Java and Android, you’re ready.

  • Understand Gradle’s generated build files for Android apps
  • Run Gradle from the command line or inside Android Studio
  • Add more Java libraries to your Android app
  • Import and export Eclipse ADT projects
  • Digitally sign a Release APK for the Google Play store
  • Use product flavors to build many versions of the same app
  • Add custom tasks to the Gradle build process
  • Test both your app’s Android and non-Android components
  • Improve the performance of your Gradle build


Saturday, October 29, 2016

Java Programming for Android Developers For Dummies, 2nd Edition

Java Programming for Android Developers For Dummies

Develop the next killer Android App using Java programming!
Android is everywhere! It runs more than half the smartphones in the U.S.—and Java makes it go. If you want to cash in on its popularity by learning to build Android apps with Java, all the easy-to-follow guidance you need to get started is at your fingertips. Inside, you'll learn the basics of Java and grasp how it works with Android; then, you'll go on to create your first real, working application. How cool is that?

The demand for Android apps isn't showing any signs of slowing, but if you're a mobile developer who wants to get in on the action, it's vital that you get the necessary Java background to be a success. With the help of Java Programming for Android Developers For Dummies, you'll quickly and painlessly discover the ins and outs of using Java to create groundbreaking Android apps—no prior knowledge or experience required!
  • Get the know-how to create an Android program from the ground up
  • Make sense of basic Java development concepts and techniques
  • Develop the skills to handle programming challenges
  • Find out how to debug your app
Don't sit back and watch other developers release apps that bring in the bucks! Everything you need to create that next killer Android app is just a page away!



Tuesday, October 25, 2016

Beginning Android Programming with Android Studio 4th Edition

A hands-on introduction to the latest release of the Android OS and the easiest Android tools for developers

Beginning Android Programming with Android Studio

As the dominant mobile platform today, the Android OS is a powerful and flexible platform for mobile device. The new Android 7 release (New York Cheesecake) boasts significant new features and enhancements for both smartphone and tablet applications. This step-by-step resource takes a hands-on approach to teaching you how to create Android applications for the latest OS and the newest devices, including both smartphones and tablets.
  • Shows you how to install, get started with, and use Android Studio 2 - the simplest Android developer tool ever for beginners
  • Addresses how to display notifications, create rich user interfaces, and use activities and intents
  • Reviews mastering views and menus and managing data
  • Discusses working with SMS 
  • Looks at packaging and publishing applications to the Android market
Beginning Android Programming with Android Studio starts with the basics and goes on to provide you with everything you need to know to begin to successfully develop your own Android applications.

Tuesday, October 18, 2016

Android Studio: (About) 10 Things You (Probably) Didn’t Know You Could Do

Java 8 Language Features on Android


With the help of the Jack toolchain, you’ll be able to cut out boilerplate code with the help of some Java 8 language features. Lambda expressions provide a compact way to express functional interfaces (interfaces with a single method) and method references allow you to use existing methods as lambda expressions - both features available back to API 9 (Gingerbread) devices!

Added in API 24 is the Stream API, default method implementations and static methods for interfaces, and repeatable annotations - you’ll have to be on an API 24 devices to take advantage of those features!

Check out the documentation for all the details: https://goo.gl/h3KUPP


Monday, October 3, 2016

Android High Performance Programming

Build fast and efficient Android apps that run as reliably as clockwork in a multi-device world

Android High Performance Programming

About This Book
  • Wide coverage of various topics that help in developing optimal applications
  • Explore the concepts of Advanced Native Coding in depth
  • A must-have for professional-standard Android developers for whom performance failures and the sloppy use of resources are simply unacceptable
Who This Book Is For
This book is aimed at developers with an advanced knowledge of Android and who want to test their skills and learn new techniques to increase the performance of their applications. We assume they are comfortable working with the entire Android SDK, and have been doing it for a few years. They need to be familiar with frameworks such as NDK to use native code, which is crucial for app performance

What You Will Learn
  • Create Android applications that squeeze the most from the limited resource capacity of devices
  • Swap code that isn't performing
  • Efficient memory management by identifying problems such as leaks
  • Reap the benefits of multithreaded and asynchronous programming
  • Maximize the security and encryption mechanisms natively provided by Android
  • Perform efficient network operations and techniques to retrieve data from servers
  • Master the NDK to write native code that can perform faster operations
In Detail
Performant applications are one of the key drivers of success in the mobile world. Users may abandon an app if it runs slowly. Learning how to build applications that balance speed and performance with functionality and UX can be a challenge; however, it's now more important than ever to get that balance right.

Android High Performance will start you thinking about how to wring the most from any hardware your app is installed on, so you can increase your reach and engagement. The book begins by providing an introduction to state–of-the-art Android techniques and the importance of performance in an Android application. Then, we will explain the Android SDK tools regularly used to debug and profile Android applications. We will also learn about some advanced topics such as building layouts, multithreading, networking, and security. Battery life is one of the biggest bottlenecks in applications; and this book will show typical examples of code that exhausts battery life, how to prevent this, and how to measure battery consumption from an application in every kind of situation to ensure your apps don't drain more than they should.

This book explains techniques for building optimized and efficient systems that do not drain the battery, cause memory leaks, or slow down with time.

Style and approach
The book follows a tutorial-based approach to take the reader from the basic fundamentals of debugging to advanced performance-improvement concepts.

Sunday, September 11, 2016

Expert Android Studio

Take your Android programming skills to the next level by unleashing the potential of Android Studio

Expert Android Studio

Expert Android Studio bridges the gap between your Android programing skills with the provided tools including Android Studio, NDK, Gradle and Plugins for IntelliJ Idea Platform. Packed with best practices and advanced tips and techniques on Android tools, development cycle, continuos integration, release management, testing, and performance, this book offers professional guidance to experienced developers who want to push the boundaries of the Android platform with the developer tools. You'll discover how to use the tools and techniques to unleash your true potential as a developer.
  • Discover the basics of working in Android Studio and Gradle, as well as the application architecture of the latest Android platform
  • Understand Native Development Kit and its integration with Android Studio
  • Complete your development lifecycle with automated tests, dependency management, continuos integration and release management
  • Writing your own Gradle plugins to customize build cycle
  • Writing your own plugins for Android Studio to help your development tasks.
Expert Android Studio is a tool for expert and experienced developers who want to learn how to make use of the tools while creating Android applications for use on mobile devices.

Tuesday, August 30, 2016

Asynchronous Android Programming, 2nd Edition

Asynchronous Android Programming

About This Book
  • Construct scalable and performant applications to take advantage of multi-thread asynchronous techniques
  • Explore the high-level Android asynchronous constructs available on the Android SDK
  • Choose the most appropriate asynchronous technique to implement your next outstanding feature
Who This Book Is For
This book is for Android developers who want to learn how to build multithreaded and reliable Android applications using high-level and advanced asynchronous techniques and concepts.

What You Will Learn
  • Get familiar with the Android process model and low-level concurrent and multithread constructs available on the Android SDK
  • Use AsyncTask to load data in the background, delivering progress results in the meantime
  • Enhance UI performance and responsiveness by sending work to a service running in the background
  • Defer, schedule, and batch work on the Android system without compromising the battery life and user experience
  • Use the JNI interface to execute concurrent work on native layer
  • Pull and push data from your network servers using the Google GCM platform
  • Create and compose tasks with RxJava to execute complex asynchronous work in a predictable way
  • Get accustomed to the use of the Android Loader construct to deliver up-to-date results
In Detail
Asynchronous programming has acquired immense importance in Android programming, especially when we want to make use of the number of independent processing units (cores) available on the most recent Android devices. To start with, we will discuss the details of the Android process model and the Java low-level concurrent framework, delivered by the Android SDK. Next, we will discuss the creation of IntentServices, bound services, and external services, which can run in the background even when the user is not interacting with them. In a more advanced phase, you will create background tasks that are able to execute CPU-intensive tasks in native code–making use of the Android NDK.

You will be then guided through the process of interacting with remote services asynchronously using the HTTP protocol or Google GCM Platform. Finally, we will introduce RxJava, a popular asynchronous Java framework used to compose work in a concise and reactive way.

Monday, August 29, 2016

Auto scrolling (horizontal running) TextView


It's follow-up post about my old post of "Implement auto-running TextView", to make a TextView horizontal scrolling automatically.

This video show how it tested on Android emulator running Android 7.0 Nougat API 24, in Multi-Window Mode also.


<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:padding="16dp"
    android:orientation="vertical"
    tools:context="com.blogspot.android_er.androidautotextview.MainActivity">

    <TextView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_margin="20dp"
        android:layout_gravity="center_horizontal"
        android:autoLink="web"
        android:text="http://android-er.blogspot.com/"
        android:textStyle="bold"/>

    <TextView
        android:id="@+id/scrollingtext"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:textSize="40dp"
        android:background="#D0D0D0"
        android:text="http://android-er.blogspot.com/"

        android:focusable="true"
        android:focusableInTouchMode="true"
        android:singleLine="true"
        android:scrollHorizontally="true"
        android:ellipsize="marquee"
        android:marqueeRepeatLimit ="marquee_forever"/>

</LinearLayout>


And set it selected in Java code.
package com.blogspot.android_er.androidautotextview;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.widget.TextView;

public class MainActivity extends AppCompatActivity {

    TextView scrollingText;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        scrollingText = (TextView)findViewById(R.id.scrollingtext);
        scrollingText.setSelected(true);

    }
}



Saturday, August 27, 2016

TextView, auto scroll down to display bottom of text


This example show how to make a TextView auto scroll down to display bottom of text. In the demonstration, the upper TextView is normal, user cannot see the bottom of text if it is full. The lower one, the TextView will auto scroll down, such that user can see the new added text.


<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:padding="16dp"
    android:orientation="vertical"
    tools:context="com.blogspot.android_er.androidautotextview.MainActivity">

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_margin="20dp"
        android:layout_gravity="center_horizontal"
        android:autoLink="web"
        android:text="http://android-er.blogspot.com/"
        android:textStyle="bold"/>

    <EditText
        android:id="@+id/textin"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:textSize="28dp"/>

    <Button
        android:id="@+id/btnappend"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:text="Append Text"/>

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical">
        <TextView
            android:id="@+id/textout1"
            android:layout_width="match_parent"
            android:layout_height="0dp"
            android:layout_weight="1"
            android:textSize="20dp"
            android:background="#D0D0D0"/>
        <TextView
            android:id="@+id/textout2"
            android:layout_width="match_parent"
            android:layout_height="0dp"
            android:layout_weight="1"
            android:textSize="20dp"
            android:gravity="bottom"
            android:background="#E0E0E0"/>
    </LinearLayout>

</LinearLayout>


package com.blogspot.android_er.androidautotextview;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.text.method.ScrollingMovementMethod;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;

public class MainActivity extends AppCompatActivity {

    EditText editTextIn;
    TextView textViewOut1, textViewOut2;
    Button btnAppend;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        editTextIn = (EditText)findViewById(R.id.textin);
        btnAppend = (Button)findViewById(R.id.btnappend);

        textViewOut1 = (TextView)findViewById(R.id.textout1);
        textViewOut1.setText("It's normal TextView.\n");

        textViewOut2 = (TextView)findViewById(R.id.textout2);
        textViewOut2.setMovementMethod(new ScrollingMovementMethod());
        textViewOut2.setText("This TextView always auto scroll down to display bottom of text.\n");


        btnAppend.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                String textToAppend = editTextIn.getText().toString() + "\n";
                textViewOut1.append(textToAppend);
                textViewOut2.append(textToAppend);
                editTextIn.setText("");
            }
        });
    }
}


Wednesday, August 24, 2016

The Android Game Developer's Handbook

The Android Game Developer's Handbook

Key Features
  • Practical tips and tricks to develop powerful Android games
  • Learn to successfully implement microtransactions and monitor the performance of your game once it's out live.
  • Integrate Google's DIY VR tool and Google Cardboard into your games to join in on the VR revolution
Book Description
Gaming in android is an already established market and growing each day. Previously games were made for specific platforms, but this is the time of cross platform gaming with social connectivity. It requires vision of polishing, design and must follow user behavior. This book would help developers to predict and create scopes of improvement according to user behavior.

You will begin with the guidelines and rules of game development on the Android platform followed by a brief description about the current variants of Android devices available. Next you will walk through the various tools available to develop any Android games and learn how to choose the most appropriate tools for a specific purpose.

You will then learn JAVA game coding standard and style upon the Android SDK. Later, you would focus on creation, maintenance of Game Loop using Android SDK, common mistakes in game development and the solutions to avoid them to improve performance. We will deep dive into Shaders and learn how to optimize memory and performance for an Android Game before moving on to another important topic, testing and debugging Android Games followed by an overview about Virtual Reality and how to integrate them into Android games.

Want to program a different way? Inside you'll also learn Android game Development using C++ and OpenGL. Finally you would walk through the required tools to polish and finalize the game and possible integration of any third party tools or SDKs in order to monetize your game when it's one the market!

What you will learn
  • Learn the prospects of Android in Game Development
  • Understand the Android architecture and explore platform limitation and variations
  • Explore the various approaches for Game Development using Android
  • Learn about the common mistakes and possible solutions on Android Game Development
  • Discover the top Cross Platform Game Engines and port games on different android platform
  • Optimize memory and performance of your game.
  • Familiarize yourself with different ways to earn money from Android Games
About the Author
Avisekhar Roy is a B.Tech engineer in computer science. He has had a passion for coding since his school days. However, he had no plans to become a game programmer. His fate landed him in the gaming industry in 2010. Since then, he fell in love with game development.

Avisekhar has worked in many formats of game development environment, ranging from small companies and individual studios to corporate companies and full-scale game development studios. He recently started his own gaming start-up in 2016 and is currently working on games for the mobile platform.

Avisekhar has also worked with some big companies, such as Reliance Games in India, as well as a small-scale studio called Nautilus Mobile. He is now trying to acquire a position in the gaming industry for his own venture, Funboat Games.

Table of Contents
  1. Android Game Development
  2. Introduction to Different Android Platforms
  3. Different Android Development Tools
  4. Android Development Style and Standards in the Industry
  5. Understanding the Game Loop and Frame Rate
  6. Improving Performance of 2D/3D Games
  7. Working with Shaders
  8. Performance and Memory Optimization
  9. Testing Code and Debugging
  10. Scope for Android in VR Games
  11. Android Game Development Using C++ and OpenGL
  12. Polishing Android Games
  13. Third-Party Integration, Monetization, and Services

Tuesday, August 16, 2016

Find the Best moveset of Pokémons

It's a web site Pokémon GO Info, you can check the best moveset, weaknesses, max CP and also ranking of any Pokémon.

This video show the best moveset of Drogonite, Vaporeon and Gyarados.


Visit: https://pokemon.gameinfo.io/


Select the Pokémon you want to check. It will show the best moveset of Quick move and Main move with highest dps (damage per second). Also show the weaknesses.


Compare with the moveset of your Pokémon.


Monday, August 15, 2016

Sunday, August 14, 2016

Niantic will ban 'Pokemon GO' Cheaters

Niantic announced in their Pokémon GO > FAQ > Submit a ban appeal:

Your account will be permanently terminated for violations of the Pokémon GO Terms of Service. This includes, but is not limited to: falsifying your location, using emulators, modified or unofficial software and/or accessing Pokémon GO clients or backends in an unauthorized manner including through the use of third party software.

For the first three reasons, I think all you and me agree. But for the fourth reason (accessing Pokémon GO clients or backends), it seem including check iv using third party software/web service; so I already removed my intro videos about.


Friday, August 12, 2016

Pikachu Evolution: to Raichu


Google Play is launching on Chromebooks

At Google I/O 2016, Google announced that Google Play would be launching on Chromebooks. As an Android developer, your apps will soon be compatible with Chromebooks. Here’s how you can improve the Chromebook experience for your Android apps:
No action is required, but we recommend the steps above to best position your app for the millions of potential customers using Chromebooks.



Wednesday, August 10, 2016

Custom view to draw bitmap along path, calculate in background thread

Last post show a example of "Custom view to draw bitmap along path", with calculation run inside onDraw(). It's modified version to pre-calculate in back thread.


(remark: in last post, canvas.drawPath() is called inside onDraw(). It seem run very slow, removed in this example.)

Modify AnimationView.java
package com.blogspot.android_er.androidmovingbitmapalongpath;

import android.content.Context;
import android.graphics.Canvas;
import android.util.AttributeSet;
import android.view.View;

import java.util.ArrayList;
import java.util.List;

public class AnimationView extends View {

    List<AnimationThing> animationThingsList;
    public AnimationView(Context context) {
        super(context);
        initAnimationView();
    }

    public AnimationView(Context context, AttributeSet attrs) {
        super(context, attrs);
        initAnimationView();
    }

    public AnimationView(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
        initAnimationView();
    }

    private void initAnimationView(){
        animationThingsList = new ArrayList<>();
    }

    public void insertThing(AnimationThing thing){
        animationThingsList.add(thing);
    }

    //prepare calculation in background thread
    public void preDraw(){
        for (AnimationThing thing : animationThingsList){
            if(thing.distance < thing.pathLength){
                thing.pathMeasure.getPosTan(thing.distance, thing.pos, thing.tan);

                thing.matrix.reset();
                float degrees = (float)(Math.atan2(thing.tan[1], 
                        thing.tan[0])*180.0/Math.PI);
                thing.matrix.postRotate(degrees, thing.bm_offsetX, thing.bm_offsetY);
                thing.matrix.postTranslate(thing.pos[0]-thing.bm_offsetX, 
                        thing.pos[1]-thing.bm_offsetY);

                thing.distance += thing.step;
            }else{
                thing.distance = 0;
            }
        }
    }

    @Override
    protected void onDraw(Canvas canvas) {
        for (AnimationThing thing : animationThingsList){
            canvas.drawBitmap(thing.bm, thing.matrix, null);
        }

        invalidate();
    }

    /*
    @Override
    protected void onDraw(Canvas canvas) {
        for (AnimationThing thing : animationThingsList){

            //This code run slow!!!
            //canvas.drawPath(thing.animPath, thing.paint);

            if(thing.distance < thing.pathLength){
                thing.pathMeasure.getPosTan(thing.distance, thing.pos, thing.tan);

                thing.matrix.reset();
                float degrees = (float)(Math.atan2(thing.tan[1], 
                    thing.tan[0])*180.0/Math.PI);
                thing.matrix.postRotate(degrees, thing.bm_offsetX, thing.bm_offsetY);
                thing.matrix.postTranslate(thing.pos[0]-thing.bm_offsetX, 
                    thing.pos[1]-thing.bm_offsetY);

                canvas.drawBitmap(thing.bm, thing.matrix, null);

                thing.distance += thing.step;
            }else{
                thing.distance = 0;
            }
        }

        invalidate();
    }
    */


}


MainActivity.java
package com.blogspot.android_er.androidmovingbitmapalongpath;

import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Path;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;

public class MainActivity extends AppCompatActivity {

    AnimationView myAnimationView;
    AniThread myAniThread;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        myAnimationView = (AnimationView)findViewById(R.id.MyAnimationView);

        prepareThings();
        myAniThread = new AniThread(myAnimationView);
        myAniThread.start();
    }

    private void prepareThings() {
        Path animPath;
        float step;
        Bitmap bm;

        bm = BitmapFactory.decodeResource(getResources(), R.mipmap.ic_launcher);

        animPath = new Path();
        animPath.moveTo(100, 100);
        animPath.lineTo(200, 100);
        animPath.lineTo(300, 50);
        animPath.lineTo(400, 150);
        animPath.lineTo(100, 300);
        animPath.lineTo(600, 300);
        animPath.lineTo(100, 100);
        animPath.close();

        step = 1;

        AnimationThing thing = new AnimationThing(animPath, bm, step);
        myAnimationView.insertThing(thing);

        //The second thing
        bm = BitmapFactory.decodeResource(getResources(), android.R.drawable.ic_menu_add);

        animPath.reset();
        animPath.addCircle(400, 400, 300, Path.Direction.CW);
        step = 3;
        thing = new AnimationThing(animPath, bm, step);
        myAnimationView.insertThing(thing);
    }

    class AniThread extends Thread{

        AnimationView targetView;

        public AniThread(AnimationView target) {
            super();
            targetView = target;
        }

        @Override
        public void run() {
            while (true){
                targetView.preDraw();
                try {
                    Thread.sleep(10);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
            }

        }
    }

}


The other files, AnimationThing.java and activity_main.xml, refer last post.


download filesDownload the files .

Tuesday, August 9, 2016

Custom view to draw bitmap along path


Refer to my old exercise "Animation of moving bitmap along path", the bitmap and path are hard-coded inside custom view. It's a modified version; the thing to be drawn (bitmap/path) are held separated and referenced by custom view in a list, such that it is easy to insert more things.


Please notice:
- I don't thing it's a good approach to do this, I just show a interesting exercise.
- You should not do the calculation (such as move the bitmap) inside onDraw(), it's suggested to do it in another thread.

Create a new class AnimationThing.java. It hold the bitmap and path of individual thing.
package com.blogspot.android_er.androidmovingbitmapalongpath;

import android.graphics.Bitmap;
import android.graphics.Matrix;
import android.graphics.Paint;
import android.graphics.Path;
import android.graphics.PathMeasure;

public class AnimationThing {

    Paint paint;
    Path animPath;
    PathMeasure pathMeasure;
    float pathLength;
    Bitmap bm;
    int bm_offsetX, bm_offsetY;
    float step;
    float distance;
    float[] pos;
    float[] tan;
    Matrix matrix;

    public AnimationThing(Paint paint,
                          Path animPath,
                          Bitmap bm,
                          float step) {
        this.paint = paint;

        this.animPath = animPath;
        pathMeasure = new PathMeasure(this.animPath, false);
        pathLength = pathMeasure.getLength();

        this.bm = bm;
        bm_offsetX = bm.getWidth()/2;
        bm_offsetY = bm.getHeight()/2;

        this.step = step;
        distance = 0;
        pos = new float[2];
        tan = new float[2];

        matrix = new Matrix();
    }
}


Create our custom view, AnimationView .java.
package com.blogspot.android_er.androidmovingbitmapalongpath;

import android.content.Context;
import android.graphics.Canvas;
import android.util.AttributeSet;
import android.view.View;

import java.util.ArrayList;
import java.util.List;

public class AnimationView extends View {

    List<AnimationThing> animationThingsList;
    public AnimationView(Context context) {
        super(context);
        initAnimationView();
    }

    public AnimationView(Context context, AttributeSet attrs) {
        super(context, attrs);
        initAnimationView();
    }

    public AnimationView(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
        initAnimationView();
    }

    private void initAnimationView(){
        animationThingsList = new ArrayList<>();
    }

    public void insertThing(AnimationThing thing){
        animationThingsList.add(thing);
    }

    @Override
    protected void onDraw(Canvas canvas) {
        for (AnimationThing thing : animationThingsList){

            //!!! Only the path of the last thing will be drawn on screen
            canvas.drawPath(thing.animPath, thing.paint);

            if(thing.distance < thing.pathLength){
                thing.pathMeasure.getPosTan(thing.distance, thing.pos, thing.tan);

                thing.matrix.reset();
                float degrees = (float)(Math.atan2(thing.tan[1], thing.tan[0])*180.0/Math.PI);
                thing.matrix.postRotate(degrees, thing.bm_offsetX, thing.bm_offsetY);
                thing.matrix.postTranslate(thing.pos[0]-thing.bm_offsetX, thing.pos[1]-thing.bm_offsetY);

                canvas.drawBitmap(thing.bm, thing.matrix, null);

                thing.distance += thing.step;
            }else{
                thing.distance = 0;
            }
        }

        invalidate();
    }
}


Layout, activity_main.xml.
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:padding="16dp"
    android:orientation="vertical"
    tools:context="com.blogspot.android_er.androidmovingbitmapalongpath.MainActivity">

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center_horizontal"
        android:autoLink="web"
        android:text="http://android-er.blogspot.com/"
        android:textStyle="bold" />

    <com.blogspot.android_er.androidmovingbitmapalongpath.AnimationView
        android:id="@+id/MyAnimationView"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="#F0F0F0"/>
</LinearLayout>


MainActivity.java
package com.blogspot.android_er.androidmovingbitmapalongpath;

import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Path;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;

public class MainActivity extends AppCompatActivity {

    AnimationView myAnimationView;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        myAnimationView = (AnimationView)findViewById(R.id.MyAnimationView);

        prepareThings();
    }

    private void prepareThings(){
        Paint paint;
        Path animPath;
        float step;
        Bitmap bm;

        paint = new Paint();
        paint.setColor(Color.BLUE);
        paint.setStrokeWidth(1);
        paint.setStyle(Paint.Style.STROKE);

        bm = BitmapFactory.decodeResource(getResources(), R.mipmap.ic_launcher);

        animPath = new Path();
        animPath.moveTo(100, 100);
        animPath.lineTo(200, 100);
        animPath.lineTo(300, 50);
        animPath.lineTo(400, 150);
        animPath.lineTo(100, 300);
        animPath.lineTo(600, 300);
        animPath.lineTo(100, 100);
        animPath.close();

        step = 1;

        AnimationThing thing = new AnimationThing(paint, animPath, bm, step);
        myAnimationView.insertThing(thing);

        //The second thing
        bm = BitmapFactory.decodeResource(getResources(), android.R.drawable.ic_menu_add);

        animPath.reset();
        animPath.addCircle(400, 400, 300, Path.Direction.CW);
        step = 3;
        thing = new AnimationThing(paint, animPath, bm, step);
        myAnimationView.insertThing(thing);
    }
}



download filesDownload the files .

Next:
Custom view to draw bitmap along path, calculate in background thread

Monday, August 8, 2016

Pokémon GO has been updated to version 0.33.0 for Android and 1.3.0 for iOS

Pokémon GO has been updated to version 0.33.0 for Android and 1.3.0 for iOS devices. Below are some release notes and comments from our development team.
  • Added a dialog to remind Trainers that they should not play while traveling above a certain speed. Trainers must confirm they are not driving in order to continue playing.
  • Made improvements to the accuracy of a curveball throw
  • Fixed a bug that prevented ”Nice,” ”Great,” and “Excellent” Poké Ball throws from awarding the appropriate XP bonuses.
  • Fixed achievements showing incorrect Medal icons.
  • Enabled the ability for Trainers to change their nickname one time. Please choose your new nickname wisely.
  • Resolved issues with the battery saver mode on iOS and re-enabled the feature.
  • Added visuals of Team Leaders Candela, Blanche, and Spark.
  • Currently testing a variation of the “Nearby Pokémon” feature with a subset of users. During this period you may see some variation in the nearby Pokémon UI.
  • Minor text fixes

source: http://pokemongo.nianticlabs.com/en/post/update-080816/


Customize theme's colors


Last example show how to Apply Material Theme (with default color) to Activity. The video show how to further custom the theme colors.


Edit values/styles.xml to modify style of "AppTheme2", adding various color defination.
<resources>

    <!-- Base application theme. -->
    <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
        <!-- Customize your theme here. -->
        <item name="colorPrimary">@color/colorPrimary</item>
        <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
        <item name="colorAccent">@color/colorAccent</item>
    </style>

    <style name="AppTheme2" parent="android:Theme.Material">
        <item name="android:colorPrimary">@android:color/holo_orange_light</item>
        <item name="android:colorPrimaryDark">@android:color/holo_orange_dark</item>
        <item name="android:textColorPrimary">@android:color/holo_blue_bright</item>
        <item name="android:windowBackground">@android:color/darker_gray</item>
        <item name="android:navigationBarColor">@android:color/holo_green_dark</item>
    </style>

</resources>


Make sure "@style/AppTheme2" is used in AndroidManifest.xml.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.blogspot.android_er.androidmultiwindow">

    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:supportsRtl="true"
        android:theme="@style/AppTheme2">
        <activity android:name=".MainActivity">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>

</manifest>


Reference:
Using the Material Theme

PokéAdvisor blocked

It appears Niantic has blocked PokeAdvisor from accessing your data. PokéAdvisor will not be able to update user Trainer. The site is in read only mode, so you can search for your Trainer and download your Pokemon for a little while longer.



Related:
- Niantic will ban 'Pokemon GO' Cheaters

Farfetch'd - Asia limited Pokémon





Farfetch'd is always seen with a stalk from a plant of some sort. Apparently, there are good stalks and bad stalks. This Pokémon has been known to fight with others over stalks.
~ know more.


Wednesday, August 3, 2016

Windows 10 Anniversary Update

Windows 10 Anniversary Update will begin rolling out around the world. The Windows 10 Anniversary Update is full of new features and innovations that bring Windows Ink and Cortana to life; a faster, more accessible and more power-efficient Microsoft Edge browser; advanced security features; new gaming experiences and more. The Windows 10 Anniversary Update will start rolling out to Windows 10 Mobile phones in the coming weeks.

The Windows 10 Anniversary Update is being rolled out to Windows 10 PCs across the world in phases starting with the newer machines first. You don’t have to do anything to get the Windows 10 Anniversary Update, it will roll out automatically to you through Windows Update if you’ve chosen to have updates installed automatically on your device. However, if you don’t want to wait for the update to roll out to you, you can manually get the update yourself on your personal PC. If you’re using a Windows 10 PC at work, you will need to check with your IT administrator for details on your organization’s specific plans to update.

Read more at https://blogs.windows.com/windowsexperience/2016/08/02/how-to-get-the-windows-10-anniversary-update/#ZMI61X8Smr8eLb88.99


Friday, July 29, 2016

Hacking Android

Explore every nook and cranny of the Android OS to modify your device and guard it against security threats

Hacking Android

About This Book
  • Understand and counteract against offensive security threats to your applications
  • Maximize your device's power and potential to suit your needs and curiosity
  • See exactly how your smartphone's OS is put together (and where the seams are)
Who This Book Is For
This book is for anyone who wants to learn about Android security. Software developers, QA professionals, and beginner- to intermediate-level security professionals will find this book helpful. Basic knowledge of Android programming would be a plus.

What You Will Learn
  • Acquaint yourself with the fundamental building blocks of Android Apps in the right way
  • Pentest Android apps and perform various attacks in the real world using real case studies
  • Take a look at how your personal data can be stolen by malicious attackers
  • Understand the offensive maneuvers that hackers use
  • Discover how to defend against threats
  • Get to know the basic concepts of Android rooting
  • See how developers make mistakes that allow attackers to steal data from phones
  • Grasp ways to secure your Android apps and devices
  • Find out how remote attacks are possible on Android devices
In Detail
With the mass explosion of Android mobile phones in the world, mobile devices have become an integral part of our everyday lives. Security of Android devices is a broad subject that should be part of our everyday lives to defend against ever-growing smartphone attacks. Everyone, starting with end users all the way up to developers and security professionals should care about android security.

Hacking Android is a step-by-step guide that will get you started with Android security. You'll begin your journey at the absolute basics, and then will slowly gear up to the concepts of Android rooting, application security assessments, malware, infecting APK files, and fuzzing. On this journey you'll get to grips with various tools and techniques that can be used in your everyday pentests. You'll gain the skills necessary to perform Android application vulnerability assessment and penetration testing and will create an Android pentesting lab.

Style and approach
This comprehensive guide takes a step-by-step approach and is explained in a conversational and easy-to-follow style. Each topic is explained sequentially in the process of performing a successful penetration test. We also include detailed explanations as well as screenshots of the basic and advanced concepts.

Thursday, July 28, 2016

Apply Material Theme to Activity


This video show how to apply Android provided Material Theme to your Activity.


- Edit values/styles.xml to add a new style inherits from Android provided Material Theme: android:Theme.Material, android:Theme.Material.Light or android:Theme.Material.Light.DarkActionBar.

- Edit AndroidManifest.xml to use the new style.

- You have to change your MainActivity extends Activity. Otherwise the following error will happen:
You need to use a Theme.AppCompat theme (or descendant) with this activity.

The video also show how it display on Multi-Window Mode.


Next:
- Customize theme's colors