Friday, February 28, 2014

java.util.concurrent.locks.Lock implementations provide more extensive locking operations than can be obtained using synchronized methods and statements.java.util.concurrent.locks.ReentrantLock is a reentrant mutual exclusion Lock with the same basic behavior and semantics as the implicit monitor lock accessed using synchronized methods and statements, but with extended capabilities.

There are one billion smartphones in use today. The combined processing power of all these devices can truly revolutionize scientific research, and make an enormous contribution to humanity - if we all work together.With HTC Power To Give, the potential to research cures for cancer, Alzheimer’s disease, AIDS – to help understand climate change, or venture into space – is all at our fingertips.By downloading HTC Power To Give, plugging in your phone and connecting to Wi-Fi, your spare computing power will become part of an enormous grid, providing processing power to a project you’ve selected from a range across the world.Medical, environmental, scientific and many other projects will benefit. Projects that could otherwise take hundreds of years could be executed in a drastically shorter time.

Thursday, February 27, 2014

Build a fully-functional augmented reality game and deploy it on iOS and Android

Achieve better trackable performance for a robust experience

Understand the prefabs and components that make up Vuforia SDK

Explore the Unity environment to maximize your game development experience

In Detail

While augmented reality has been around for years, it has never reached its full potential. Now, the vast majority of people are walking around with powerful smartphones that are perfectly suited to house the AR experience. This is the reason why the technology has become as popular as it is now. Augmented reality can deliver a level of immersion that is unrivalled by any other method of development, as it blends our reality with overlaid computer generated data.

Developing AR Games for iOS and Android is a well-structured guide that introduces you to the augmented reality world using a step-by-step approach. It will help you understand how to create powerful AR apps using Unity as well as how to create immersive experiences for users.

Developing AR Games for iOS and Android examines the structures of Vuforia and Unity and how they work together to create augmented reality. The book will introduce you to the structure of the Unity environment and how Vuforia facilitates creating AR apps.You will also see how easy it is to build a whole world in Unity's Editor. You will go through the process of using Vuforia prefabs like the AR camera and Image Target in Unity, where you can build the AR experience in a what-you-see-is-what-you-get fashion.

In Developing AR Games for iOS and Android, you will learn both basic and advanced techniques that can be applied to achieve truly immersive AR apps and then how to deploy them on iOS and Android devices.

What you will learn from this book

Import your assets and packages in a Unity environment

Create perfect Image Targets for AR tracking

Understand how to deploy to iOS and Android from Unity

Add colliders to a scene and learn how to respond to events on them

Add forces to objects in a scene in a seamless physics-based environment

Learn about transformation and positioning in Unity

Listen to Vuforia events and respond to them

Approach

A practical and fast-paced guide that gives you all the information you need to start developing augmented reality games for iOS and Android.

Who this book is written for

This book is great for people who are either new to Vuforia and/or new to Unity. It is a great introductory guide for anyone with a very basic knowledge of xCode and iOS as well as a very basic knowledge of deploying to Android to start developing 3D-powered augmented reality apps.

Android is booming like never before, with millions of devices shipping every day. It's never been a better time to learn how to create your own 3D games and live wallpaper for Android. You'll find out all about shaders and the OpenGL pipeline, and discover the power of OpenGL ES 2.0, which is much more feature-rich than its predecessor. If you can program in Java and you have a creative vision that you'd like to share with the world, then this is the book for you.

This book will teach you everything you need to know to create compelling graphics on Android. You'll learn the basics of OpenGL by building a simple game of air hockey, and along the way, you'll see how to initialize OpenGL and program the graphics pipeline using shaders. Each lesson builds upon the one before it, as you add colors, shading, 3D projections, touch interaction, and more.

Then, you'll find out how to turn your idea into a live wallpaper that can run on the home screen. You'll learn about more advanced effects involving particles, lighting models, and the depth buffer. You'll understand what to look for when debugging your program, and what to watch out for when deploying to the market.

OpenGL can be somewhat of a dark art to the uninitiated. As you read this book, you'll learn each new concept from first principles. You won't just learn about a feature; you'll also understand how it works, and why it works the way it does. Everything you learn is forward-compatible with the just-released OpenGL ES 3, and you can even apply these techniques to other platforms, such as iOS or HTML5 WebGL.

A guide to building cross-platform apps using the W3C standards-based Cordova/PhoneGap framework Overview Understand the fundamentals of cross-platform mobile application development from build to distribution Learn to implement the most common features of modern mobile applications Take advantage of native mobile device capabilities including the camera, geolocation, and local storage using HTML, CSS, and JavaScript In Detail You don't have to know complex languages like Objective C to compete in the ever-growing mobile market place. The PhoneGap framework lets you use your web development skills to build HTML and JavaScript-based mobile applications with native wrappers that run on all the major mobile platforms, including Android, iOS, and Windows Phone 8. "PhoneGap Beginner's Guide" will help you break into the world of mobile application development. You will learn how to set up and configure your mobile development environment, implement the most common features of modern mobile apps, and build rich, native-style applications. The examples in this book deal with real use case scenarios, which will help you develop your own apps, and then publish them on the most popular app stores. Dive deep into PhoneGap and refine your skills by learning how to build the main features of a real world app. "PhoneGap Beginner's Guide" will guide you through the building blocks of a mobile application that lets users plan a trip and share their trip information. With the help of this app, you will learn how to work with key PhoneGap tools and APIs, extend the framework's functionality with plug-ins, and integrate device features such as the camera, contacts, storage, and more. By the time you're finished, you will have a solid understanding of the common challenges mobile app developers face, and you will know how to solve them. What you will learn from this book Set up and configure your development environment Manage cross-platform code bases Build well-performing modular apps Interact with the device sensors, file system, and camera Use key PhoneGap APIs Integrate native code in your mobile app Write a PhoneGap plugin Localize a mobile app Approach Written in a friendly, example-driven Beginner's Guide format, there are plenty of step-by-step instructions to help you get started with PhoneGap. Who this book is written for If you are a web developer or mobile application developer interested in an examples-based approach to learning mobile application development basics with PhoneGap, then this book is for you.

Roll out rock-solid, responsive, mobile first designs quickly and reliably

Overview

Make websites that will look great and be usable on almost any device that displays web pages.

Learn best practices for responsive design

Discover how to make designs that will be lean and fast on small screens without sacrificing a tablet or desktop experience

In Detail

The mobile first design philosophy aims to develop websites that will be lean and fast on small screens without sacrificing a tablet or desktop experience. Using HTML5, CSS3, and simple, standardized modern web tools you can make one site to rule them all.

Mobile First Design with HTML5 and CSS3 will teach you the tools you need to make a modern, standards-based web page that displays beautifully on nearly any web browser—essential knowledge for anyone who makes websites!

In this book, you will learn how to set up a project from scratch and quickly get up and running with a full portfolio website that will form the base for making almost any kind of web page. Learn to develop web pages that fit the web conventions we all have to conform to. You will learn how to make responsive image slideshows; image galleries with detail pages; and bold, eye-catching banners and forms. Best of all, you will learn how to make these things fast without compromising quality.

This book will walk you through the process step by step with all the code required, as well as the thinking that goes behind planning a mobile first responsive website.

What you will learn from this book

Develop web pages that change their layout and respond to different sized screens, so that they display well on mobiles, tablets, and desktops

Utilize HTML5 and CSS3 to make responsive web pages quickly and effectively

Use current technologies like LESS and SASS to work fast

Build web page components that will function well on both small and large screens

Create and plan designs that work for small and large screens without having to sacrifice content

Approach

A user friendly tutorial to develop websites that work for both small and large screens using HTML5 and CSS3.

Who this book is written for

This book is for beginner to intermediate developers and designers, as well as for those in management who want to understand what is possible with modern tools and strategies on the Web.

- When button "start() with name" pressed, it show thread name of "Thread A".
- When button "start()" pressed, without name assigned, it show something like "Thread-10807".
- When button "run()" pressed, even a name is assigned to the thread, but the run() method is called in main thread actually. So it show name of "main"

Sunday, February 23, 2014

The professional programmer’s Deitel® guide to smartphone and tablet app development using Android 4.3 and 4.4, the Eclipse-based Android Development Tools and the new Android Studio

Billions of apps have been downloaded from Google Play™! This book gives you everything you’ll need to start developing great Android apps quickly and getting them published on Google Play™. The book uses an app-driven approach–each new technology is discussed in the context of seven fully tested Android apps, complete with syntax coloring, code highlighting, code walkthroughs and sample outputs. Apps you’ll develop include:

Welcome App

Cannon Game

Tip Calculator

Doodlz

Twitter® Searches

Address Book

Flag Quiz

The first-generation Android phones were released in October 2008. By October 2013, a Strategy Analytics report showed that Android had 81.3% of the global smartphone market share, compared to 13.4% for Apple, 4.1% for Microsoft and 1% for Blackberry (bit.ly/1aqIZXf). Billions of apps have been downloaded from Google Play. There are now more than one billion activated Android devices worldwide and more than 1.5 million Android devices are being activated daily (venturebeat.com/2013/09/03/android-hits-1bactivations-and-will-be-called-kitkat-in-nextversion). The opportunities for Android app developers are enormous.

This book presents leading-edge computing technologies for professional software developers. At the heart of the book is the Deitel “app-driven approach”–concepts are presented in the context of complete working Android apps, rather than using code snippets. The introduction and app test drives at the beginning of each chapter show one or more sample executions. The book’s source code is available at www.deitel.com/books/androidfp2.

The apps in this book were carefully designed to introduce you to key Android features and APIs. You’ll quickly learn everything you need to start building Android apps–beginning with a testdrive of the Doodlz app in Chapter 1, then building your first app in Chapter 2. By the time you reach Chapter 9, you’ll be ready to create your own apps for submission to Google Play and other app marketplaces. You’ll master the Google Play submission process, including uploading your apps, deciding whether to sell your apps or offer them for free, and marketing them using in-app advertising, social media, Internet public relations and more.

In this exercise, we need to check if the current thread is the main thread, or called UI thread. Using the code:Looper.getMainLooper().getThread()==Thread.currentThread()

If it's true, means it's in main thread, otherwise it's in background thread.

The example show how to implement a Thread with Runnable object. And call its start() method to starts the new Thread of execution. Also notice that if you call its run() method, it will calls the run() method of the Runnable object directly, in current thread.

Saturday, February 22, 2014

This example demonstrate how to show/hide menu items dynamically using Java code, by calling setVisible() method. Even if a menu item is not visible, it may still be invoked via its shortcut. To completely disable an item, set it to invisible and disabled.

Thursday, February 20, 2014

This example send bytes of "Hello..." to Arduino Esplora board from Android in USB Host Mode. Please notice that it's just a middle stage in my exercise in USB Host Mode, not a final and mature example.