วันเสาร์ที่ 1 มีนาคม พ.ศ. 2557

Unity3D Game Build to Android



Unity3D Game Build to Android

Original Source Code from Unity Technologies.
https://www.assetstore.unity3d.com/#/content/13866


Getting Started with Android Development

Building games for a device running Android OS. However, the hardware is not completely standardized across all devices. There are some feature differences in the Android version.
Setting up your Android Developer environment
You will need to have your Android developer environment set up before you can test your Unity games on the device. This involves downloading and installing the Android SDK with the different Android platforms and adding your physical device to your system (this is done a bit differently depending on whether you are developing on Windows or Mac). This setup process is explained on the Android developer website, and there may be additional information provided by the manufacturer of your device. Since this is a complex process, we've provided a basic outline of the tasks that must be completed before you can run code on your Android device or in the Android emulator. However, the best thing to do is follow the instructions step-by-step from the Android developer portal.
Access Android Functionality
Unity Android provides scripting APIs to access various input data and settings. You can find out more about the available classes on the Android scripting page.
Exposing Native C, C++ or Java Code to Scripts
Unity Android allows you to call custom functions written in C/C++ directly from C# scripts (Java functions can be called indirectly). To find out how to make functions from native code accessible from Unity, visit the Android plugins page.
Occlusion Culling
Unity includes support for occlusion culling which is a particularly valuable optimization on mobile platforms. More information can be found on the occlusion culling page.
Splash Screen Customization
The splash screen displayed while the game launches can be customized - see this page for further details.
Troubleshooting and Bug Reports
There are many reasons why your application may crash or fail to work as you expected. Our Android troubleshooting guide will help you get to the bottom of bugs as quickly as possible. If, after consulting the guide, you suspect the problem is internal to Unity then you should file a bug report - see this page for details on how to do this.

How Unity Android Differs from Desktop Unity

Strongly Typed JavaScript

For performance reasons, dynamic typing in JavaScript is always turned off in Unity Android, as if #pragma strict were applied automatically to all scripts. This is important to know if you start with a project originally developed for the desktop platforms since you may find you get unexpected compile errors when switching to Android; dynamic typing is the first thing to investigate. These errors are usually easy to fix if you make sure all variables are explicitly typed or use type inference on initialization.

ETC as Recommended Texture Compression

Although Unity Android does support DXT/PVRTC/ATC textures, Unity will decompress the textures into RGB(A) format at runtime if those compression methods are not supported by the particular device in use. This could have an impact on the GPU rendering speed and it is recommended to use the ETC format instead. ETC is the de facto standard compression format on Android, and should be supported on all post 2.0 devices. However, ETC does not support an alpha channel and RGBA 16-bit will sometimes be the best trade-off between size, quality and rendering speed where alpha is required.
It is also possible to create separate android distribution archives (.apk) for each of the DXT/PVRTC/ATC formats, and let the Android Market's filtering system select the correct archives for different devices (see Publishing Builds for Android).

Movie Playback

Movie textures are not supported on Android, but a full-screen streaming playback is provided via scripting functions. To learn about supported file formats and scripting API, consult the movie page or the Android supported media formats page.


Android SDK Setup

There are some steps you must follow before you can build and run any code on your Android device. This is true regardless of whether you use Unity or write Android applications from scratch.

1. Download the Android SDK

Go to the Android Developer SDK webpage. Download and unpack the latest Android SDK.

2. Installing the Android SDK

Follow the instructions under Installing the SDK (although you can freely skip the optional parts relating to Eclipse). In step 4 of Installing the SDK be sure to add at least oneAndroid platform with API level equal to or higher than 9 (Platform 2.3 or greater), the Platform Tools, and the USB drivers if you're using Windows.

3. Get the device recognized by your system

This can be tricky, especially under Windows based systems where drivers tend to be a problem. Also, your device may come with additional information or specific drivers from the manufacturer.
For Windows: If the Android device is automatically recognized by the system you still might need to update the drivers with the ones that came with the Android SDK. This is done through the Windows Device Manager.
If the device is not recognized automatically use the drivers from the Android SDK, or any specific drivers provided by the manufacturer.
Additional info can be found here: USB Drivers for Windows
For Mac: If you're developing on Mac OSX then no additional drivers are usually required.
Note: Don't forget to turn on "USB Debugging" on your device. Go to Settings -> Developer options, then enable USB debugging. As of Android Jelly Bean 4.2 the Developer options are hidden by default. To enable them tap on Settings -> About Phone -> Build Version multiple times. Then you will be able to access the Settings -> Developer options.
If you are unsure whether your device is properly installed on your system, please read the trouble-shooting page for details.

4. Add the Android SDK path to Unity

The first time you build a project for Android (or if Unity later fails to locate the SDK) you will be asked to locate the folder where you installed the Android SDK (you should select the root folder of the SDK installation). The location of the Android SDK can also be changed in the editor by selecting Unity > Preferences from the menu and then clicking on External Tools in the preferences window.








How to Build App to Android  ( Unity 4.3.1 )

First  Android SDK Setup

Use Menu  :  Edit  -  Preferences  Then Select Android SDK Location



Set Google Play Publishing Settings 

Use Menu  :  Edit -  Project Settings - Player

  

Then Show PlayerSettings



Resolution and Presentation
You can set Android Device Screen Orientation.


Icon
show your icon on different screen android devices.


Splash Image
not use.

Other Settings
Set your Android Package , Version Code , Version Name and minimum sdk.



Publishing Settings
You can set keystore. Create New KeyStore or Use Existing KeyStore.



Android App on Google Play.




Space Shooter Game is simple demo 2D game from Unity Asset Store.
Easy Game for kid. Shoot Asteroid and enemy.
Use only one Finger to Play.

Original Source Code from Unity Technologies.
https://www.assetstore.unity3d.com/#/content/13866

How to Play
Use only one Finger to Play.
Touch to shoot lasers.
Touch to Move Left ,Right ,Up Down

เกมยิงยานอวกาศ Space Shooter Game
เกมที่ง่าย ๆ สำหรับเด็ก ยิงดาวเคราะห์น้อยและยานบินศัตรู

เกมนี้ เอา Free Source code มาจาก Unity แล้วมาทำลง Android
https://www.assetstore.unity3d.com/#/content/13866 

วิธีการเล่น
สัมผัสที่จะยิงเลเซอร์
สัมผัสเพื่อย้ายไปทางซ้าย, ขวา, ขึ้น, ลง

More Android App on Google Play.


วันพุธที่ 29 มกราคม พ.ศ. 2557

Arduino Bluetooth Servo Motor Control


Arduino Bluetooth Servo Motor Control

Arduino Bluetooth Servo Motor Control Application is allow you to control Servo Motor position.( 0 - 180 degree )
This App must connect to Arduino Board and Bluetooth Module then control Servo Motor.

The Application Features
  • Control 0 - 180 Degree of Servo Motor position with progress bar , knob and Fixed degree.( PWM Output )
  • Auto Control Function and can adjust timing to control.
  • Show Bluetooth Connection Status and Serial Data monitor. When not connect Arduino Board yet.(User Interface Disable.) When Bluetooth connected already. Then enable UI. and ready to Control.
  • Free Version with Ad.

External Hardware
  1. Arduino Board or compatible Board.
  2. Serial TTL Bluetooth Module
  3. Servo Motor ( We use FUTABA Model S3003 or other)

Wiring Diagram


Arduino Source Code ( same USB Version )
Arduino Code ( You need to program into Arduino Board. ) 

Visit Hardware page at http://microcontrollerkits.blogspot.com/2014/01/arduino-usb-control-servo-motor.html

Android App on Google Play.




App Manual.
Enable Bluetooth Setting First.
Then if you are not pairing your bluetooth module yet.
Must pairing in the bluetooth settings.

Open App. Click Connect Bluetooth Button.




When Bluetooth Connected. Show "Connected to : YOUR BLUETOOTH NAME OK"
and Change Connect Bluetooth Button to Knob.



Ready to control your Servo Motor.

  • Use Knob
  • Fixed Position Button
  • Auto Control ON/OFF

Option Menu
  • Setting  ( for future use )
  • Hardware Diagram
  • About Developer
  • Exit



More About Servo Motor Control

วันอังคารที่ 21 มกราคม พ.ศ. 2557

Arduino USB Servo Motor Control


Arduino USB Servo Motor Control

Arduino USB Servo Motor Control Application is allow you to control Servo Motor position.( 0 - 180 degree )
This App must connect to Arduino with USB-OTG then control Servo Motor.
So,your Android device must support USB-OTG.

The Application Features

  • Control 0 - 180 Degree of Servo Motor position with progress bar , knob and Fixed degree.( PWM Output )
  • Auto Control Function and can adjust timing to control.
  • Show Connection Status and Serial USB data monitor. When not connect Arduino Board yet.(User Interface Disable.) When Arduino Board connected already. Then enable UI.
  • Free Version with Ad.

External Hardware
1. Arduino Board or compatible Board.
2. USB-OTG Cable ( Female A to Micro A )
3. USB Cable ( A to B Male/Male )
4. Servo Motor ( We use FUTABA Model S3003 or other)

Arduino Source Code  Link to Hardware Pages 
Arduino Code ( You need to program into Arduino Board. )










Visit Hardware Page
http://microcontrollerkits.blogspot.com/2014/01/arduino-usb-control-servo-motor.html



Wiring Diagram
Arduino PWM output PIN 9 to white cable Servo Motor


Android App on Google Play.


App Manual.
Open App. If not connect Arduino Board yet.Show Arduino Logo and all UI disable



When Arduino Board connected already. Show all enable UI and Show data in Data monitor.
Ready to control.


Position Control by Knob or Progress Bar or Fixed Button
Sweep Position by Auto Control Button


Option Menu.  Hardware Diagram , About Developer . Exit


More About Servo Motor Control








IOIO Servo Motor Control



More About Android Control








Arduino Bluetooth Control







IOIO Control Device






IOIO RGB LEDs Control



Android Control App on Google Play


วันพุธที่ 15 มกราคม พ.ศ. 2557

IOIO Servo Motor Control




IOIO Servo Motor Control

IOIO Servo Motor Control Application is allow you to control Servo Motor position.( 0 - 180 degree )
This App must connect to IOIO Board then control Servo Motor.

IOIO Board Connection can use in 2 methods.
1. Bluetooth Connection with USB Bluetooth Dongle.
2. USB Cable Connection.



The Application Features
- Control 0 - 180 Degree of Servo Motor position with progress bar , knob and Fixed degree.( PWM Output )
- Auto Control Function and can adjust timing to control.
- Show IOIO Connection Status. When not connect IOIO Board yet.(User Interface Disable.) When IOIO Board connected already. LED on IOIO Board is turn ON and enable UI.
- Free Version with Ad.

External Hardware
1. IOIO Board or compatible Board.
2. USB Bluetooth Dongle. ( If you want Bluetooth coonection )
3. USB Cable ( if you want direct cable connection )
4. Servo Motor ( We use FUTABA Model S3003 or other)

For the IOIO Board , you don’t need program hex code or flash code in to the IOIO Board.

It has firmware for ready to use. You are only wiring the cable to the Servo Motor only.

Wiring Diagram
PIN 35 pwm Output to Servo Motor ( white cable )



Android App



App Manual

  • Open App. If not connect IOIO board yet. All UI are all disable.

  • Connected to IOIO Board already. All UI are enable. Ready to control Servo Motor.

  • Option Menu. on the buttom right corner.



  •  Wiring Diagram , About Developer  and Exit Menu


More About IOIO Control





IOIO Control Device 








IOIO Control RC Car Remote Control







IOIO Control RGB LEDs







IOIO Sensor Alert



More Android Control App