sonytabletsdk developmentguideline en

14
Sony Tablet Document Version 1.20 Date Sony Corporation 2012-2-15 Development guideline of SDK Add-on for Sony Tablet

Upload: mesut-arikan

Post on 25-Oct-2014

214 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: SonyTabletSDK DevelopmentGuideline En

Sony Tablet

Document Version

1.20 Date

Sony Corporation 2012-2-15

Development guideline of

SDK Add-on for Sony Tablet™

Page 2: SonyTabletSDK DevelopmentGuideline En

Sony Tablet

Sony Corporation

Document Version

1.20

Date

2012-2-15

2/14

Copyright 2011 Sony Corporation

Table of Contents

1 Introduction ........................................................................................................................................ 3

2 User Guide (for all OS) ...................................................................................................................... 3

2.1 Advance Preparation ................................................................................................................... 3

2.2 Supported OS version.................................................................................................................. 3

2.3 SDK Directory Structure............................................................................................................. 4

3 User Guide (for Linux) ....................................................................................................................... 4

3.1 Configuration............................................................................................................................... 4

3.2 Create AVD ................................................................................................................................. 4

3.3 Run the emulator ........................................................................................................................ 6

4 User Guide (for Windows) .................................................................................................................. 6

4.1 Configuration............................................................................................................................... 6

4.2 Create AVD ................................................................................................................................. 7

4.3 Run the emulator ........................................................................................................................ 9

5 User Guide (for Mac) .......................................................................................................................... 9

5.1 Configuration............................................................................................................................... 9

5.2 Create AVD ................................................................................................................................. 9

5.3 Run the emulator ...................................................................................................................... 11

6 How to Launch from Eclipse (for Linux) ......................................................................................... 11

6.1 Run the emulator ...................................................................................................................... 11

7 How to Launch from Eclipse (for Windows) .................................................................................... 12

7.1 Run the emulator ...................................................................................................................... 12

8 How to Launch from Eclipse (for Mac) ............................................................................................ 12

8.1 Run the emulator ...................................................................................................................... 12

9 How to Launch from Eclipse (for all OS) ......................................................................................... 13

9.1 Set Up Eclipse ........................................................................................................................... 13

9.2 Create AVD ............................................................................................................................... 13

9.3 Run the emulator ...................................................................................................................... 14

9.4 Set the build target ................................................................................................................... 14

Note .......................................................................................................................................................... 14

Page 3: SonyTabletSDK DevelopmentGuideline En

Sony Tablet

Sony Corporation

Document Version

1.20

Date

2012-2-15

3/14

Copyright 2011 Sony Corporation

1 Introduction

The purpose of this guideline is to describe how to use the SDK Add-on for Sony Tablet™

The SDK Add-on contains emulators for Sony Tablet™ S and Sony Tablet™ P.

Please use them for development.

2 User Guide (for all OS)

2.1 Advance Preparation

1. Download the Android™ SDK, depending on your Android™ platform, from the following URL.

http://developer.android.com/index.html

Uncompress it then set it to an arbitrary directory (hereinafter referred to as “sdk-setup directly”).

2. Launch “Android SDK Manager” to install a package.

Execute “android” (if you use Windows, it is “android.bat”) in “tools” folder of Android™ SDK.

If you have not installed Android™ SDK yet, please install it. “Android SDK Platform 3.2, revision 1”

is mandatory.

2.2 Supported OS version

OS Version

Windows Windows XP 32bit

Windows Vista 32bit/64bit

Windows 7 32bit/64bit

Ubuntu Linux Ubuntu 10.04 or later

Mac OS X Snow Leopard (Mac OS X 10.6)

Lion (Mac OS X 10.7)

Page 4: SonyTabletSDK DevelopmentGuideline En

Sony Tablet

Sony Corporation

Document Version

1.20

Date

2012-2-15

4/14

Copyright 2011 Sony Corporation

2.3 SDK Directory Structure

3 User Guide (for Linux)

3.1 Configuration

1. Unpack the archive ( Sony-Tablet-SDK_Add-on-eng.integ-build-all-x86.zip) and store it in add-ons

folder.

2. Add the following lines in “.bashrc” to set the environment variable.

3. Reflect the environment variable

3.2 Create AVD

1. Create AVD by AVD Manager

① Launch “Android Virtual Device Manager".

- Execute “android” by avd option in tools folder of Android™ SDK.

② Click “new”. It displays "Create new Android Virtual Device (AVD)".

③ Fill “Name” and “SD Card”.

$ source .bashrc

export PATH=$PATH:{sdk-setup-directory}/add-ons/

Sony-Tablet-SDK_Add-on-eng.integ-build-all-x86/tools

export ANDROID_SDK_ROOT={sdk-setup-directory}

Sony-Tablet-SDK_Add-on-eng.integ-build-all-x86

├ docs (Reference)

├ images (Emulator)

├ libs (Library)

├ samples(Sample application)

├ skins (Emulator skin)

├ tools (Customized emulator)

├ hardware.ini

└ manifest.ini

Page 5: SonyTabletSDK DevelopmentGuideline En

Sony Tablet

Sony Corporation

Document Version

1.20

Date

2012-2-15

5/14

Copyright 2011 Sony Corporation

④ Display the drop-down list from "Target" and select "Sony Tablet™ Add-on (Sony Corp.) - API

Level 13".

⑤ Set "Skin" as "SonyTabletP" or "SonyTabletS".

⑥ Click "Create AVD".

2. Create AVD by command line

You need to use “android” in tools folder of Android™ SDK.

① Confirm that AVD target list contains "Sony Corp.: Sony Tablet Add-on:13".

- Execute "./android list target" from command line.

Execution example of "./android list target"

$ ./android list target

==================== (snip) ===========================

id: 10 or "Sony Corp.: Sony Tablet Add-on:13"

Name: Sony Tablet Add-on

Type: Add-On

Vendor: Sony Corp.

Revision: 2

Description: Sony Tablet Device

Based on Android 3.2 (API level 13)

Libraries:

* com.sony.nfx.largescreen (com.sony.nfx.largescreen.jar)

Skins: WXGA, SonyTabletP (default), SonyTabletS

ABIs : armeabi

② Create AVD

- Execute "./android create avd" from command line.

Execution example of "./android create avd"

$ ./android create avd -n SonyTabletS -t 10 -c 512M -s SonyTabletS

Auto-selecting single ABI armeabi

Created AVD 'SonyTabletS' based on Sony Tablet Add-on (Sony Corp.), ARM (armeabi) processor,

with the following hardware config:

hw.sdCard=yes

hw.lcd.density=160

vm.heapSize=96

hw.lcd.dual=no

Page 6: SonyTabletSDK DevelopmentGuideline En

Sony Tablet

Sony Corporation

Document Version

1.20

Date

2012-2-15

6/14

Copyright 2011 Sony Corporation

hw.ramSize=512

*The value for "-t(--target)" should correspond the ID number of "Sony Corp.: Sony Tablet

Add-on:13".

*Set arbitrary values for "-n(--name)" and "-c(--sdcard)".

*Set “SonyTabletP” or “SonyTabletS” for "-s(--skin)".

③ Check the created AVD

- Execute "./android list avd" from command line.

Execute example of "./android list avd"

$ ./android list avd

Available Android Virtual Devices:

Name: SonyTabletS

Path: /home/{USERNAME}/.android/avd/SonyTabletS.avd

Target: Sony Tablet Add-on (Sony Corp.)

Based on Android 3.2 (API level 13)

ABI: armeabi

Skin: SonyTabletS

Sdcard: 512M

3.3 Run the emulator

- Execute "emulator_sony_tablet_linux" from command line.

Execute example of "emulator"

$ emulator_sony_tablet_linux @SonyTabletS

*"@(-avd)" should be the created AVD name.

*You can expand and shrink the emulator window by "-scale". The range of the setting value is

from 0.1 to 3.

4 User Guide (for Windows)

4.1 Configuration

1. Unpack the archive (Sony-Tablet-SDK_Add-on-eng.integ-build-all-x86.zip) and store it in add-ons

folder.

Page 7: SonyTabletSDK DevelopmentGuideline En

Sony Tablet

Sony Corporation

Document Version

1.20

Date

2012-2-15

7/14

Copyright 2011 Sony Corporation

2. Set the environment valuable. Add the following values from “Control Panel” “System and

Security” “System” “Advanced System Settings” “Environment Variables” (This is for

Windows7).

4.2 Create AVD

1. Create AVD by AVD Manager

① Launch “Android Virtual Device Manager".

- Execute “AVD Manager.exe” or “android.bat” by avd option in tools folder.

② Click “new”. It displays "Create new Android Virtual Device (AVD)".

③ Fill “Name” and “SD Card”.

④ Display the drop-down list from "Target" and select "Sony Tablet Add-on (Sony Corp.) - API

Level 13".

⑤ Set "Skin" as "SonyTabletP" or "SonyTabletS".

⑥ Click "Create AVD".

2. Create AVD by command line

You need to use “android.bat” in tools folder of Android™ SDK.

① Confirm that AVD target list contains "Sony Corp.: Sony Tablet Add-on:13".

- Execute "./android.bat list target" from command line.

Execute example of "android.bat list target"

>android.bat list target

Available Android targets:

==================== (snip) ===========================

id: 2 or "Sony Corp.: Sony Tablet Add-on:13"

Name: Sony Tablet Add-on

Type: Add-On

Vendor: Sony Corp

Revision: 2

Name:Path

Value:

{sdk-setup-directory}¥add-ons¥Sony-Tablet-SDK_Add-on-eng.integ-build-all-x86¥tools;

Name:ANDROID_SDK_ROOT

Value:{sdk-setup-directory}

Page 8: SonyTabletSDK DevelopmentGuideline En

Sony Tablet

Sony Corporation

Document Version

1.20

Date

2012-2-15

8/14

Copyright 2011 Sony Corporation

Description: Sony Tablet Device

Based on Android 3.2 (API level 13)

Libraries:

* com.sony.nfx.largescreen (com.sony.nfx.largescreen.jar)

Skins: WXGA, SonyTabletP (default), SonyTabletS

ABIs : armeabi

② Create AVD

- Execute "./android.bat create avd" from command line.

Execute example of "android.bat create avd"

>android.bat create avd -n SonyTabletP -t 2 -c 512M -s SonyTabletP

Auto-selecting single ABI armeabi

Created AVD 'SonyTabletP' based on Sony Tablet Add-on (Sony Corp), ARM (armeabi) processor,

with the following hardware config:

hw.sdCard=yes

hw.lcd.density=160

vm.heapSize=96

hw.lcd.dual=yes

hw.ramSize=512

*The value for "-t(--target)" should correspond the ID number of "Sony Corp: Sony Tablet

Add-on:13".

*Set arbitrary values for "-n(--name)" and "-c(--sdcard)".

*Set “SonyTabletP” or “SonyTabletS” for "-s(--skin)".

③ Check the created AVD

- Execute "./android.bat list avd" from command line.

Execute example of "android.bat list avd"

>android.bat list avd

Available Android Virtual Devices:

Name: SonyTabletP

Path: C:¥Users¥{USERNAME}¥.android¥avd¥SonyTabletP.avd

Target: Sony Tablet Add-on (Sony Corp.)

Based on Android 3.2 (API level 13)

ABI: armeabi

Skin: SonyTabletP

Sdcard: 512M

Page 9: SonyTabletSDK DevelopmentGuideline En

Sony Tablet

Sony Corporation

Document Version

1.20

Date

2012-2-15

9/14

Copyright 2011 Sony Corporation

4.3 Run the emulator

- Execute "emulator_sony_tablet_win.exe" by command prompt.

Execute example of "emulator"

>emulator_sony_tablet_win.exe @SonyTabletP

*"@(-avd)" should be the created AVD name.

*You can expand and shrink the emulator window by "-scale". The range of the setting value is

from 0.1 to 3.

5 User Guide (for Mac)

5.1 Configuration

1. Unpack the archive (Sony-Tablet-SDK_Add-on-eng.integ-build-all-x86.zip) and store it in add-ons

folder.

2. Add the following lines in “.bash_profile” to set the environment variable.

5.2 Create AVD

1. Create AVD by AVD Manager

① Launch "Android Virtual Device Manager".

- Execute “android” by avd option in tools folder of Android™ SDK.

② Click “new”. It displays "Create new Android Virtual Device (AVD)".

③ Fill “Name” and “SD Card”.

④ Display the drop-down list from "Target" and select "Sony Tablet Add-on (Sony Corp.) - API

Level 13".

⑤ Set "Skin" as "SonyTabletP" or "SonyTabletS".

⑥ Click "Create AVD".

2. Create AVD by terminal

You need to use “android” in tools folder of Android™ SDK.

export

PATH=$PATH:{sdk-setup-directory}/add-ons/Sony-Tablet-SDK_Add-on-eng.integ-build-all-x

86/tools

export ANDROID_SDK_ROOT={sdk-setup-directory}

Page 10: SonyTabletSDK DevelopmentGuideline En

Sony Tablet

Sony Corporation

Document Version

1.20

Date

2012-2-15

10/14

Copyright 2011 Sony Corporation

① Confirm that AVD target list contains "Sony Corp.: Sony Tablet Add-on:13".

- Execute "./android list target" from terminal.

Execute example of "./android list target"

$ ./android list target

==================== (snip) ===========================

id: 2 or "Sony Corp: Sony Tablet Add-on:13"

Name: Sony Tablet Add-on

Type: Add-On

Vendor: Sony Corp

Revision: 2

Description: Sony Tablet Device

Based on Android 3.2 (API level 13)

Libraries:

* com.sony.nfx.largescreen (com.sony.nfx.largescreen.jar)

Skins: WXGA, SonyTabletP (default), SonyTabletS

ABIs : armeabi

② Create AVD

- Execute "./android create avd" from terminal.

Execute example of "android.bat create avd"

Execute example of “./android create avd”

$ ./android create avd -n SonyTabletP -t 2 -c 512M -s SonyTabletP

Auto-selecting single ABI armeabi

Created AVD 'SonyTabletP' based on Sony Tablet Add-on (Sony Corp), ARM (armeabi) processor,

with the following hardware config:

hw.sdCard=yes

hw.lcd.density=160

vm.heapSize=96

hw.lcd.dual=yes

hw.ramSize=512

*The value for "-t(--target)" should correspond the ID number of "Sony Corp: Sony Tablet

Add-on:13".

*Set arbitrary values for "-n(--name)" and "-c(--sdcard)".

*Set “SonyTabletP” or “SonyTabletS” for "-s(--skin)".

Page 11: SonyTabletSDK DevelopmentGuideline En

Sony Tablet

Sony Corporation

Document Version

1.20

Date

2012-2-15

11/14

Copyright 2011 Sony Corporation

③ Check the created AVD

- Execute "./android list avd" from terminal.

Execute example of "./android list avd"

$ ./android list avd

Available Android Virtual Devices:

Name: SonyTabletP

Path: /Users/{USERNAME}/.android/avd/SonyTabletP.avd

Target: Sony Tablet Add-on (Sony Corp)

Based on Android 3.2 (API level 13)

ABI: armeabi

Skin: SonyTabletP

Sdcard: 512M

5.3 Run the emulator

- Execute "emulator_sony_tablet_mac" from terminal.

Execute example of "emulator_sony_tablet_mac"

$ emulator_sony_tablet_mac @SonyTabletP

*"@(-avd)" should be the created AVD name.

*You can expand and shrink the emulator window by "-scale". The range of the setting value is

from 0.1 to 3.

6 How to Launch from Eclipse (for Linux)

Change the custom emulator’s file name depending on your Android™ platform then replace the emulator

in “tools” folder of Android™ SDK with it.

The following 6.1 is an example to replace the emulator by command line.

6.1 Run the emulator

1. Move “emulator” in “tools” folder of Android™ SDK.

- Emulator name is "emulator_def" in the following example.

2. Copy the custom emulator "emulator_sony_tablet_linux" to “tools” folder of Android™ SDK.

$ mv {sdk-setup-directory}/tools/emulator {sdk-setup-directory}/tools/emulator_def

Page 12: SonyTabletSDK DevelopmentGuideline En

Sony Tablet

Sony Corporation

Document Version

1.20

Date

2012-2-15

12/14

Copyright 2011 Sony Corporation

- Change the filename to “emulator” before copy the file.

7 How to Launch from Eclipse (for Windows)

Change the custom emulator’s file name depending on your Android™ platform then replace the emulator

in “tools” folder of Android™ SDK with it.

The following 7.1 is an example to replace the emulator by explorer.

7.1 Run the emulator

1. Move “emulator.exe” in “tools” folder of Android™ SDK.

2. Copy the custom emulator "emulator_sony_tablet_win.exe" to “tools” folder of Android™ SDK.

3. Change the custom emulator name to "emulator.exe".

8 How to Launch from Eclipse (for Mac)

Change the custom emulator’s file name depending on your Android™ platform then replace the emulator

in “tools” folder of Android™ SDK with it.

The following 8.1 is an example to replace the emulator by terminal.

8.1 Run the emulator

1. Move “emulator” in “tools” folder of Android™ SDK.

- Emulator name is "emulator_def" in the following example.

2. Copy the custom emulator "emulator_sony_tablet_mac" to “tools” folder of Android™ SDK.

- Change the filename to “emulator” before copy the file.

$ mv {sdk-setup-directory}/tools/emulator {sdk-setup-directory}/tools/emulator_def

$ cp

{sdk-setup-directory}/add-ons/Sony-Tablet-SDK_Add-on-eng.integ-build-all-x86/tools/emulator

_sony_tablet_linux {sdk-setup-directory}/tools/emulator

Page 13: SonyTabletSDK DevelopmentGuideline En

Sony Tablet

Sony Corporation

Document Version

1.20

Date

2012-2-15

13/14

Copyright 2011 Sony Corporation

9 How to Launch from Eclipse (for all OS)

9.1 Set Up Eclipse

1. From Eclipse menu, select “Help” “Install New Software” to display “install” dialogue.

2. Install “Developer Tools” from “https://dl-ssl.google.com/android/eclipse/”.

3. Restart Eclipse.

4. From Eclipse menu, select “Window” “Settings” and display “Settings” dialog.

5. Select “Android” in “Settings” dialogue then change “SDK location” to the path for the target SDK.

9.2 Create AVD

1. Launch “AVD Manager” from “Window” “Android Virtual Device Manager”.

2. Click “new”. It displays "Create new Android Virtual Device (AVD)".

3. Fill “Name” and “SD Card”.

4. Display the drop-down list from "Target" and select "Sony Tablet Add-on (Sony Corp.) - API Level

13".

5. Set "Skin" as "SonyTabletP" or "SonyTabletS".

6. Click “Create AVD”.

$ cp

{sdk-setup-directory}/add-ons/Sony-Tablet-SDK_Add-on-eng.integ-build-all-x86/tools/emulator

_sony_tablet_mac {sdk-setup-directory}/tools/emulator

Page 14: SonyTabletSDK DevelopmentGuideline En

Sony Tablet

Sony Corporation

Document Version

1.20

Date

2012-2-15

14/14

Copyright 2011 Sony Corporation

9.3 Run the emulator

1. Launch “AVD Manager” from “Window” “Android Virtual Device Manager”.

2. Select the created AVD from the AVD list then click “Start” to display “Launch Options” dialogue.

- You can expand and shrink the emulator window by “Scale display to real size”.

3. The emulator is launched when you click “Launch”.

9.4 Set the build target

Set “Sony Tablet Add-on” as the build target when you develop an application by Sony

Tablet_SDK_Add-on. The following is an example of how to select the build target.

1. Select “File” “New” “Android Project” from the Eclipse window project to display “New

Android Project” dialog.

2. Specify an arbitrary project or location then click “Next”.

3. Specify “Sony Tablet Add-on” and click “Next”.

Designate an arbitrary application information then click “Finish”.

Note

Sony Tablet is a trademark of Sony Corp..

Android is trademarks of Google Inc.