Home

NSD Smart Display User's Manual and Software Developer's Guide

image

Contents

1. Done loading packages Android SDK Linux 4 Android SDK Manager Packages Tools E ju Android 4 0 API 14 Documentation for Andros SOK amp Not mstalled SDK Phorm Not installed QS Samples for SDK amp Avt unstated ARM EAB v7a System Image amp Pot instalfed Bp Google APIs bv Google Inc Not mstalled Sources for Android SDK amp Notsnstalled amp El Android 3 2 API 13 Hi JE Android 3 1 API 12 El Android 3 0 APT 11 E E Android 2 3 3 API 10 EE Android 2 2 API 8 Hj El Android 2 1 API 7 ww Show Updates New Installed Obsolete Select New or Updates Install 9 packages Sort by API level Repository Deselect A Delete 1 package 9 OO AA LIPA UI OL LLOCO LI LL L L AODCGQOOAL LZDOeODOeAA LO Done loading packages B E Android SDK Windows Figure 2 11 different Android SDK Manager in different operating system Page 13 2000 2012 Copyright IC Nexus Corporation All rights reserved Step 3 You could update the environment variables to make tool access easier by adding the location of the SDK s tools and platform tools to your path Linux After the Android SDK has installed users can create a variable in the bashrc file in their home directory For example export PATH SPATH android sdk platform tools android sdk tools Windows Right click My Computer gt click Properties gt Click on the Advanced tab gt Click Environ
2. IM 0x00 0x00 0x01 Ium OxDD 0x89 OxBB Data bytes button id clicked by user Its value is between 1 to 255 3 send button up command for specified button id to smart display Page 123 2000 2012 Copyright IC Nexus Corporation All rights reserved when button s status needs to be changed in this case the button id is 6 Start Byte Command Bytes Data Bytes End Bytes IN 0x00 0x00 0x02 EN OxDD 0x89 OxBB User Graphical Drawing Ul Command Bytes End Bytes I 0x00 0x01 0x01 OxDD 0x89 OxBB User Digital Signage Start Byte Command Bytes Data Bytes End Bytes End Bytes I 0x01 0x02 0x01 OxDD 0x89 OxBB li For ICN Demo 1 ICN Elevator System Demo B Just set SP byte to OxOD Start Byte Command Byte Data Bytes End Bytes Iu OxDO 0x00 0x01 I OxDD 0x89 OxBB Use Sansus Font blue background image and blue text Page 124 2000 2012 Copyright IC Nexus Corporation All rights reserved BN P d 181 ud ICNexus Image Button Use Acens Font background image and blue text 2 ICN Graphical Drawing Ul Demo EndBytes Iu OxDO 0x01 0x01 BINE OxDD 0x89 OxBB Page 125 2000 2012 Copyright IC Nexus Corporation All rights reserved Page 126 2000 2012 Copyright IC Nexus Corporation All rights reserved 3 Drag and Drop UI Demo Start Byte Command Byte Data Bytes End Bytes Iu OxDO 0x02 0x01 BINE OxDD 0x89 OxBB Page 127 2
3. Now remove your NSD and refer to the getting started software for how the board can be connected to the LCD screen and your computer with the connectors Installing the USB Driver After connecting your NSD to your computer the first time follow the Welcome to the hardware update wizard to install and download the driver for Android Composite ADB Interface Page 31 2000 2012 Copyright IC Nexus Corporation All rights reserved EN Make sure Installation from a list or specific location Advanced is checked and Click Next 2 Choose Search for the best driver in these locations and check Include this location in the search 3 Type or browse the path that is equivalent to Android android sdk extras google usb_driver after you specify the exact CD ROM Drive file where you have your Android installation package located 4 Click Next to install the driver 5 Restart your computer for the installation to take effect How to Use ADB From here you can easily use adb to communicate with your device in any way you would like To ensure if the adb has been set up properly on your computer 1 Run command prompt 2 Change the current working directory to the path where you put db executable file on olatform tools directory This should look something like C Program Files Android android sdk platform tools 3 Type adb devices and hit enter E Program Files findroid android sdk platform tools adh de
4. daemon started successfully List of devices attached HH601166021 748 486049 device E Documents and Settings alice lin gt Page 21 2000 2012 Copyright IC Nexus Corporation All rights reserved For Linux users in Ubuntu 10 04 Lucid Lynx 1 Connect the mini usb cable to your PC Now turn on the NSD power opt armv6 codesourcery bin opt toolchain mipsel linux bin opt eclipse usr local sbin usr local bin usr sbin usr bin sbin bin usr games home mark aqq ndroid sdk Linux x86 platform tools home mark android sdk linux x86 tools mark mark ubuntul lsusb Bus 005 Device 001 ID 1d6b 006061 Linux Founda it hub Bus 664 Device 001 ID 1d6b 6601 Linux Founda 1 1 root hub Bus 803 Device 883 ID 846d c816 Logitech Inc M UV69a HP M UV96 Optical Wheel Mouse Bus 003 Devi 801 ID ld6b 0801 Linux Foundation 1 1 root hub us 002 Device 801 ID ld6b 8081 Linux Foundation 1 1 root hub 5 661 Device 819 ID 18d1 deed 5 6861 Device 663 ID 1307 0361 Transcend deir Inc 5 001 Device 801 ID ld6b 8802 Linux Foundation 2 8 root hub mark mark ubuntule Jj Page 22 2000 2012 Copyright IC Nexus Corporation All rights reserved 3 You can see the new USB device with an ID 18d1 deed Open the file name 50 android rules If the file does not exist just follow the step below Let s create a new one cd etc udev rules d sudo gedit 50 android rules Add the SUBSYSTEM usb SYSFS idVendor 18d1
5. Log v UserImageButton buttonDownCallback public void buttonUpCallback I Log v UserImageButton buttonUpCallback exit Page 100 2000 2012 Copyright IC Nexus Corporation All rights reserved public void exit this finish Called when the activity is first created Override public void onCreate Bundle savedInstanceState super onCreate savedInstanceState rlv new RelativeLayout this int length mCharts length mMenuText new String length 2 mMenuSummary new String length 2 mMenuText 0 Embedded chart demo mMenuSummary 0 A demo on how to include a chart into a graphical activity for int i 0 i lt length i mMenuText i 1 mCharts i getName mMenuSummary i 1 mCharts i getDesc Hj mMenuText length 1 Random values charts mMenuSummary length 1 Chart demos using randomly generated values info update for int i 0 i lt XAxieNumber itt XAxie addElement double i for int j 0 j YAxieNumber J YAxie addElement Math random 10 ocChartview mCharts 0 change this cinfolist Axe Tue cChartView mCharts change this cinfolist XAxie YAxie mlp new LayoutParams 500 350 min sotMargrneq250 150 9 0 cChartView setLayoutParams mlp HUNT ERR bh ibi new IBInfo 800 400 120 100 R drawable blue blank Color RED ICNImageBut
6. g Android 2 3 3 Class m Library Projects amp Interface m Referenced Libraries iS Java Project src 3 Java Project from Existing Ant Buildfile B icnexus smartdisplay Plug in Project ICNCOMPortServiceMgr java General 7 ICNNetworkServiceMgr java amp Android jJ SampleChart java Qi Android Icon Set SampleDigitalSignage java JJ SampleMediaPlayer java JJ SampleUserDragAndDropActivity java JJ SampleUserDraw java JJ SampleUserElevatorjava m w Page 52 2000 2012 Copyright IC Nexus Corporation All rights reserved Select a wizard Wizards itype filt rtexi w meate 3 Java Project Java Project from Existing Ant Buildfile ye Plug in Project General Android Click the right triangle to the left of the New button to bring up a list of resource items to select Android P me Android XML File Unit fest Case roject ors Source pt 20 L mark workspace ICNService bin ome mark workspace ICNImageButton bin ark workspace ICNDraw bin me mark workspace ICNChartDemo bin ark workspace ICNClock bin ome mark workspace ICNMediaPlayer bin ark workspace ICNTicker bin amp vs IT ip A rZ Je v Go to File at the menu bar gt Choose New or Press Shift Alt N gt Select Android Project Page 53 2000 2012 Copyright IC Nexus Corporation All rights reserv
7. MODE 0666 into the file 50 android rules X 5t android rules SUBSYSTEM usb SYSFS idVendor 18d1 MODE 0666 3 nad Save this and then exit 4 Restart the Service Please Type the following commands sudo chmod a rx etc udev rules d 50 android rules sudo etc init d udev restart cd Android SDK Install location android linux sdk platform tools sudo adb kill server 5 Check sudo adb devices At this point you can use adb devices to check if your advice is attached to your PC successfully opt armv6 codesourcery bin opt toolchain mips LocaLl sbin usr local bin usr sbin usr bin sl ndroid sdk linux x86 platform tools home mark ar mark mark ubuntul8 adb devices List of devices attached G8E800111108144122760084 device mark mark ubuntuld J Page 23 2000 2012 Copyright IC Nexus Corporation All rights reserved Android Debug Bridge Found in the Android SDK the Android Debug Bridge ADB is a powerful command line utility intended for developers to manage either an emulator instance or connected Android powered device It is a client server program which consists of three components a client a daemon and a server The ADB server takes care of all the communication needed between the client running on the development machine and a daemon running on either an emulator or a target device This allows developers to move files from their local machines to the Android devices
8. NSD Smart Display User s Manual and Software Developer s Guide IGeuse 2000 2012 Copyright IC Nexus Corporation All rights reserved Page 1 RELEASE NOTES Disclaimer This documentation is provided for use with IC Nexus products No license to IC Nexus property right is granted IC Nexus assumes no liability provides no warranty either expressed or implied relating to the usage or intellectual property right infringement that may result from its use IC Nexus provides this document as is without warranty of any kind either expressed or implied including but not limited to its particular purpose IC Nexus may make changes to this document without notice Page 2 2000 2012 Copyright IC Nexus Corporation All rights reserved Table of Contents Chapter T n roro d e WOM RR RE 4 Chapter 2 Development Environment Setup ccccccccccecssssesssseeeeeeeeeeeeeesseeeeesseseeeeeeeeeeeeessaeeaaas 5 Eclipse Download and Installation Instructions ccccccecssseeeeeeeeeeeeeeeeeeeeceeeeeseeeeeeessaseeeeeeeeeaas 5 Android SDK Starter Package cccccccsssessccceeceeeseseeeeeeeseseuseeeeeeeesseesceceeeesseeeeseeeeeesssaaseeeeeees 12 MOE B 0 0 PE 4 24 Android Development TOOIKIt ccccsccccssssecccesececeeseeecceueeecesaseeeseueeesesaueeessageeessegeeessgeesseaaes 26 GE seo le AMON EEE EE Eir 30 Chapter 3 Guide to Build a Sample Application on NSD i serrrrrnnnnrrrvennrnnnnnnnnrnnnr
9. MediaController setPrevNextListeners new View OnClickListener Override eie dk o orke Ome line eee hs canis on new View OnClickListener Override 92900 die VOC Om ONE Ere eu ADOS sae ie weenie IM It is recommended to call the onDestry method to stop the process so that the service is effectively terminated Override proLeeted vold er fa Above is the basic information you need to know to start the development of SimpleMediaPlayer For further information please visit the source code 3 2 Video size and position To specify the position of the video use RelativeLayout Call the method inside the VideoView class to modify the video size Page 105 2000 2012 Copyright IC Nexus Corporation All rights reserved import android widget RelativeLayout Declare a layout container and its stored location in the VideoView class private RelativeLayout riv RelativeLayout LayoutParams veils eae ko EG Create an object Set the image size as WRAP_CONTENT for now You may change its name later rlv new RelativeLayout this rlt new RelativeLayout LayoutParams RelativeLayout LayoutParams WRAP CONTENT RelativeLayout LayoutParams WRAP CONTENT Set the position of the media player setMargins int left int top int bottom int right is to set the margins in pixels pulse qer Te us cum ss C ees Remember to store the rlt values in the VideoView object mVideoView setLayoutParams rlt There are four video d
10. QA gen Generated Java File le rett E bin mr e nes telse r rt rien i f mew Fil amp i mnt sdcard DCIM str e 4 o m EN aah it 488 Sed Orage Seve aS 288 ar t Gr TArt Package Explorer i amp t gvr o B lt s ae E ApiDemos gt 139 ICNCharttDemo ter t 2 ICNCIock debugger 19 ICNCmdEmulator debugger ci YNDraeAndiDroo j 2011 12 19 15 57 debugger ONE 2011 12 19 15 57 debugger y KNDAW 2011 12 19 15 57 debugger oe CNE Be fant 49 tm 47 40 85 MhAuAAMPPAA Arrar GLATTA Teeth lan Vaaene Tes ehh AST E Ph danis l nii mnt Feo D ICNFiteBrowse gt ICNImagegutton i o d ur SampieChart java i Sampleuser levater java Aj SampieMediaPtayer java 12 i VideoView java n 2 KNMain t m Android 2 3 3 gt KNMan jvc jBicnexus vnart splay gt O SamplemedaPlayer stringarivalCallback char int void m Library Projects i amp ionservice jar Remote Control def s indraw ar public void dataArrivalCallback byte userdata int datasize I G tonchartdemo jar Log v SampleUsertlevator dataArrivalCallback Integer toString datasize Sienciock jar for int i G 1 lt datasize i Log v SampleUserFlevator dataArrivalCaliback User Datas String format wx userdata 1 a inmedaplayer rar 2 uonocker jar A lendr obnddren jM a public void stringArrivalCaliback char userdata int datasize I oe ae Te String str mew Stringluserdata t
11. based on the commands sent The table below lists the command line options which can be used to instruct ADB how to execute a specific task List of ADB command line options adb push lt local gt lt remote gt adb pull lt remote gt lt local gt adb sync lt directory gt adb shell adb push lt local gt lt remote gt adb shell lt command gt adb emu lt command gt adb logcat lt filter spec gt adb forward local remote Copy file dir to device Copy file dir from device Copy host gt device only if changed 1 means list but don t copy Run remote shell interactively Copy file dir to device Run remote shell command Run emulator console command View device log Forward socket connections Forward specs are one of the following tcp port localabstract unix domain socket name localreserved unix domain socket name localfilesystem unix domain socket name dev character device name jdwp process pid remote only Page 24 2000 2012 Copyright IC Nexus Corporation All rights reserved adb jdwp adb install 1 r s file adb uninstall k package adb bugreport adb help adb version List PIDs of processes hosting a JDWP transport Push this package file to the device and install it 1 means forward lock the app r means reinstall the app keeping its data s means install on SD card instead of internal storage Remove this app pac
12. 2 In the landroid sdk windowslextras google usb driver folder you can find the content like the one below uamuuuumuanuuuauuauu Sand roid winusb mf Bl android winusb rar Cyl android winusbB6 cat EM androidwinusbabd cat Ej source properties Note You must replace the android winusb inf with the NSD android winusb inf Page 16 2000 2012 Copyright IC Nexus Corporation All rights reserved 3 Connecting the mini usb cable to your PC Now you can turn on the NSD power 4 Please follow the steps below to download the Android ADB Interface The Found New Hardware Wizard will be displayed and will prompt you to install software for the Android ADB Interface Choose No not this time Click Next to continue Found New Hardware Wizard Welcome to the Found New Hardware Wizard Windows will search for current and updated software by looking on your computer on the hardware installation CD or on the Windows Update Web site with your permission Read our privacy policy Can Windows connect to Windows Update to search for software CO Yes this time only nf Y es now and Bum time connect a device Click Next to continue Select Install from a list or specific location Advanced gt Click Next to continue Page 17 2000 2012 Copyright IC Nexus Corporation All rights reserved Found New Hardware Wizard This wizard helps vou install software for TECS8900 0 If your
13. Browse Working sets Add project to working sets WOKING Sets Select i nn aiiis ad f After following the previous instructions above press Next to select Android 2 3 3 as your Build Target Please check only one SDK version for setup at a time Never choose more than one version Click Next Select Build Target Choose an SDK to target Build Target latge aire PENGOI FIAU Google APIs Google Inc 2 2 8 DTS Add On KYOCERA Corporation 22 8 Real3D Add On LGE Lidl 8 GALAXY Tab Addon Samsung Electronics Co Ltd 2 2 8 Android 2 3 1 Android Open Source Project 2 3 1 9 Google APIs Google Inc 2 31 9 amp Android 2 3 3 Android Open Source Project 2 3 3 10 Google APIs Google Inc 2 3 3 10 DTS Add On KYOCERA Corporation 2 3 3 10 EDK 1 1 Sony Ericsson Mobile Communication 2 3 3 10 Android 3 0 Android Open Source Project 3 0 11 Gonnle APIs 30nale Inc 20 11 5 ee OO o LAE mm Pas SSS oS Q Bak Next gt Cane Finish Page 55 2000 2012 Copyright IC Nexus Corporation All rights reserved g Next enter your application information to finish the configuration Input icnexus smartdisplay next to the Package Name field and set the minimum SDK to 10 Click Finish At this point a warning message may appear indicating that you have not yet complied the Java files Java Archive jar into the platform Page 56 2000 2012 Copyright IC Nexus Corporation All r
14. Bundle savedInstanceState super onCreate savedInstanceState setContentView R layout draganddrop new RelativeLayout this SetContentView rlv rly dragPictureAndDropToTrash userDragAndDrop Page 82 2000 2012 Copyright IC Nexus Corporation All rights reserved init ICNService ICN COMMAND ID ICN DRAG AND DROP DEMO rlv Log v SampleUserDragAndDropActivity onCreate pindService bindService try Waiting Service is started Thread sleep S000 catch Exception e e printStackTrace String className new String icnexus smartdisplay SampleUserDragAndDropActivity sendUserData className userdata 8 return Override protected void onDestroy TODO Auto generated method stub unbindService Log v SampleUserDragAndDropActivity onDestroy unbindService done super onDestroy public void exit thils finish public void dragPictureAndDropToTrash I ICNDragSurface dragSurface new ICNDragSurface this dragSurface setLayoutParams new LayoutParams LayoutParams FILL PARENT LayoutParams FILL PARENT ICNDragAndDropManager getInstance init dragSurface ImageView trashV new ImageView this trashV setBackgroundResource R drawable empty trash LayoutParams lpv new LayoutParams 128 200 lpv setMargins 100 300 0 0 trashV setLayoutParams lpv ICNDropZone dropzonel new ICNDropZone trashV dropzoneListener I
15. DUE Task Tags XML Code Fo Migrate JAR File Te TIC i NN c Press Add External JARs if you only want to import an external jar file You do not have to load the complete project into Eclipse Instead you select a JAR file using the file browser Page 58 2000 2012 Copyright IC Nexus Corporation All rights reserved type filter t 4 Java Build Path Resource gt JAR Selection s tab mark workspace ICNService bin a 5 a ne Bo RBS m icnexus 20114128078 fi mark ii res 2011512H07H Bsn ii icnservice jar 68 8 KB PEAY 15 40 Lisexas EE xe E E ui BA j BHA gj F tcc8900p i worklog li NXC2620 ia mirrowin a zone j Faria IR v Adding JAR files from an open project This subsection will describe what steps you should take to develop your own or modify classes This section will divide into two parts e Reference external files In library project e Attaching a library from an external project As of December 2011 the new version of Eclipse 3 7 1 has provided more simplicity and efficiency to its setup procedures implementing all the functionality into the properties of the project Page 59 2000 2012 Copyright IC Nexus Corporation All rights reserved Please follow the steps below to enter the setup menu a Choose the project name that you would like to set in the Package Explorer view and
16. IDemoChart change Context context ChartInfo ci Vector lt Double gt XAxie Vector lt Double gt YAxie Add parameter Context Chartinfo and the information of x axis and the y axis Page 103 2000 2012 Copyright IC Nexus Corporation All rights reserved MediaPlayer API 1 Introduction This section illustrates how the SampleMediaPlayer works with a simple guide to demonstrate the development of MediaPlayer 2 Building an architecture for the system This section will divide into two parts In the first part you will be introduced to a number of ICNMediaPlayer s playback related settings that adjusts the video size and display resolution In the second part you will learn to start SampleMediaPlayer on specified time and specify the position of the media player 3 Basic function Section 3 gives the description of SampleMediaPlayer 3 1 Execution package dodge qbus nere INT OO icnexus smartdisplay mediaplayer VideoView ne oe and ro ANC el OO eee ALTE SONE andr OE OS t umole LOO ee sli Cua Oaleleabhe a IN Lene To control and use a certain media data type EMO OO android media MediaPlayer ALi ONE android media MediaPlayer OnCompletionListener TET ma android widget MediaController Ree Gel android widget MediaController MediaPlayerControl Use the code below if you would like to connect to the Serial Port or Com Port to enable remote control import icnexus smartdisplay service ICNService First of all yo
17. MEM UNIT fromValue int value for ICN MEM UNIT my ICN MEM UNIT values if my value value return my return null int value return value public String toString Switch fromValue value case ICN MEM KB return new String KB Page 110 2000 2012 Copyright IC Nexus Corporation All rights reserved case ICN MEM MB return new String MB case ICN MEM GB return new String GB case ICN MEM TB return new String TB default return new String Override public void onCreate Bundle savedInstanceState super onCreate savedInstanceState rlv main new RelativeLayout this get screen size dm new DisplayMetrics getWindowManager getDefaultDisplay getMetrics dm Screen width dm widthPixels Screen height dm heightPixels LIGHT WIDTH screen width 6 LIGHT HEIGHT screen height 50 LIGHT DISTANCE Y LIGHT HEIGHT 3 2 LIGHT DISTANCE X LIGHT WIDTH 5 USAGE TEXT SCOPE WIDTH LIGHT WIDTH 2 5 USAGE TEXT SCOPE HEIGHT screen height 7 USAGE TITLE SCOPE HEIGHT screen height 60 480 Log v SampleChart Screen Info dm widthPixels dm heightPixels 0 9 10 createCPUUsageGUI rlv main screen width 9 1 createMemoryUsageGUI rlv main screen width 5 updateCPUUsage int readCPUUsage updateMemoryUsage int readMEMUsage updateUsedMemorySize Mem Used ICN MEM UNIT ICN M
18. Port Service button to activate the Com Port Service Please note that you must establish this service activation before you are allowed to run the commands to send and receive requests over the network If you would to recall the screen image in figure 5 5 please select Com Port Service Controller icon from the Menu X XX ey A u PNIS i b KAY e KES 2d v T og uM Sample File Network Se 9 j unt ba Sample Eley Sample Digi Sample Cha DA 9 Sample Use Sample Mec Figure 5 6 After the Com Port Service is activated you will see an icon imitating the COM Port Service Controller button at the upper left corner Page 68 2000 2012 Copyright IC Nexus Corporation All rights reserved ye X COM Port S Network Se Sample Digi 3 l D Sample Ele Sample Cha A m era 6 Z p n M Wallpaper Search Notifications Preferences Settings Figure 5 7 Start COM Port Service Stop COM Port Service Figure 5 8 If you would like to stop the Com port Service please press the Stop COM Port Service button Page 69 2000 2012 Copyright IC Nexus Corporation All rights reserved Serial port terminal software installation 1 Run NSD PC120303 exe in PC NSD PC120303 Configuration Digital Signate Signate Fie Browser Media Player Geusetm Drag and Drop chat Bes 2 Open the
19. S sudo apt get install sun java6 jre sun java6 bin sun java6 jdk Seeing that this program only supports 32 bit operating system or a single core processor for all 64 bit system users most dual core processors work on 64 bit operating system please download the following package to ensure successful execution S sudo apt get install ia32 libs Running Eclipse When you run Eclipse the first time you will get a dialog box like the one shown in the figure below prompting you to choose a workspace location for storing your project files Click OK after you have selected your preferred workspace location to store your projects Now sit back and wait for the loading process to complete If you do not wish to be asked each time the program starts you can check the box next to Use This As The Default And Do Not Ask Again and click OK Figure 2 2 Select a workspace Eclipse SDK stores your projects in a folder called a workspace Choose a workspace folder to use for this session Workspace home USERNAME workspace pse INDIGO M20110909 1335 Use this as the default and do not ask again Loading rg eclipse jdt ui tributors and other c Copyright Eclipse con is a trademark of the Ecli Figure 2 2 The workspace launcher dialog box and Eclipse loading box Eclipse Setup for Android Development Please refer to the tips at the end of this section for common installation issues Open Eclips
20. Send User Data Hex 010203040506070 910111213141516 Send User Text UTF 8 B NSD Demo Message from Smart Display NSD Command Definition 1 UART default Parameters The default parameters of UART are Baudrate 115200 bps Band Rate Stop Bits 1 aic Li ER Off Handshake None 2 Command Bytes Start byte 1 byte Command byte 3byte First byte is for special function SP Second byte is for command category CA Third byte is for main command MA Data byte 1byte End Bytes 3byte Page 120 2000 2012 Copyright IC Nexus Corporation All rights reserved 3 Command List User Elevator System OxDD 0x89 OxBB 1 send command to smart display to OxFA 0x00 0x00 0x01 0x00 launch application 2 receive data from smart display e g 0xFB 0x00 0x00 0x01 0x06 OxDD 0x89 OxBB when user pushes button down 6 3 send button up command for specified OxFA 0x00 0x00 0x02 0x06 OxDD 0x89 OxBB button after user arrives sixth floor User Graphical Drawing Ul OxFA oxo0 0x01 0x01 0x00 0xDD 0x89 OxBB User Digital Signage 0x00 0x02 0x01 ox0 oxbD 0x89 OxBB Send User Data Bytes To Smart Display OxFA 0x01 OxFF 0x00 Ox10 16 bytes OxDD 0x89 OxBB Data Stream 16 bytes Data Stream 32 bytes 0x01 OxFF 0x00 0x20 32 bytes OxDD 0x89 OxBB Data Stream 256 bytes 0x01 OxFF 0x01 0x00 256 bytes OxDD 0x89 OxBB Send User Data Bytes Out Smart Display 16
21. device manager tab page from Start up Set gt Control center gt System 3 Browse through the device list and locate the COM and LPT item 4 Select the com port that you want to connect the NSD device For example 5 Configure the com port into 115200 Bits Sec 8 Bits Data No Parity check 1 Stop Bit No Flow control 6 Click Configuration button from the dialog NSD PC120303 exe Page 70 2000 2012 Copyright IC Nexus Corporation All rights reserved P NSD PC120303 el Open COM COM PORT NO DL 14 7 Select the com port that you have configured in step 5 then click the Open COM button SUB NSD PC120303 Open COM i DL 14 Page 71 2000 2012 Copyright IC Nexus Corporation All rights reserved SUB NSD PC120303 Open COM COM PORT NO D1 14 WSD PC1203D3 Configuration Digital Signate Fie Browser Media Player GetisetD Drag and Drop chat j elevator P i Open COM COM PORT NO D1 14 Page 72 2000 2012 Copyright IC Nexus Corporation All rights reserved Appendix A NSD Software SDK API Elevator The ICNElevator Java class is a simple elevator activity in the Android application It puts you to a role of manager so that you can manage the ICNImageButton class you create You can extend your code from the ICNElevator Java class and then rewrite your code using the InitUserButtonSampleCode function which can be foun
22. final int STREAM VIDEO 2 private static final int PLAYLIST VIDEO 3 private static final int PLAYLIST VIDEO RANDOM 4 private int list index 1 private int list num 0 video width amp height private int vWidth 0 private int vHeight 0 private void TickerSetting int textColor Color RED backgroundColor Color TRANSPARENT textSize 110 int backgroundWidth 800 backgroundHeight 150 int x 0 y 0 int ani_begin_x 1000 ani_end_x 240 ani_begin_y 580 ani end y 580 int ani duration 20000 ani repeat time 1 String textData Smart Display tinfolist new TickerInfo textColor backgroundColor textSize backgroundWidth backgroundHeight X Y ani begin x ani end x ani begin y ani end y ani duration ani repeat time textData private void TickerDataSetting String text mTicker TextSetting text private void ClockSetting Page 89 2000 2012 Copyright IC Nexus Corporation All rights reserved int window x 0 window y 615 window width 240 window height 75 int size 50 textColor Color GREEN backgroundColor Color DKGRAY Typeface tf Typeface MONOSPACE cinfolist new ClockInfo window x window y window width window height Size textColor backgroundColor tf private void ImagePlayerSetting imagePlayer addImage R drawable pl imagePlayer addImage R drawable p2 imagePlayer addImage R drawable p3
23. for Chart 1 xMin The minimum Charts x axis value 2 XMax The maximum Chart s x axis value 3 YMin The minimum Chart s y axis value 4 YMax The maximum Chart s y axis value 5 ColorAxes Chart s axes color 6 ColorLabel Chart s label color 7 ColorChart Chart s line color 8 ColorBackgground Chart s background color 9 XRangeNum The number of Chart s x axis intervals 10 YRangeNum The number of Chart s y axis intervals 11 ChartSmoothness Chart s line smoothness 12 ShowGrid The Boolean value to specify whether to display or hide gridlines in Chart 13 BackgroundColorApply The Boolean value to specify whether the background color is applied to Chart A false means transparent background and a true will change the ColorBackgground to the background color 14 ZoomButtonsVisible The Boolean value to specify whether the zoom interface is displayed 15 ShowLegend The Boolean value to specify whether Chart s text description at the bottom left corner is displayed 16 ShowAxes The Boolean value to specify whether Chart s axes are displayed 17 ShowLabels The Boolean value to specify whether the label names of Chart s axes are displayed 18 ChartTitle The Boolean value to specify whether Chart s title name is displayed 19 XName The name of Chart s x axis 20 YName The name of Chart s y axis 21 ChartExplain Chart s text description at the bottom left corner 2
24. gt Click the android bat file to run the Android SDK Manager For Linux users please use Script file name android You may use the Android SDK Manager to get the updates of the existing installed SDK packages Figure 2 11 Page 12 2000 2012 Copyright IC Nexus Corporation All rights reserved Step 2 The AVD manager is an easy way to create an Android Virtual Device AVD No matter if it is a Linux or Windows OS you will need to download the Android API and update the latest SDK tools for the first time It is advised to install all the updates for the benefit to the development of Android as whole Please be patient to wait for all the download tasks to finish This process will depend on your internet speed Packages Tools SDK Path Packages Tools Z X Android SDK Tools 15 Update available rev 16 k Android SDK Platform tools 9 Installed l Android 4 0 API 14 Documentation for Android SDK 14 1 ijdbinstalled Z SDK Platform 14 1 pi Update available rev 2 amp 2 Samples for SDK 14 1 i4 Update available rev 2 Z ARM EABI v7a System Image 14 1 3 Update available rev 2 Z amp Google APIs by Google Inc 14 1 Update available rev 2 Sources for Android SDK 14 Not installed X3 AnarnizcL 2 ADL 121 i i v Show WW Updates New W Installed Obsolete Select New or Updates Install 6 pa Sort by API level Repository Deselect All Delete 6 pa
25. hardware came with an installation CD lt or floppy disk insert it now What do you want the wizard to do Install the software automatically Recommended Click Next to continue Select Search for the best driver in these locations gt Check Include this in the search gt Click Browse to specify the landroid sdk windows extras google usb_driver folder Found New Hardware Wizard Please choose your search and installation options Use the check boxes below to limit ar expand the default search which includes local paths and removable media The best driver found will be installed Search removable media floppy CD ROM Include this location in the search D TEMPSandroid sdk windows estras google usb_ w C2 Don t search will choose the driver to install Choose this option to select the device driver from a list Windows does not guarantee that the driver you choose will be the best match for pour hardware Please wait for the software to be installed Page 18 2000 2012 Copyright IC Nexus Corporation All rights reserved Found New Hardware Wizard Please wait while the wizard installs the software E Android ADB Interface I Setting system restore point and backing up old files in case your system needs ta be restored in the Future At this point you have completed the installation Foun
26. i00 Eclipse RCP Target Components E 100 Eclipse SDK ELLE NE Details amp j Show only the latest versions of available software Hide items that are already installed W Group items by category What is already installed Show only software applicable to target environment W Contact all update sites during install to find required software Figure 2 7 Eclipse update Tips What is already installed on Eclipse or has been consulted for updating the Eclipse will all be recorded in the Available Software Sites page Go to Window menu select Preferences Figure 2 8 click Install Update Available ooftware Sites Figure 2 9 To add remove sites from the system users can click Add and Remove To edit the sites apply the Edit button For other usage please refer to the documents on the Eclipse official website Press the Add button to specify a custom name and enter a location of a new site If you are unable to add a new site successfully in the Install New Software wizard you can update the location in the Available Software Sites page instead before installing the plug in in the Install New Software wizard Page 10 2000 2012 Copyright IC Nexus Corporation All rights reserved CIiaCLlUl riv ns d B File Refer 55 Outli 33 E JJ ICNNetwork NT EG 71299 27 P 9 w CZ An outline is not available R aptana gt New Editor Open Perspective how V A
27. memoryUsageBk new ICNRegionView this Rect rectBk new Rect x y x LIGHT WIDTH LIGHT DISTANCE X USAGE SCOPE EDGE 2 USAGE TITLE SCOPE HEIGHT y LIGHT HEIGHT LIGHT LEVEL LIGHT DISTANCE Y USAGE TEXT SCOPE HEIGHT 2 memoryUsageBk createRect rectBk Color BLACK Color TRANSPARENT Paint Style FILL AND STROKE rlv addView memoryUsageBk memoryTitleText new ICNTextView this memoryTitleText setWindowRange x y LIGHT WIDTH LIGHT DISTANCE X USAGE SCOPE EDGE 2 USAGE TITLE SCOPE HEIGHT memoryTitleText setText Memory Usage memoryTitleText setTextSize screen height 26 480 memoryTitleText setTextColor Color YELLOW memoryTitleText setBackgroundColor Color TRANSPARENT rlv addView memoryTitleText for int i 0 i lt LIGHT LEVEL i memoryUsageGUIList add new ICNRegionView this Rect rectLeft new Rect USAGE SCOPE EDGE x USAGE TITLE SCOPE HEIGHT y 1 LIGHT DISTANCE Y USAGE SCOPE EDGE x LIGHT WIDTH USAGE TITLE SCOPE HEIGHT y LIGHT HEIGHT i LIGHT DISTANCE Y memoryUsageGUIList get 2 i createRect rectLeft Color GREEN Color TRANSPARENT Paint Style FILL AND STROKE rlv addView memoryUsageGUIList get 2 1 memoryUsageGUIList add new ICNRegionView this Rect rectRight new Rect USAGE SCOPE EDGE x LIGHT DISTANCE X USAGE TITLE SCOPE HEIGHT y i LIGHT DISTANCE Y USAGE SCOPE EDGE x LIGHT WIDTH LIGHT DISTANCE X USAGE TITLE S
28. menu bar gt Click Preferences gt Choose the Android from the left table gt Edit the text of SDK Location or click the Browse to find the Android SDK folder by file browser If the setting path is correct you should see information something like figure 2 5 Page 8 2000 2012 Copyright IC Nexus Corporation All rights reserved I ty filter text 4 Android General Android Build SDK Location home mark android sdk linux x86 Browse DDMS Note The list of SDK Targets below is only reloaded once you hit Apply or OK Editors Target Name endor la AP Launch Android 1 5 Android Open Source Project 1 5 3 nga Google APIs Google Inc 1 5 3 ge RAN Android 1 6 Android Open Source Project 1 6 E pu Google APIs Google Inc 1 6 4 is Aptana Android 2 1 Android Open Source Project 2 1 7 Help Google APIs Google Inc 2 1 7 aj Install Update Android 2 2 Android Open Source Project 2 2 8 t FR Ape Google APIs Google Inc 2 2 8 NTS Add On KYOCERA Carnnarafinn 2 a 2 Step 2 Install Aptana Studio Android Preferences Figure 2 5 ADT pv Y ow In order to edit CSS JavaScript and HTML you will need Aptana Studio Applying the same procedure as how ADT was installed the name and the URL for the Aptana Studio reference only to be entered are Aptana Studio http download aptana com tools studio plug in install studio After this download you can check
29. on between the user and the application The java interfaces we provide to handle events for you are as follows icnexus smartdisplay ICNUserData ICNService library project icnexus smartdisplay CNUserString ICNService library project These two events we provide handle user data and user text You can send your data or text to your smart display using our predefined commands Once the commands are received by your smart display service it will notify the relative application of the callback event you have implemented before icnexus smartdisplay ICNImageButtonCB ICNImageButtonMgr library project When you want to handle the button down or button up event you can extend ICNImageButton and then implement your ICNImageButtonCB Page 117 2000 2012 Copyright IC Nexus Corporation All rights reserved icnexus smartdisplay ICNDropZoneEventsListener ICNDragAndDrop library project If you want to send user data after dropping your object you can call the OnDropped function of the SampleUserDragAndDrop java file in the ICNMain project You can call the sendUserData fuction to send user data to your smart display icnexus smartdisplay ICNVideoPlayerEvent ICNService library project The events for the video player on your interface can be handled using the callback functions as shown below 1 playCallback When you send the play video command to your smart display this function will be called to play the vi
30. then click Project from the top menu bar select Properties File Edit Scripts Source Navigate Search IBIjete Refactor Run Window Help riv Open Project Close Project BE Package Explorer T g Android 2 3 3 m Library Projects a icnservice jar home mark worl s icnimagebutton jar home mark 1g Set v Build Automatically Generate Javadoc s icndraw jar home mark worksp ga icnchartdemo jar home mark Ga icnclock jar home mark workspace ICNClock bin icnmediaplayer jar home mark workspace ICNM ediaPlayer bin Ge icnticker jar home mark workspace ICNTicker bin s icndraganddrop jar home mark workspace ICNDragAndDrop bin m Referenced Libraries fs achartengine 0 7 0 jar B src B icnexus smartdisplay ICNCOMPortServiceMgr java n ow ICNMain Alternatively you could also right click the project name you want to set and then select Properties r Run Window suild Path Source ay GY Refactor Import Export Refresh 3 ICNC Close Project INC Close Unrelated Projects Assign Working Sets Run As Debug As Command Line Shell Explore Files Copy path s to clipboard Team e bin Compare With Restore from Local History Py Dev Help t5 amp Java Android Tools Confi gure 2000 2012 Copyright IC Nexus Corporation All rights reserved Page 60 b When you open the Properties wi
31. upper left corner int y Ticker s y coordinate of the upper left corner int ani begin x Ticker s x coordinate of the starting point at the upper left corner int ani end x Ticker s x coordinate of the end point at the upper left corner int ani begin y Tickers y coordinate of the starting point at the upper left corner int ani end y Tickers y coordinate of the end point at the upper left corner int ani duration the time Ticker takes to complete the whole path ms int ani repeat time the number of times Ticker has run 1 implies infinity String textData the text content of Ticker e e e e e wo 0 1 O OI A w N LE RR O O x NN N NA 2 void ICNTicker TextSetting String text Define Ticker s text 3 void ClockInfo window x window y window width window height Size textColor backgroundColor tf The parameter definition for Clock s values 1 int window x Clock s x coordinate of the upper left corner of the background int window y Clock s y coordinate of the upper left corner of the background int window width the width of Clock s background int window height the height of Clock s background int size Clocks font size int textColor Clock s font color int backgroundColor Clock s background color Typeface tf Clock s text font type COO I on OO A W N 4 void ICNImagePlayer addImage image id Add the image to the image player 5 void setWindowRange
32. upper left corner of the background Clock s y coordinate of the upper left corner of the background window width the width of Clock s background window height the height of Clock s background size Clock s font size textColor Clock s font color backgroundColor Clock s background color tf Clock s text font type 5 2 2 Adding parameters to cinfolist 2000 2012 Copyright IC Nexus Corporation All rights reserved Page 36 private void ClockSetting ji L1 int window x 0 window y 615 window width 240 window height 7 ae int size 50 textColor Color GREEN backgroundcolor Color PEGEAY Typeface tf Typeface MONOSPACE I 6 In the onCreate method call function TickerSetting and ClockSetting Override public void ontreate Bundle savedlInstancesState i super oncCreateisavedlInstancestatms TickerSettingdgil ClaekSetting i rly new RelativeLayout this imadgePlayer new ICNImagePlayer this ImagePlayerSettingil ES mlicker new ICHTicker this tintolist molock new ICNClock this cinfolist mvideoview new VideoViewithis FEET mMediacontroller new MediatController this mMediacontrroller set nchorViewimVideoView 7 Inthe onCreate method change the variable of relative layout to the current context E z lHCrrerride public void ontreate Bundle savedlInstancestate i super oncreatei savedInstanceStats TickerSettingil ClockSettin
33. 000 2012 Copyright IC Nexus Corporation All rights reserved 4 ICN Digital Signage Demo ue OxDO 0x03 0x01 BE OxDD 0x89 OxBB A Digital Signage include clock ticker Image Player Time 1 Page 128 2000 2012 Copyright IC Nexus Corporation All rights reserved Time 2 5 CN Chart Demo Command Bytes End Bytes Iu OxDO 0x04 0x01 n OxDD 0x89 OxBB Draw a Chart diagram on screen Page 129 2000 2012 Copyright IC Nexus Corporation All rights reserved 6 ICN Media Player Demo Command Bytes End Bytes Iu OxDO 0x05 0x01 BE OxDD 0x89 OxBB A Media Player screenshot 35 T r to 2 IY py PE t Li X Keep fighting until you drop Seediq Bale Page 130 2000 2012 Copyright IC Nexus Corporation All rights reserved 7 ICN File Browser Demo Start Byte Command Bytes Data Bytes End Bytes Iu OxDO 0x06 0x01 BE OxDD 0x89 OxBB A file browser UI screenshot B initireescate rc Bl init gordnsh r inite vevente freescale re Bl veventd goldtish re veventd re vender 8 ICN Resource Usage GUI Iu OxDO 0x07 0x01 OS OxDD 0x89 OxBB A file browser UI screenshot Page 131 2000 2012 Copyright IC Nexus Corporation All rights reserved e For Network Command Emulator tl 2 ri HE LS ICNCmd E LIMES Th n Saami 192 168 11 2 Port 20000 FAD0000100DD89 BB soo o0 Demo App Send User Data Hex 010203040506070
34. 1 11 7 record read line num and Catch the path list index c path line new choice 1 break pe records add line OQ cus if c gt list index list index c catch FileNotFoundException e Toast makeText this Playlist Gone please check file Toast LENGTH SHORT show e printStackTrace catch java io IOException e Toast makeText this Some thing wrong Toast LENGTH SHORT show e printStackTrace finally try if buffreader null buffreader close catch java io IOException e Toast makeText this Buffer for Reading can not release Toast LENGTH SHORT show e printStackTrace else Toast makeText this Please add the playlist first Toast LENGTH SHORT show break Page 93 2000 2012 Copyright IC Nexus Corporation All rights reserved fae Get Path from list Important List get N must change DataType because return value is Object wy try 1f list num lt list index path String records get list_num list num jelse path String records get 0 list_num 1 catch IndexOutOfBoundsException e Log e SampleDigitalSignage MediaPlayer select list num list index error e getMessage e I mark shieh Z011 11 3 J mediaController new MediaController this catch Exception e Log e SampleDigitalSignage MediaPlayer error e getM
35. 910111213141516 Send User Text UTF 8 B NSD Demo Message from Smart Display Page 132 2000 2012 Copyright IC Nexus Corporation All rights reserved
36. C Nexus Corporation All rights reserved Page 35 5 1 2 Add parameters to tinfolist private void TickerSetting i li int textColor Color EED hackgroundcolor Color TRANSPARENT textsize int hackgroundWidth S00 hbackgroundHeight 150 int x 0 y 0 int ani begin x 1000 ani end x 240 ani begin y 580 ani end y int ani duration 20000 ani repeat time 1 String textData Smart Display tintolist new TickerInfoltextColor backgroundcolor textsize hackgroundWidth backgroundHeight Kr Y ani begin x ani end x ani begin v ani end v ani duration ani repeat time textDatal 5 2 Add a new parameter for Clock named ClockSetting private void Clock3etting i int window x 0 window y 615 window width 240 window height 7 int size 50 textColor Color GREEN backgroundcolor Color P GRAY Typeface tf Typeface MONOSPACE cinfolist new ClockIntol window x window v window width window heigl size textColor backgroundcColor tif 5 2 1 Set the parameters private void ClockSettingl i int window x 0 window y 615 window width 240 window height int size 50 textColor Color GREEN HackgroundColor Color PDPEGEAY Typeface tf Typeface MONOSPACE cinfolist new ClockInfo window x window y window width window heigl size textColor backgroundColor tfl Parameter definition window x window y Clock s x coordinate of the
37. CH nin M yY Studio Customize Perspective Studio Create Projects Plugins Extensions for Studia at General Android Ant Aptana Help Install Update Automatic Update Available Software Java Plug in Development PyDev Run Debug Team XML 3 Create new file ig Create new project 04 Create new project file g Project from sample Recent Files i ICNMain 5 ICNNetworkService i ICNService AndroidManifest xml NET 6 Android mk SerialPort h gen SerialPort h sh G Install Plugins SerialPort c View Plugin Manager 5 COMPort java Application mk i ICNCmdEmulator S ICNCmdEmulator java f Signin Figure 2 8 Open window preferences Available Software Sites type filter text Studio 3 released It s ready It s time Develop and test your entire web application using a single environment With support for the latest browser technology specs such as HTML5 C553 JavaScript Ruby Rails PHP and Python We ve got you covered Download Migrating from Studio 2 to 3 Click here for more information amp Follow Aptana on Twitter Follow Now https dl ssl google com android eclipse http download aptana comytools studio plugin http download aptana org tools studio plugin i Z ADT amp 4 Aptana amp 4 Aptana XUL Update Site amp 4 Indigo amp Mozilla XUL Update Site am
38. CNDragAndDropManager getInstance addDropZone dropzonel Page 83 2000 2012 Copyright IC Nexus Corporation All rights reserved ImageView il new ImageView this il setBackgroundResource R drawable android 128 LayoutParams lpl new LayoutParams imgw imgh lpl setMargins 300 100 0 0 il setLayoutParams 1p1 il setOnTouchListener onTouchListener rlv addView trashV rlv addView il rlv addView dragSurface IBInfo ibi new IBInfo 400 400 120 100 F R drawable blue blank Color RED ICNImageButton FONT ID MINIS 5 UserImageButton ib new UserImageButton this 0 ib setButtonUpAuto true ib setFontSize 60 ib createButton ibi ib setText Exit rlv addView ib setContentView rlv private OnTouchListener onTouchListener new OnTouchListener Override public boolean onTouch View v MotionEvent event if event getAction MotionEvent ACTION DOWN String txt IextView v getlext to5tring0O ICNDraggableItem draggedItem new ICNDraggableItem v ICNDraggableViewsFactory getLabel Drop m Ext t SIT ICNDraggableltem draggedItem new ICNDraggableItem v ICNDraggableViewsFactory getiImage imgw imgh R drawable android 128 Tr Start dragging ICNDragAndDropManager getInstance startDragging this draggedItem return true return false Page 84 2000 2012 Copyright IC Nexus Corporation All rights reserved Hi private ICND
39. COPE HEIGHT y LIGHT HEIGHT i LIGHT DISTANCE Y memoryUsageGUIList get 2 i 1 createRect rectRight Color GREEN Color TRANSPARENT Paint Style FILL AND STROKE rlv addView memoryUsageGUIList get 2 i 1 memoryUsageText new ICNTextView this memoryUsageText setWindowRange USAGE SCOPE EDGE x USAGE TITLE SCOPE HEIGHT y LIGHT HEIGHT LIGHT LEVEL LIGHT DISTANCE f USAGE TEXT SCOPE WIDTH USAGE TEXT SCOPE HEIGHT memoryUsageText setTextSize screen height 30 480 memoryUsageText setTextColor Color GREEN memoryUsageText setBackgroundColor Color TRANSPARENT rlv addView memoryUsageText memorySizeText new ICNTextView this memorySizeText setWindowRange USAGE SCOPE EDGE x USAGE TITLE SLOPE HEIGHT y LIGHT HEIGHT LIGHT LEVEL LIGHT DISTANCE Y t USAGE TEXT SCOPE HEIGHT USAGE TEXT SCOPE WIDTH USAGE TEXT SCOPE HEIGHT Page 113 2000 2012 Copyright IC Nexus Corporation All rights reserved memorySizeText setTextSize screen height 25 480 memorySizeText setTextColor Color GREEN memorySizeText setBackgroundColor Color TRANSPARENT rlv addView memorySizeText public void updateCPUUsage int usage if usage lt 0 usage gt 100 return int idle 100 usage for int i 0 i lt LIGHT LEVEL i if i lt idle 5 I cpuUsageGUIList get 2 i alphaRefresh 50 cpuUsageGUIList get 2 i 1 alphaRefresh 50 Log v updateCPUUsage Integer toS
40. D0000203DD89BB to the elevator pressing the button 3 will restore Page 76 2000 2012 Copyright IC Nexus Corporation All rights reserved the colour to blue again If you click the button Send User Text UTF 8 to send a user text to the elevator it will show you the text you set previously in the ICNCmdEmulator Page 77 2000 2012 Copyright IC Nexus Corporation All rights reserved Graphical Drawing UI The ICNDraw Java class is a simple graphical drawing UI activity in the Android device It provides you with some drawing classes such as as ICNRegionView ICNTextView ICNImagePlayer and ICNGallery You can rewrite your code and refer it to the OnCreate function in the SampleUserDraw java file from your ICNMain project a The library project you need is called ICNDraw b OnCreate Function public void onCreate Bundle savedInstanceState super onCreate savedInstanceState rlv new RelativeLayout this 1 Create Background View background new View this background setBackgroundResource R drawable bluecurvebk 2 Create Circle View 1 circlel new ICNRegionView this circlel createCircle 85 85 70 Color RED Color TRANSPARENT Paint Style FILL AND STROKE circlel appearedMode 200 circlel run 3 Create Circle View 2 circle2 new ICNRegionView this circle2 setWindowRange 160 10 100 100 circle2 createCircle 50 50 50 Color WHITE Color TRANSPARENT P
41. DD Auto generated method stub unbindServicell Log r SampleDigitalSignage onDestroy unbindService done super onbDestraowvil Bb h EA Page 39 2000 2012 Copyright IC Nexus Corporation All rights reserved SampleChart This section describes how to add an application to your Chart Project 1 Declare a new project named SampleChart that extends the ICNService Binding class up import org achartengine GraphicalView public class SampleChart extends ICNService Binding i m private IDemoChart mCharts new IDemoChart new SalesGrowthChart ij private IDemochart m harts new SalescGrowthcharti l 2 Use IDemoChart to add a new class object named mCnarts Assign mChart s to SalesGrowthChart public class SampleChart extends ICNService Binding i private IDemocChart moharts new IDemochart new SalescrowrhCharti 1 private IDemochart m harts new SalesGrouthChart i 3 Use Chart Info to establish a parameter object for Chart named cinfolist ffprivate String mMenuSummar private Handler handler new Handleri private ChartInfo cintolist private Vector lt Double gt ZAxie new VYector lt Double gt i 4 Use IBInfo to establish a parameter object for ImageButtonn named ibi IBInfo ibi User Imagebutton ib 5 Add two Double data types for each x axis and y axis respectively private ChartInfo cinfolist private Vector lt Double gt X xie new Vector lt Double g
42. EM KB setContentView rlv main handler postDelayed info update r RefreshTime init ICNService ICN COMMAND ID ICN RESOURCE USAGE rlv main bindService Override protected void onDestroy TODO Auto generated method stub unbindService super onDestroy public Runnable info update r new Runnable public void run Page 111 2000 2012 Copyright IC Nexus Corporation All rights reserved info update handler postDelayed this RefreshTime Hi public void info update updateMemoryUsage int readMEMUsage updateCPUUsage int readCPUUsage updateUsedMemorySize Mem Used ICN MEM UNIT ICN MEM KB public void createCPUUsageGUI RelativeLayout rlv int x int y cpuUsageBk new ICNRegionView this Rect rectBk new Rect x y x LIGHT WIDTH LIGHT DISTANCE X USAGE SCOPE EDGE 2 USAGE TITLE SCOPE HEIGHT y LIGHT HEIGHT LIGHT LEVEL LIGHT DISTANCE Y USAGE TEXT SCOPE HEIGHT cpuUsageBk createRect rectBk Color BLACK Color TRANSPARENT Paint Style FILL AND STROKE rlv addView cpuUsageBk cpuTitleText new ICNTextView this cpuTitleText setWindowRange x y LIGHT WIDTH LIGHT DISTANCE X USAGE SCOPE EDGE 2 USAGE TITLE SCOPE HEIGHT cpuTitleText setText CPU Usage cpuTitleText setTextSize screen height 26 480 cpuTitleText setTextColor Color YELLOW cpuTitleText setBackgroundColor Color TRANSPARENT rlv addView cp
43. ICNMain Then go to Run at the menu bar gt Run as gt Select Android Application Alternatively you can also press the Run button at the toolbar to select Android Application to run the ICNMain project If this is not the first time you run the ICNMain project click the right triangle to the left of the this will bring up a list of your most recent project names Run button at the menu bar and se 48 SF v or br OQ e yr l6 r p Daae Cpo G ApDemes O c E 5 CNCharttDemo 42 ICNClock 39 ICNCmdEmulator gt i ICNDragAndDrop V ICNDraw T KCONFieBrowser i3 ICNImageButton 5 i A ss mAndroid 2 3 3 b s Ubrary Pro jects lament tes pieMediaP ayer java 12 aa m Referenced Libranes Fa hartengsne 0 7 0 jar int datasize I i ge src back Integer toString datasize ignes Sri play a E i aliback User Datas String format wr userdata i li UjCHCOMPorServiceMgr java i Ch MehworeServiceMigr java jf Samplechart java hta int datasize if SampleDsgital Signage java lhack ger Strings str e str length d SampleMediaPlayer jiwi m A m E rm pi c i Samgpleuserpracndprnopactivity java fi Sampleuserbraw java LCallback Empty User String String fros userdata is empty i Samplaketkyvasrjav VESVETL SGE onto amat play app Userklev torjava VESVETT SOL
44. L M oostDelayed this ChartRefreshTime public void ReadInputData byte userdata int datasize InputDataSize datasize for int i 0 i lt datasize i DataYAxie addElement Double valueOf Integer toString userdata i public void chart_update XAxie clear YAxie remove 0 if InputDataSize gt 0 Page 99 2000 2012 Copyright IC Nexus Corporation All rights reserved YAxie addElement DataYAxie elementAt 0 InputDataSize DataYAxie remove 0 else for int j 0 j YAxieNumber j Pr bd YAxie addElement Math random 10 JT XAxie addElement Math random 10 YAxie addElement double 5 cChartView mCharts 0 Change this cinfolist XAxie YAxie cChartView mCharts change this cinfolist XAxie YAxie mlp new LayoutParams 500 350 lp SetCMexroins 250 150 0 0 cChartView setLayoutParams mlp rlv new RelativeLayout this HJT TT ER bn NT ibi new IBInfo 800 400 120 100 R drawable blue blank Color AED ICNImageButton FONI ID MINIS ib new UserImageButton this 0 ib setButtonUpAuto true ib setFontSize 60 ib createButton ibi in sSetIext Brill TN NNN rlv addView cChartView rlv addView ib setContentView rlv public class UserlImageButton extends ICNImageButton implements ICNImageButtonCB public UserImageButton Activity act int bid super act bid i public void buttonDownCallback
45. Long toks 4 long cpu2 Long parseLong toks 1 Long parseLong toks 2 Long parseLong toks 3 Long parseLong toks 5 Long parseLong toks 6 Long parseLong toks 7 return float cpu2 cpul 100 cpu2 idle2 cpul idlel catch IOException ex ex printStackTrace return 0 private float readMEMUsage try RandomAccessFile reader new RandomAccessFile proc meminfo Im String load reader readLine String toks gt load split XXst long mem total Long parseLong toks 1 load reader readLine reader close toks gt load split Ne long mem free Long parseLong toks 1 Mem Used mem total mem free return float Mem Used 100 mem total catch IOException ex ex printStackTrace Page 115 2000 2012 Copyright IC Nexus Corporation All rights reserved return 0 public void resourceusageExitCallback unbindService super onDestroy finish API 1 void ICNRegionView createCircle float x float y float r int color int bkcolor Paint Style style To create a circle view float x the x coordinate of the center of the circle to be drawn float y the y coordinate of the center of the circle to be drawn int r theradius of the circle to be drawn int color the color of the circle Paint Style style three styles you can set FILL STROKE FILL AND STROKE Please refer to the android officia
46. MediaPlayerDemo Video Activity and set the path variable to your media file path Your media file must be stored on sdcard Toast LENGTH LONG show I break case STREAM VIDEO pach te if path Tell the user to provide a media file URL Toast makeText this Page 91 2000 2012 Copyright IC Nexus Corporation All rights reserved Please edit MediaPlayerDemo Video Activity and set the path variable to your media file URL loast LENGTH LONG show break case PLAYLIST VIDEO Refresh Playlist records Once maybe limit N lines if IsRefreshPlayListRecords break else IsRefreshPlayListRecords false loath plavlist 185 File f new File mnt sdcard playlist lpath int c 1 int new choice 0 if f exists StringBuffer contents new StringBuffer BufferedReader buffreader null try open file for reading buffreader new BufferedReader new FileReader f String line null buffreader mark 1000 useless init list index 1 if records isEmpty records clear Log d SampleDigitalSignage MediaPlayer debug release the playlist records read every line of the file into the line variable on line at the time while line buffreader readLine null FT te list index Page 92 2000 2012 Copyright IC Nexus Corporation All rights reserved mark shieh 201
47. TE Input Package Name and click Finish Case2 Create project from existing source E New Android Project Create Android Project E Project name must be specified Project Name Create new project in workspace O Create project from existing sample Hs detault locaton Location C Documents and Settngsiben chiu Working sets Add project to working sets Page 28 2000 2012 Copyright IC Nexus Corporation All rights reserved Select Create project from existing source and then click the Browse button to select an existing project file l n Be a Sop mer ferge bpi for Peleg fie Bates ed fi F j i O Ge ee adr ws e Tes aai Pr 0 Seles LL OE uad Rois pe Ms i Damme hari en ul EN Tuch p zt i Bige Package LcChexuBfme rt displaT fh a B ipl diem Tur c Chafemc t mpari irneuus meartiirpiay lCHbpma LCR tee Pla pee Jy meget been Diis Db zaginie ema zi puhlir 1 F J bis 108 q p z etin IN Kafe ai des li hak iili V Bi eal ECNTiriew me I WD gd ale ICE Leer l w Eiis Cee ayit em iir Eda len eae f ieii roe Je P san MEN HS beking F Hang Er pekt Lope Uhl ape mal oter Engel ln TI m raUr seld Tis mere Tt T n renun iim Bi tst pow ETT inl Li al VR T rcicald int back iv 1 T ikesi vi bn inl VB qua e Do FH JT minii t i IRI T io L ui irs 1 mart toe new ert jae dee E ii inir fq
48. a terimagedifton jar Log v SampleUserflevator stringArrivalCallback User String str str length e m Referenced Ubranes amp achartengshe O 7 0 j r if str 1sEmptyl i Log Samp leUserE levator string rrivalCaliback Emp User String Strin rom userdate is empty s agel l Elevat t leallb tapty 9 g ty jf cnexus smartdisplay jelset f ICNCOMPortServiceMgr Hrv Toast aakeTexti t D ICNNetworkServiceMgr java SanpleMediaPlayer this if SampieChart java str E Toast LENGTH LONG showl t i SampleOsgitalSignage java j SampleMediaPla yer java File f mew fFile ant sdcard video str ib SampleuserDragAndDropArtivity java if plea gute de AD SamoleUserDraw java List rp ea M y t Ji SamgicUsertlevator java jelset 2 are f new File mnt sdcard DCIM str w ICNMaimn o b laet an tha r NI 1 Seve 23 L t4 vrriwv oO Amado DAL nant Cane VideoView java E mpleMedaPiayer amp wringArivalCalibacki char int void 2000 2012 Copyright IC Nexus Corporation All rights reserved Page 62 Once this is done the Eclipse plug in will automatically upload the APK file from the bin folder in your project package for a new run configuration and then launches the Android emulator You can now interact with your emulated Android device just as you would do with an actual device Debugging in Android using Eclipse Despite Android being o
49. aint Style STROKE circle2 appearedMode 300 circle2 run 4 Create Rectangle View regionl new ICNRegionView this Rect rectl new Rect 40 40 130 130 regionl createRect rectl Color YELLOW Color TRANSPARENT Paint Style FILL AND STROKE regionl disappearedMode 80 regionl run 5 Create Text View tv new ICNTextView this tv setWindowRange 50 170 350 160 Path p new Path p moveTo 0 150 Page 78 2000 2012 Copyright IC Nexus Corporation All rights reserved p cubicTo 0 150 100 75 350 35 tv setPath p tv setText Graphical Demo tv setTextSize 40 Lv setlextColor Color BBbLUE tv setBackgroundColor Color TRANSPARENT Typeface tf Typeface createFromAsset getAssets fonts bullpen3 ttf tv setTypeface tf tv appearedMode 100 tv run 6 Create Round Rectangle View region2 new ICNRegionView this Rect roundRect new Rect 80 400 350 500 region2 createRoundRect roundRect Color BLUE Color TRANSPARENT Paint Style FILL AND STROKE regionZ appearedMode 800 region2 run 6 Create Oval View region3 new ICNRegionView this Rect roundRect2 new Rect 80 450 350 550 region3 createOval roundRect2 Color GREEN Color TRANSPARENT Paint Style FILL AND STROKE region3 disappearedMode 500 region3 run 7 Create Image Player with slide showing imagePlayer new ICNImagePlayer this iv addImage R dr
50. artRefreshTime 500 public GraphicalView cChartVieu public RelativeLayout rly protected LayoutParams mlp 11 In the function Chart Info assign all the parameters that have already established in Step 6 to cinfolist public void info updatei 1 cinfolist new ChartInfolXMin XMax YMin YMax Color xes ColorLabel Colorchart ColorBackgground zRangeNum YRangeNum ChartSmoothness ShowrGrid Backgroundcolor pply zoomButtonsVisible ShowLeqend Showaxes ShowLabels ChartTitle Name YName ChartrExplain 12 For the range of values in X axis and Y axis that have already defined in Step 6 add a double data type to XAixe and YAxis respectively for iint i 0 i X xieNumber i 1 Zlxie SsddElement i double i I for iint j 0 j lt YLxieMumber j 1 Yixie addElement Math random 10 H 13 In the function change enter the parameter value for myCharts Page 42 2000 2012 Copyright IC Nexus Corporation All rights reserved mlp new LayoutParams S00 350 mlp setMargins 250 150 0 0 cChartVYiew setLayoutParams mlp 14 Assign a new LayoutParams parameter to mlp Then assign two values to LayoutParams to represent the width and height of the layout Use setMargins to position layout where the first two parameters represent the x axis coordinate and the y axis coordinate Assign the height and width of LayoutParams to mlp and add mlp to SetLayoutParams befo
51. awable bluecurvebk imagePlayer addImage R drawable flower imagePlayer addImage R drawable redsky imagePlayer addImage R drawable sand imagePlayer addImage R drawable tl imagePlayer addImage R drawable t2 imagePlayer addImage R drawable sand imagePlayer setWindowRange 400 200 600 500 8 Option Create Gallery View for Image Player ICNGallery mg imagePlayer createGallery mg setWindowRange 400 140 600 60 Start To Slide Show imagePlayer setSlideShowTime 3000 try imagePlayer run catch java lang OutOfMemoryError error Toast makeText this Out of Memory 3 79 Exit button 2000 2012 Copyright IC Nexus Corporation All rights reserved Page 79 DisplayMetrics dm getScreenSize IBInfo ibi new IBInfo dm widthPixels 120 0 120 100 R drawable blue blank Color RED ICNImageButton FONT ID MINIS UserImageButton ib new UserImageButton this 0 ib setButtonUpAuto true ib setFontSize 60 ib createButton ibi ib setText Exit Finally Add All Views to Relative Layout rlv addView background rlv addView circlel rlv addView circle2 rlv addView regionl rlv addView region2 tv rlv addView imagePlayer rlv addView rlv addView mg rlv addView region3 rlv addView i ib setContentView rlv 1 void ICNRegionView createCircle float x float y float r int color
52. bl setContentViewlrlv I 12 Add onTouchListener for 8 2 to use private OnTouchListener onTouchListener new OonTouchListener i L1 Override public boolean onTouchiView v MotionEvent event i if event getd ction MotionEvwent ACTION DOWN i 13 In the onTouchListener implement a draggedItem iCnzerride public boolean onTouch View v MotionEvent event i if event getd ction HMotionEvent ACTION DOWN i ICHDracgcdqgableltem draggedItem new ICHDracggableItemiv ICHDraggableViewsFactory dgetiImage imgqgw imgh R drawable ar ICHDPrag ndDropManager dgetinstance startDbraggingithis draggedIten return true return false 14 Add a new event listener named dropzoneListener for 7 2 to use Hovwerride public void OonDragzoneEnterediICHDropzone zone ICNDraggableltem item i 15 In the dropzoneListener implement OnDragZoneEntered dtryerride public void OonDragzoneEnteredi ICHDropzone zone ICNDraggqableItem item i zoane getView setBackgroundColor Colaor YELLOW 16 In the dropzoneListener implement OnDragZoneLeft Page 49 2000 2012 Copyright IC Nexus Corporation All rights reserved HCnrerride public void OnDragzoneLefti ICHDropzone zone ICHDragdgableltem item i ff rone getView setBackgroundColor Color parseColor 999999 17 In the dropzoneListener implement OnDropped fitmerride public void OnbroppediICNDbropz
53. bytes OxFB 0x01 OxFF 0x00 0x10 16 bytes OxDD 0x89 OxBB es Elevator System OxFA OxDO 0x00 Ox01 0x00 OxDD 0x89 OxBB 1 send command to smart display to launch application e g Sansus font 2 receive data from smart display e g 0xFB OxDO 0x00 0x01 0x06 OxDD 0x89 OxBB when user pushes button down 6 s sed EE sd 3 send button up command for specified OxXFA OxDO 0x00 0x02 0x06 OxDD 0x89 OxBB button e g after user arrives 6F o peram dl Elevator System OxFA OxDO 0x00 0x01 0x01 OxDD 0x89 OxBB 1 send command to smart display to launch application e g Acens font Graphical Drawing UI oxFA 0xDO 0x01 0x01 oxoo oxDD 0x89 OxBB Application with Drag and Drop UI OxFA _ oxD0 0x02 0x01 0x00 oxDD 0x89 OxBB Page 121 2000 2012 Copyright IC Nexus Corporation All rights reserved Digital Signage OxFA OxDO 0x03 0x01 0x00 OxDD 0x89 OxBB 1 Launch Digital Signage L DD 060 088 OxDO 0x03 0x02 0x00 OxDD 0x89 OxBB 3 Pause Video OxDO 0x03 0x03 OxDD 0x89 OxBB 4 Stop Video OxFA OxDO 0x03 0x04 0x00 OxDD 0x89 OxBB 2 Play Resume Video 5 Video Forward OxDD 0x89 OxBB 6 Video Backward OxDO 0x05 0x06 OxDD 0x89 OxBB 7 Next Video OxDO 0x05 0x07 OxDD 0x89 OxBB 8 Prev Video OxDO 0x05 0x08 OxDD 0x89 OxBB Media Player OxFA OxDO 0x05 0x01 0x00 OxDD 0x89 OxBB 1 Launch Video ooo Play Resume Video after Pause 0x00 po oo Pause Video after Play 0x00 e
54. cdgil imagePlayer new ICNImagePlayer this ImadgePlayerSertingil n mTicker new ICHTickeri this tintolist molock new ICNClock this cinfolistl nvidecnview new VideoView this HOGNE mMediacontroller new MediatController this mMediacontroller set inchorView mvVvideoView 8 Create two new objects named ICTTicket and ICTClock respectively and then initialize them with the information in their parameters Page 37 2000 2012 Copyright IC Nexus Corporation All rights reserved Override public void ontreate Bundle ssvedInstanceStatel i super onCreate saved Instancestatel gt TickerSettingil Cloceksettingl1 rly new RelativeLayout this imagePlayer new ICNImagePlayer this mTicker new ICHTicker this tintolist molock new ICNClock this cintolist mvidecview new YideoView this OVN mMediacontroller new MediaControllerithis mMediacontroller set inchorVvier mVideoVietn 9 In the onCreate method use riv relative layout object reference to invoke the addView method Then you apply the mC1ock and mTicket arguments to the addView method rlwv addVviewiirmacdgePlavser rlv addViewimclock us rl addVviewimvideowvie EI rlv addVierimTicker setcontentViewirl initiICHService ICM COMMAND ID ICN DIGITAL SIGNAGE DEMO rlw boq r i semplebDigitalsidgnadgstoDnLreate hindocrvise 44712 bindServiceil 10 In the onCreate method add
55. d New Hardware Wizard Completing the Found New Hardware Wizard The wizard has Finished installing the software Far Android 406 Interface D Click Finish to close the wizard Finish Cancel Page 19 2000 2012 Copyright IC Nexus Corporation All rights reserved Right click my Computer icon gt Properties Hardware gt Select Device Manager gt Open up Android Phone to see if there is an Android ADB Interface Device Manager E BK File Action View Help m E DE SA ALICE XP ENGOL z Android Phone E Android ADB Interface Y Computer Disk drives E Display adapters DVD CD ROM drives a Human Interface Devices ic IDE ATA ATAPI controllers c Keyboards _ Mice and other pointing devices E Monitors S Network adapters Ports COM amp LPT vf Processors Sound videa and game controllers Storage volumes y System devices p I lisse nl Cecil Diu contenlo F T Eod i F HE Hi BEI fe FI Page 20 2000 2012 Copyright IC Nexus Corporation All rights reserved Then you can test the Android adb tools in the command prompt window using the command below to check if your daemon has been started successfully gt adb devices E WINDOWS system32 cmd exe Microsoft Windows AP Version 5 1 2600 G gt Copyright 1985 2001 Microsoft Corp E Documents and Settingsvalice lin gt adb devices daemon not running starting it now on port 5037
56. ded in the the SampleUserElevator java file from the ICNMain project e Thelibrary projects you will need are ICNService and ICNImageButtonMgr e InitUserButtonSampleCode Function Page 73 2000 2012 Copyright IC Nexus Corporation All rights reserved protected void InitUserButtonSampleCode 1 rly new RelativeLayout this int count 4 IBInfo ibinfolist new IBInfo count DisplayMetrics dm get3creenSize Tinal int button width 500 final int button height 300 int xpos 0 int ypos 1 button height for int i 1 1 lt count iT ypos button height if ypos gt dm heightPixels vpos button height gt dm heightPixels i vpos 0 xpos button width if xpos gt dm widthPixels xpos button width gt dm widthPixels break addbutton new ICNImageButton this ill ibinfolist i i new IBlnfo xpos ypos button width button height R drawable bule square button Color BLUE ICNImageButton FONT ID S ANDUS getButton i ij setClickedImageId R drawable red square button getButton i l setFont5ize 160 getButton i l1 createButton ibinfolist i i rlv addView getButton i 1 I init ICONService ICN COMMAND ID ICN ELEVATOR DEMO riv setContentViewirlv 1 DisplayMetrics ICNService getScreenSize A function of ICNService Call it to get your current screen resolution size Once you get the Display Metrics information you can adjust th
57. deo 2 pauseCallback When you send the pause video command to your smart display this function will be called to pause the video 3 stopCallback When you send the stop video command to smart display this function will be called to stop the video Services e We provide some services to receive or send user commands and they are as follows 1 ICNCOMPortService For RS232 RS485 2 ICNNetworkService For Network e Services must be started before you use your COM port or network e How to start the service i Start COM Port Service by GUI Click the COM Port Service Controller icon ii Start COM Port Service by the Console Command Page 118 2000 2012 Copyright IC Nexus Corporation All rights reserved am startservice n icnexus smartdisplay service ICNCOMPOortService lii Start Network Service by GUI Click the Network Service Controller icon iv Start Network Service by the Console Command am startservice n icnexus smartdisplay service ICNNetworkService Sending and Receiving Commands via the Network Open your Android Virtual Device Manager and then launch ICNCmdEmulator e Setthe network IP of your smart display device and App ID Then send your commands Page 119 2000 2012 Copyright IC Nexus Corporation All rights reserved oes x ae ICN dEmulator Ds a A x wm uL E SES 192 168 11 2 229000 20000 FADO000100DD89 BB App ID 00 kl Demo App
58. e Video Forward 0x00 Lg NENNEN Next Video oxFA 0xDO 0x05 0x07 0x00 OxDD 0x89 OxBB Prev Video OxDO 0x05 0x08 0x00 OxDD 0x89 OxBB OxFA 0x02 0x05 0x00 0x string len Add New File Path From SD DCIM Video Backward OxDO 0x05 0x06 OxDD 0x89 OxBB Page 122 2000 2012 Copyright IC Nexus Corporation All rights reserved Fila Browser OxFA loxpo 0x06 0x01 m oom 0x89 OxBB 1 Launch FB 2 Exit File Browser OxFA 0xDO 0x06 0x02 oxoo oxDD 0x89 0xBB 0x4F 0x48 0x43 X 4 Update Video Playlist OxFA OxDO 0x06 0x03 OxDD 0x89 OxBB Update Audio Playlist OxFA O0xDO 0x06 0x04 OxDD 0x89 OxBB Update Image Playlist OxFA oxbo Ox06 0x05 0x00 0xDD 0x89 OxBB 4 oe OxFA OxDD 0x89 OxBB NEN i Sj 3 Update Playlist From OxFA 0x02 0x06 0x00 0x02 0x53 0x44 NEN NENNEN OxFA OxDD 0x89 OxBB OxFA OxDD 0x89 OxBB oxa OxDD 0x89 0xBB 1 Launch Resource Usage Resource Usage GUI OxDO 0x07 0x01 OxDD 0x89 OxBB 2 Exit Resource Usage OxFA oxbo 0x07 0x02 0x00 0xDD 0x89 OxBB Device ID OxFA OxDO Ox F 0x01 10x00 OxDD 0x89 OxBB 1 Get ID get 2 bytes ID 2 Set ID give 2 bytes value OxFA oxo Ox7F 0x00 oxo2 l xooo00 i User Application Button Control 1 send command to smart display to launch application Start Byte Command Bytes Data Bytes End Bytes Iu 0x00 0x00 0x01 BENE OxDD 0x89 OxBB 2 receive data from smart display Start Byte Command Bytes Data Bytes End Bytes
59. e int w the width of button int h the height of button etring img specify the absolute file path of your background picture For example sdcard imag xxxx bmp This is an optional input If you did not use this you can just set it as nul l string Once you set it its priority will be higher than the next parameter 6 intdid it is a drawable id in your res folder of the library project If you did not set the previous parameter the button will use this id as its background picture 7 int textcolor This describles the color for your output 8 ICNImageButton FONT ID fontid you can choose the font here We provide three fonts ACENS MINIS and SANSUS for you to choose from The default font is system fonts DroidSerif Bold ttf 9 String text Your output text on ICNImageButton You can keep this as a null string and then ICNImageButton will use the button id you set in the constructor time Once you set this parameter ICNImageButton will replace the button id with the text and this will appear in the output O9 amp 9l a If you use ICNCmdEmulator tool to launch Elevator when you click the button 3 you will receive a command in the ICNCmdEmulator Page 75 2000 2012 Copyright IC Nexus Corporation All rights reserved 3 all 10 26 0 13 0 04 0 01 system_serv The Event is Detected Button 3 is pressed FBD0000103DD89BB b If you use ICNCmdEmulator tool to send a button up command like FA
60. e then go to Help Menu gt Select Install New Software This will open the Eclipse installer dialog box shown in the figure 2 3 Page 6 2000 2012 Copyright IC Nexus Corporation All rights reserved File Edit Scripts Navigate Search Project Refactor Run Window M Welcome rir a esa rorar amp 6 e ay v v Av cuv Help Contents Search I Package Explor 23 3m Is My Studio 33 Dynamic Help emp Key Assist Shift Ctrl L q aptana Help T p Tips and Tricks ig ApiDemos y ICNCmdEmulator tS ICNDragAndDrop Install Aptana Features Cheat Sheets 157 ICNFileBrowser p Antana Holm Aptana neip a 15 ICNIm n 3 M EN mage Check for Updates Leader comi akk lista New Sotware TT LJ ICNMain j ICNMediaPlayer Sti About Eclipse SDK i ICNService Create Projects Extensions for Studio lg ICNSmartMediaPlayer ig SampleChartActivity C te N R t Fil y SampleFileBrowser HO x a ips Studio 3 released amp Create new file 5 ICNService x F It It s time ed Create new project 5j AndroidManifest xml iit vant este und appro v i Sp x Create new oroiect file 5 Android mk dr single environment ig SampleMediaPlayer y SurfaceView Holder M Figure 2 3 Select install new software Step 1 Install Android Development Tools To add a new repository you can just type the name and the URL for the location of Android Developmen
61. e ICN COMMAND ID ICN DIGITAL SIGNAGE DEMO rlv Log v SampleDigitalSignage onCreate bindService Page 95 2000 2012 Copyright IC Nexus Corporation All rights reserved bindService public void stringArrivalCallback char userdata int datasize String str new String userdata Log v SampleUserElevator stringArrivalCallback User String gtr a TG SDIrIcengtet jr String etr tup gw TickerDataSetting str public void playCallback if IsVideoStop false mVideoView start else playback IsVideoStop false public void pauseCallback mVideoView pause public void stopCallback mVideoView stopPlayback IsVideoStop true Override protected void onDestroy TODO Auto generated method stub unbindService Log v SampleDigitalSignage onDestroy unbindService done super onDestroy API 1 void TickerInfo textColor backgroundColor textSize backgroundWidth backgroundHeight X Y ani begin x ani end x ani begin y ani end y ani duration ani repeat time textData The parameter definition for Ticker s values Page 96 2000 2012 Copyright IC Nexus Corporation All rights reserved int textColor Ticker s text color int backgroundColor Ticket s background color int textSize Tickers font size int backgroundWidth the width of Ticker s background int backgroundHeight the height of Ticker s background int x Ticker s x coordinate of the
62. e player window or call the stopCallback method via remote control If you would like to stop playing the current media file only please use Pause or other restart methods 3 4 Communicating with service Please add the following setting to the onCreate method to complete the declaration of remote control and Layout container init I CNService ICN COMMAND ID ICN Media Player DEMO riv bindService The service implementation examples include seven methods control functions and corresponding functions as shown below playCallback start stopCall back onDestroy pauseCallback pause Page 107 2000 2012 Copyright IC Nexus Corporation All rights reserved nextCallback setPreNextListeners prevCallback setPreNextListeners fastForwardCallback copy from MediaController fastBackCallback copy from MediaController If you would like to add new commands please see the Service section You may start the player to send and receive information through COM or Network It requires the following commands ICN Demo otart Command Bytes Data Byte End Bytes Command Byte Media Player OxFA OxDO 0x05 0x01 0x00 OxDD 0x89 OxBB 1 Launch Video 2 Play Resume OxDO 0x05 0x02 OxDD 0x89 OxBB Video 3 Pause Video OxDO 0x05 0x03 OxDD 0x89 OxBB We also provide remote control playback capabilities All you need is put the file in the path after mnt sdcard video or mnt sdcard DCIM give a filename and your device
63. e position of your screen position according to the button size specificed 2 ICNImageButton Object Page 74 2000 2012 Copyright IC Nexus Corporation All rights reserved Every ICNImageButton object is corresponding to each button you see in the GUI To use new to construct it you need the current activity and button id The button id is an integer number Every button must have a unique number When you click one button the system service will use it to make and send bottom down commands to your smart display void ICNElevator addButton ICNImageButton It adds an image button to the ICNElevator manager ICNImageButton ICNElevator getButton int i Integer i starts from 0 This is just an index which the image button has been added to This function gets the ICNImageButton object void ICNImageButton setClickedlmageld int iid Integer iid is a drawable id stored in the res folder You assign your button with a specified picture When you click the button it will display that picture void ICNImageButton setFontSize int size The integer size is your font size You should use a good font size for your text or number so that it would look compatible with your button void ICNImageButton createButton IBInfo ibinfo Using createButton with the IBInfo object you can generate a button body The IBInfo object constructor needs the following input parameters int x the x coordinate int y the y coordinat
64. e upper left corner of screen int x the x coordinate of the view window int y the y coordinate of the view window int w the width of the view window int h the height of the view window Ac NL Page 81 2000 2012 Copyright IC Nexus Corporation All rights reserved Application with Drag and Drop Ul package icnexus smartdisplay import icnexus sample draganddrop R import icnexus smartdisplay import import import import import import import import import import import import import icnexus android android android android android android android android android android android android smartdisplay service app Activity graphicos color os Bundle util Log view MotionEvent view View view View OnTouchListener widget widget widget widget widget ImageView RelativeLayout TextView Toast RelativeLayout LayoutParams public class SampleUserDragAndDropActivity extends ICNService Binding RelativeLayout rlv final int imgw 100 imgh 100 public class UserlImageButton extends ICNImageButton implements ICNImageButtonCB public UserImageButton Activity act int bid super act bid public void buttonDownCallback Log v UserImageButton buttonDownCallback got public void buttonUpCallback I Log v UserImageButton buttonUpCallback amp 7 37 exit Override protected void onCreate
65. eButton will create a new image button based on the parameters of IBInfo set Text will specify the text content of the image button ib setFontSize 60 ib createButtonrihbi ib setText Exit NNN 18 In the onCreate put the view objects of cChartView and ib inside the addView function Then add view objects to the already established rlv relative layout rlv addView ccChartVisew rlv addview ihbl setContentViewlrlv 19 Inthe onCreate add setContentView rlv riv means the relative layout rlv addView ccChartVisew rlv addViewrih setcontentView irls 20 In the onCreate add init parameter1 parameter2 Fill in the riv relative layout in parameter2 and the Command ID of ICNService in parameter 1 init iCNService ICN COMMAND ID ICN CHART DEMO Log Fi Samplethart iontreate Ehindosrvice isa hindService i 21 In the onCreate add bindService initi ICHService ICN COMMAND ID ICN CHART DEMO riw Log Fi Samplechart i iontcreate BEAIndoserwvloOs8 lt a I hindService i 22 In the SampleDigitalSignage override the onDestroy function Hovwerride protected void onbestroy i TODO uto generated method stub unbindSeryvice Log ri SamplecChart onDestroy unbindService done super onDestroyll 23 In the onDestroy function add unbindService and super onDestroy Page 44 2000 2012 Copyright IC N
66. eItem item To make an item draggable 3 void OnDropped ICNDropZone zone ICNDraggableItem item In the DragZone drop the ICNDraggableItem 1 ICNDropZone zone Define a zone for ICNDrop Any draggable item dropped to this zone will be deleted permanently 2 ICNDraggableItem item To make an item draggable 4 ICNDraggableItem ICNDraggableItem v ICNDraggableViewsFactory getImage imgw imgh R drawable android 128 Bind these two items Android object OnTouchListener and ImageView together so that both of them can become ICNDraggableItem at the same time 1 v Draggableltem source 2 imgw the width of Draggableltem 3 imgh the height of Draggableltem 4 R drawable android 128 To make the picture as an Draggableltem 5 static ICNDragAndDropManager getInstance startDragging this draggedItem Starts dragging an draggeditem 1 draggedItem To make an item draggable 6 void dragPictureAndDropToTrash Click on a draggable item and drag it into the trash Page 86 2000 2012 Copyright IC Nexus Corporation All rights reserved Page 87 2000 2012 Copyright IC Nexus Corporation All rights reserved static ICNDragAndDropManager getInstance init dragSurface initializes dragSurface Digital Signage package icnexus smartdisplay import import import import import import import import import import import import import import import import import import import imp
67. eate a UserImageButton function and add a super In the class User ImageButton create a buttonDownCallback function In the class UserImageButton add buttonUpcallback function and exit D public class UserlmageButton extends ICNImageButton implements ICHImadgeButtoncE public UzserlImadgeButton ictivity act int hid I super act bid H public void buttonDowncallbacki Log r UserlImageButton hurttonDovuncallback j I public void buttonUpCallbacki Log vi User ImageButton burtonUpCallback 1 exitii Page 46 2000 2012 Copyright IC Nexus Corporation All rights reserved 5 Create a new function named dragPictureAndDropToTrash This will initialize a draggable item a dragged zone and ICNDragSurface public void dragPicture indbropToTrashil IcCHDragsSurtface dragSurtface new ICNDragqsurtace this dragourface setLayoutParamsinew LayoutParamsi LavourtParams PFILL PARENT Layo m IcCHDrag ndDropManager dgetiInzstance l init dragSurtfacse 6 In the dragPictureAndDropToTrash function add a dragsurface next to ICNDragSurface and give it a property public void dragPicrure ndPropToTrash i ICMDradgSurface dragsurface new ICNDPraqgsurtace this dragsurtace setLayoutParams new LavoutParamsiLayoutParams FILL PARENT Lawc ICHDrag ndPropManager dgetinstanceil init dragasurface 7 1 Inthe dragPictureAndDropToTrash function add a new trash icon for ImageView named tra
68. ect from an archive file This archive file includes various NSD smart display applications such ICNMain ICNService ICNChartDemo ICNClock and ICNDraw If there are no error messages from Eclipse you can now select ICNMain Press the Run button to install the smart isplay app on your Android device Page 66 2000 2012 Copyright IC Nexus Corporation All rights reserved TS ICNChartDemo T ICNClock TS ICNCmd Emulator E ICNDragAnd Drop TS ICN Draw T ICNFileBrowser 7 3 ICNFileContent TS ICNImageButton peg CN Main 33 ICN MediaPlayer 15 ICNService 48 ICN Ticker Figure 5 1 gS ICNChartDemo H S ICNClack 8 35 ICNCmdEmulator e ICNDragAndDrop TE ICNDraw m ICN FileBrowser 45 ICNFileContent 8 5 ICNImageButton gt ICNMain MIC NService 45 ICN Ticker Figure 5 2 E m ICNC hartDemo ed ICNCIock m ICN md Emulator eg CN Drag And Drop peg ON Draw E i gt ICN FileBrowser vS ICHFileContent ICNImageButton 4 ICNMain is ICN MediaPlayer 48 ICNService 3 ICN Ticker ES MainMenu Figure 5 3 search Project Refactor Ron Window Help amp eb gu d 9 e mt H8 G Figure 5 4 Page 67 2000 2012 Copyright IC Nexus Corporation All rights reserved Wait until your device displays a screen image like the one in figure 5 5 to finish the installation process Service Controller Start COM Port Service Stop COM Port Service Figure 5 5 At this point you can press the Start Com
69. ed Annotation Source Folder Java Working Set Folder Convert Line Delimiters To d Select Create project from existing source and input ICNMain as the Project Name You can change the project name afterwards Create Android Project A project with that name already exists in the workspace Project Name ICNMain Create new project in workspace Create project from existing source Create project from existing sample Location install eycwwen 9 NOE Working sets Add project to working sets AN d a i N mu e Then enter the path name of your project directory into the textbox next to the Location field or click the Browse button to search your project s file location The picture above shows a sample of how the project file ICNMain is created Note If a dialog An Eclipse project already exists in this directory appears at the top of the Page 54 2000 2012 Copyright IC Nexus Corporation All rights reserved window consider using File Import Existing Project instead Please continue to follow the steps described in this manual There is no need to operate the system in accordance with other additional specifications offered by external sources Project Name ICNClock Create new project in workspace Create project from existing source Create project from existing sample Jse default location Location home mark workspace ICNClock
70. ed private int int int int int void TickerSetting l textColor Color RED backgroundColor Color TRANSPARENT textsize hackgroundWidth 800 backgroundHeight 150 x O y 0 ani begin x 1000 ani end x 240 ani begin y 580 ani end v ani duration 20000 ani repeat time 1 String textData Smart Display tinfolist new TickerInfoltextColor backgroundcColor text3ize hackgroundWidth backgroundHeight my Wy ani begin x ani end x ani begin y ani end v ani duration ani repeat time textData Parameter definition textColor Ticker s text color backgroundColor Ticket s background color textSize Ticker s font size backgroundWidth the width of Ticker s background backgroundHeight the height of Ticker s background x Ticker s y Ticker s ani begin x corner ani end x ani begin y corner ani end y Ticker s y coordinate of the end point at the ani duration Ticker s x coordinate of the end point at the X coordinate of the upper left corner y coordinate of the upper left corner Ticker s x coordinate of the starting point at the upper left upper left corner Ticker s y coordinate of the starting point at the upper left upper left corner the time Ticker takes to complete the whole path ms ani repeat time the number of times Ticker has run 1 implies infinity textData the text content of Ticker 2000 2012 Copyright I
71. essage e video info record private void init video info record vWidth mVideoView getWidth vHeight mVideoView getHeight private void startplay mvideoView start private void pauseplay mVideoView pause Override public void onCreate Bundle savedInstanceState super onCreate savedInstanceState TickerSetting ClockSetting Page 94 2000 2012 Copyright IC Nexus Corporation All rights reserved rlv new RelativeLayout this imagePlayer new ICNImagePlayer this ImagePlayerSetting mTicker new ICNTicker this tinfolist mClock new ICNClock this cinfolist mVideoView new VideoView this MN NN mMediaController new MediaController this mMediaController setAnchorView mVideoView mVideoView setOnCompletionListener new OnCompletionListener Override public void onCompletion MediaPlayer arg0 Log d SampleMediaPlayer video path finish resetMedia 3 1 mVideoView setOnPreparedListener new MediaPlayer OnPreparedListener Override public void onPrepared MediaPlayer mp TODO Auto generated method stub Log d SampleMediaPlayer onPrepared init video info record mVideoView start j mVideoView ChangeDisplayMode 0 prepare the play Gp playback HR rlv addView mClock rlv addView mVideoView rlv addView mTicker rlv addView imagePlayer setContentView rlv init ICNServic
72. exus Corporation All rights reserved EV override protected void onDestroyi JD Auto generated method stub unbindService l Log ri SampleChartr onDestroy unbindService done super onDestrrov l 2000 2012 Copyright IC Nexus Corporation All rights reserved Page 45 SampleUserDragAndDrop This section will introduce you how to add applications in the UserDragAndDrop Project 1 Create a new Project named SampleUserDragAndDropActivity and extends it to ICNService Binding iT 1 1 Tu uh Fimport itnexus smartdisplay Itn Pelo a ai as Po ah Pao Po Pa Pe Pe Pe Pe Pe PR public class SampleUserDrag indDrop ictivity extendsiICHService Bindindg RelativeLayout riw final int imgw 100 imgh 100 LILL 2 Add a new relative layout e 7 1 wv wy Pimport icnexus smartdisplay public class SampleUserDrag ndDropA ctivity extends ICNService Binding i RelativeLayout rly final int imgw 100 imgh 100 lll 3 Create a class named UserImageButton and extends it to ICNImageButton T public class User ImageButtonj extends ICNImagebutton implements ICHImadgeButtoncE HIO LE public UzserImadgeButton ictivity act in super act bid H z public void buttonDowncallbacki 4 Log r UserlImageButton hurttonDovuncallback j I E public void buttonUpCallbacki Loag r UserlmageButton burtonUpCallback 1 exitii 4 In the class UserImageButton cr
73. exus smartdisplay 3 ICNCOMPortServiceMgr java p ICNNetworkServiceMgr java Jf SampleChart java JJ SampleDigitalSignage java LL SampleMediaPlaveriava a zi ICNMain Show View as a Fast View r 13 Package Explorer 2 ipt gt i ApiDemos Devices Q Emulator Control ig File Explorer g Heap s Layout View il LogCat deprecated amp Pixel Perfect A Pixel Perfect Loupe R Pixel Perfect Tree Resource Explorer M Mana m OE Page 64 2000 2012 Copyright IC Nexus Corporation All rights reserved Page 65 2000 2012 Copyright IC Nexus Corporation All rights reserved Chapter 5 Remote Control How to Run Commands on the NSD Smart Display Outline Task preparation Hardware Connect your Android device to your computer s USB port Connect your Android device to an external USB device using RS232 device Software Install the NSD Smart Display on your Android device Install a serial port terminal software that has the capability to send hexadecimal messages to your computer The introduction of the Smart Display commands Task preparation Connect your Android device to your computer s USB port Connect your Android device to an external USB device using RS232 device Install the NSD smart display App on your Android device Please follow the steps below to import an entire Eclipse proj
74. for other updates and the add ons to Eclipse from the Help menu at regular intervals Available Software Check the items that you wish to install m DEC Work with Aptana http download aptana com tools studio plugin install studio E7 aditum Find more software by working with the Available Software Sites preferences d AAGE ps ME st NE TD i00 Aptana Studio 4p Aptana Studio Details amp j Show only the latest versions of available software Group items by category 2 0 5 1278522500 5 7857H 97CFF61HN1HZH Show only software applicable to target environment W Contact all update sites during install to find required software Hide items that are already installed What is already installed Figure 2 6 Aptana 2000 2012 Copyright IC Nexus Corporation All rights reserved Page 9 Step 3 The steps to update Eclipse are very similar to those described in the previous paragraphs The only difference is the name and location where you obtain the update The Eclipse Project Updates http download eclipse org eclipse updates 3 7 Available Software Check the items that you wish to install 8 i Work with The Eclipse Project Updates http download eclipse org eclipse updates 3 7 A uaa mj Find more software by working with the Available Software Sites preferences F Name l Version ill Eclipse Platform 100 Eclipse Platform SDK
75. goument ang ETL Es De d HL WOLD pial E Working sets Add project to working sets WI thle Tf E New Android Project Select Build Target Choose an SDK to target Build Target C Google APIs C Android 1 6 C Google APIs C Android 2 1 C Google APIs C Android 2 2 C Google APIs C Real3D Add On C GALAXY Tab Addon Android 2 3 1 C Google APIs 2 Android 2 3 3 C Google APIs C DTS Add On EDK 11 C Android 3 0 C Google APIs C Android 3 1 C Google APIs C Android 3 2 C Google APIs Android Open Source Project Google Inc Android Open Source Project Google Inc Android Open Source Project Google Inc LGE Samsung Electronics Co Ltd Android Open Source Project Google Inc Android Open Source Project Google Inc KYOCERA Corporation Sony Ericson Mobile Communications Android Open Source Project Google Inc Android Open Source Project Google Inc Android Open Source Project Google Inc Plat onn Standard Android platform 2 3 3 Select Android 2 3 3 and click Next 2000 2012 Copyright IC Nexus Corporation All rights reserved Page 27 E New Android Project Application Info Configure the new Android Project Application Name Test Package Name icnexus smartdisplay Create Activity Test ctivity Minimum SDK 10 Create a Test Project Toss mean F arnt I hulter
76. h resolution TFT LCD module with touch panel a high performance ARM1176 processor and an Android operating system NSD can work as a display device with various terminal ports such as low speed RS232 RS485 and high speed USB to process commands from an 8 bit MCU or 32 bit CPU The commands include launching applications in NSD to run texts images videos and 3D animation display tasks This feature helps product developers to rapidly integrate this TFT LCD module to their equipment without modifying or upgrading hardware and processor Typical applications include an elevator display home electronics touch control panel industrial equipment display rack mount server display and exercise equipment display NSD is also capable of running as a standalone Android device with a touch screen LCD and high performance ARM processor Typical application usages include digital signage devices multimedia players POS system vending machines home automation console and vehicle infotainment system Since NSD is an Android based open system many development tools and open source resources are available to use for product development Developers can obtain a huge amount of free resources to enable them quickly complete the product design This makes NSD superior to other competitors who use proprietary systems The NSD series is available with display sizes ranging from 3 5 to 10 1 LCD Other LCD sizes can also be made available with prior custome
77. ights reserved Adding Extended JAR files to your project a In the Eclipse Package Explore view right click the ICNMain folder to open the properties dialog box Paste Ctrl V Delete Delete r Run Window Help Build Path er sh di Gr Sie amp 528 Source SN Refactor import Export EA o 5 Refresh Close Project Close Unrelated Projects Run As Debug As Command Line Shell Explore Files Copy path s to clipboard Team e bin Assign Working Sets Compare With Restore from Local History artDemo bin PyDev j Android Tools Configure Select Java Build Path from the context menu on the left and click the Libraries tab type filter text 4 Java Build Path ay gt Resource Android Source L3Rrojects m libraries Order and Export Builders JARs and class folders on the build path CSS Code Formatter i achartengine 0 7 0 jar ICNMain HTML Code Formatter BA Android 2 3 3 Java Build Path m ICNServiceLib Java Code Style m Library Projects Add Variable Java Compiler Java Editor Javadoc Location AddClass Folder JS Code Formatter Project Natures Add External Class Folder Project References Refactoring History Run Debug Settings Task Tags XML Code Formatter Jigete A XML Syntax i This image is for reference only Page 57 2000 2012 Copyright IC Nexus Corporation All r
78. ights reserved b If you would like to add a JAR file to an already existing Java library in Eclipse press Add JARs gt JAR Selection Choose the archives to be added to the build path ROME tS ICNChartDemo Android tS ICNCIock Builders l ICNCmdEmulator ICNDragAndDrop l ICNDraw Java Build Path t ICNImageButton Java Code Style CT Java Compiler tS ICNMediaPlayer Java Editor 3 ICNService Javadoc Location G8 ICNTicker js code Formatter amp SampleMediaPlayer Project Natures Project References CSS Code Formatter HTML Code Formatte xg a Refactoring History Run Debug Settings Remove Task Tags a XML Code Formatter igrate JAR File Under most situations JAR files will appear inside the bin folder Set ICNChartDemo for example see picture below X JAR Selection Choose the archives to be added to the build path Resource 3 Android 2 ICNChartDemo Builders 7 amp bin CSS Code Fo tj amp classes Permer HTML Code Fo icnexus d Path amp res 3 IR L rade Java Code Styl classes dex ICNChartDemo apk Java Compiler Java Editor MGdienchartdemojan E Sj resources ap_ Javadoc Locati JS Code Forma B vssver2 scc Project Natures amp gen Project Refere it S res Refactoring His t md 25 Edit Run Debug Seti X classpath v SBA
79. imagePlayer addImage R drawable p4 imagePlayer addImage R drawable p5 imagePlayer setWindowRange 350 60 600 500 imagePlayer setSlideShowTime 6000 try imagePlayer run catch java lang OutOfMemoryError error Toast makeText this Out of Memory 3 video play private void playback if path Tell the user to provide a media file URL path Toast makeText this Please edit VideoViewDemo Activity and set path variable to your media file URL path Toast LENGTH LONG show else Alternatively for streaming media you can use mVideoView setVideoURI Uri parse URLstring E resetMedia 3 mVideoView setVideoPath path mVideoView setMediaController mMediaController Page 90 2000 2012 Copyright IC Nexus Corporation All rights reserved mVideoView requestFocus video path issue private void resetMedia Integer Media Parameter Media play data from which type x setMediaVideoPath Media try mVideoView setVideoPath path catch IllegalStateException e TODO Auto generated catch block e printStackTrace private void setMediaVideoPath Integer Media try Switch Media case LOCAL VIDEO TODO Set the path variable to a local media file path P path sdcard video BBCexample flv if path Tell the user to provide a media file URL Toast makeText this Please edit
80. import icnexus smartdisplay ICNDraw ICNTextView import icnexus smartdisplay service ICNService import android graphics Color import android graphics Paint import android graphics Rect import android os Bundle import android os Handler import android util DisplayMetrics import android widget RelativeLayout public class ICNUsageGUI extends ICNService Binding Called when the activity is first created ArrayList ICNRegionView cpuUsageGUIList new ArrayList lt ICNRegionView gt ICNRegionView cpuUsageBk ICNTextView cpuTitleText cpuUsageText Page 109 2000 2012 Copyright IC Nexus Corporation All rights reserved ArrayList ICNRegionView memoryUsageGUIList new ArrayList lt ICNRegionView gt ICNRegionView memoryUsageBk ICNTextView memoryTitleText memoryUsageText memorySizeText final int LIGHT LEVEL 20 int LIGHT WIDTH 50 int LIGHT HEIGHT 10 int LIGHT DISTANCE Y int LIGHT DISTANCE X int USAGE TEXT SCOPE WIDTH int USAGE TEXT SCOPE HEIGHT int USAGE TITLE SCOPE HEIGHT int USAGE SCOPE EDGE 15 long Mem Used 0 int screen width screen height public RelativeLayout rlv main private DisplayMetrics dm private int RefreshTime 1500 private Handler handler new Handler public static enum ICN MEM UNIT ICN MEM KB 1 ICN MEM MB 0 ICN MEM GB 1 ICN MEM TB 2 private int value private ICN MEM UNIT int value this value value static ICN
81. int bkcolor Paint Style style To create a circle view float x the x coordinate of the center of the circle to be drawn float y the y coordinate of the center of the circle to be drawn int r the radius of the circle to be drawn int color the color of the circle Paint Style style three styles you can set FILL STROKE FILL AND STROKE Please refer to the android official website fore more information http developer android com reference android graphics Paint Style html ARLUN 2 void ICNRegionView appearedMode int ms When the appeared mode is set the view area will gradually fade in from the behind You can change the alpha values of the individual pixels 1 int ms Use this to control the speed of the changing alpha values The unit is in millisecond 3 void ICNRegionView disappearedMode int ms To set it to appeared mode the view will gradually disappear It works by the changing alpha value of the pixels 2 int ms The speed of changing alpha value can be controlled by it The unit Page 80 2000 2012 Copyright IC Nexus Corporation All rights reserved is in millisecond void ICNRegionView run After calling ICNRegionView it will start executing the display mode the appeared or disappeared mode you have set void ICNRegionView setWindowRangef int x int y int w int h You can use this to decide the view with specified position and size in your screen The coordinate origin is at th
82. int x int y int w int h Specify the location length and width for the image player 1 x The image player s x coordinate of the upper left corner 2 y The image player s y coordinate of the upper left corner 3 w the width of the image player 4 h the height of the image player 6 void setSlideShowTime int time 1 time the time the image player takes to replace a picture ms 7 ICNImagePlayer run Page 97 2000 2012 Copyright IC Nexus Corporation All rights reserved Set when the image player starts operating Chart package icnexus smartdisplay import import import import import import import import import import import import import import public private IDemoChart private IDemoChart mCharts private String private String private Handler handler org achartengine GraphicalView android os Handler android app Activity android graphics Color android os Bundle andrordgutil Lhodg android widget RelativeLayout android widget RelativeLayout LayoutParams IDemotcharts SalesGrowthChart ChartInfo SampleUserDragAndDropActivity UserlImageButton icnexus smartdisplay icnexus smartdisplay icnexus smartdisplay icnexus smartdisplay icnexus smartdisplay service java util Vector class SampleChart extends ICNService Binding mCharts new SalesGrowthChart new SalesGrowthChart new IDemoChart mMenuText mMenuSummary
83. isplay modes the origin natural size full screen fixed length to width ratio custom size screen fixed length to width ratio and free size you may set the length and the width any form you like The video display modes range from O to 3 It is recommended that you choose 2 custom size screen mVideoView ChangeDisplayMode 2 mua geoumew servrdeoscsdet 129 05 Now you can add the VideoView to your Layour Then declare it as Class rlv addView mVideoView setContentView rlv The above explains how you can specify the position of and resize your video Part of the methods are created and owned by ICNexus If you need other functions you may also try to edit on your own 3 3 f Playback control This section tells you how to control playback of your media files such as setting a looping order play pause and next previous Here we will use some examples which you can apply to a variety of tasks such as modifying your playback sequence adding more media files during the running time and exchanging media files Below are the examples Please note that we did not provide the full source code If you would like to view the full code please refer to your JAR files zi orke Och sob ctore Ted re D private void resetMedia Integer Media Page 106 2000 2012 Copyright IC Nexus Corporation All rights reserved C private void setMediaVideoPath Integer Media a Confirm the path for the file This process appears once e
84. kage from the device k means keep the data and cache directories Return all information from the device that should be included in a bug report Show this help message Show version number 2000 2012 Copyright IC Nexus Corporation All rights reserved Page 25 Android Development Toolkit An Android project is designed as a library project which acts a container for your application s source code resource files and files During the build process your Android project will eventually be compiled and packaged into an apk file so that you install onto a device To create a new Android project go to File gt New gt Project gt Open the Android Folder gt Select Android Project gt Click the Next button di 3 Project Select a wizard 2 Java Project XE Java Project from Existing Ant Buildfile G Plug in Project E General Jg Android Test Project E 1 Code Samples Ei zm C H LE Java E E Plug in Development E 13 PyDey Ei 2 Web Exemples Case1 Create new project in workspace Page 26 2000 2012 Copyright IC Nexus Corporation All rights reserved amp New Android Project Create Android Project Select project name and tvpe of project Project Name test Create new project in workspace O Create project from existing source Create project from existing sample Use default location ath ja Ai
85. l CPU ABI se valid Android Virtual Device M repairable Android Virtual Device X An Android Virtual Device that failed to load Click Details to see the exor The AVD Manager You are free to create as many AVDs as you would like to test on but it is recommended that you should choose a higher API level to test on than the target API level for your application Please note that it is impossible to run the API level that is lower than that required by your target application on a system image To create an AVD 1 Inthe AVD Manager panel click New to bring up the Create new Android Virtual Device AVD dialogue 2 Typically you will just fill in the Name and Target fields for basic AVD configuration The rest fields will be completed automatically with default values when you select the API level to which you want to test against in the Target field The AVD can be further customized if needed Page 30 2000 2012 Copyright IC Nexus Corporation All rights reserved Create new Android Virtual Device A D Name test Target M CPU ABI SD Card Size C File Enabled Built in Default WVG A800 Resolution Property Valve Abstracted LCD density 240 Max VM application heap size 24 Device ram size 256 3 Click Create AVD Your AVD is now ready 4 Select the AVD you just created and click Start to launch the emulator App Content Graphics Media
86. l website fore more information http developer android com reference android graphics Paint Style html QA c5 NS Page 116 2000 2012 Copyright IC Nexus Corporation All rights reserved Appendix B NSD API Categories The Smart Display API is a set of interfaces that describes the programming instructions provided by Android for accessing software applications API categories are major functional categories defined by Java classes They are as follows Elevator Graphical Drawing Media Player Ticker Clock Drag And Drop Feature and Chart etc Android apk and jar files Android application package file APK is the file format used to distribute and install application software and middleware onto the Google s Android operating system We provide an apk file called ICNMain apk to hold of all the sample codes written in Java programming languages you need to run your Android deivce JAR for Java Archive is an archive file format typically used to aggregate many Java class files into one file to distribute libraries Our JAR include many libraries such as ICNService ICNImageButton ICNDraw ICNChart ICNClock ICNTicker ICNMediaPlayer and ICNDragAndDrop Every library here is an android library project You can manage such projects from Eclipse with ADT Please refer to android official link http developer android com guide developing projects projects eclipse html Events An event represents all activity that goes
87. ls Dr android sdk windows platform tools Variable Value ComSpec EN WINDOW S system3ecrid exe FP MO HOST C NO NUMBER OF P 2 05 Windows NT Figure 2 13 Add Android SDK path into a Windows XP Page 15 2000 2012 Copyright IC Nexus Corporation All rights reserved Installing ADB and a USB Driver for an Android device NSD has specific set of architecture views so please follow the steps below to guide you through the installation process For Windows operating environment in Windows XP SP3 1 Make sure your PC already downloaded the Google USB Driver package using the Android SDK Manager y Android SDK Manager Packages Tools SDE Path Packages Name ll Android 2 3 3 API 10 x E Android 2 2 API 8 Jie Android 2 1 API 7 x El Android 1 6 API 4 x l Android 1 5 API 3 lu Extras QBA Ando Support package 88 Google Admob Ads Sdk package GR Google Analytics Sdk package GB Google Market Bulling package 88 Google Market Licensing package C PE Google USB Driver package C 188 Google Webdrrver package 8 Usb package gt Aotmstalled amp Notustalied Hot smstalled amp Aot installed Aotmstalled fy Installed amp Not mstalled ffo Installed why Bee hy A a wv Show Updates New Installed Obsolete Select New or Updates Install 6 packages Sort by API level Repository Deselect All Done loading packages
88. ls Windows 64 Bit Software User Agreement unless atherwise specified Eclipse Classic 3 7 1 174 MB Windows 32 Bit Downloaded 1 180 581 Times Details Other Downloads Windows 64 Bit A Sauish Figure 2 1 The download page ay Actuate BIRT iServer Promoted Download RE Schedule distribute amp secure BIRT output plus dashboards analytics and more To save your download time a version of Eclipse is included in the NSD software DVD In the DVD locate the folder with Eclipse name and change to the folder that matches operating system Windows or Linux and CPU x86 for 32 bit and x64 for 64 bit CPU of your development PC After unpacking the contents and entering the Eclipse folder you will see an executable file called Eclipse exe in Windows Note There are no filename extensions in Linux You should be able to start the program by double clicking the Eclipse exe file If an error message Java not installed appears while you attempt to start the program please perform a self installation on the latest JRE Java Runtime Environment and JDK Java Development Kit You can find a direct link to download Java at the Hints section on the right hand side of the Downloads Page Figure 2 1 Linux users can follow the steps below to install SUN JRE Page 5 2000 2012 Copyright IC Nexus Corporation All rights reserved 5 sudo add apt repository ppa sun java community team sun javao S sudo apt get update
89. ment variables The Environment variables dialog box lists two kinds of variables the upper one is for the current user setting and the lower one applies to the whole system Add the system variables only if you do not know what you are up against Figure 2 13 Locate the Path variable Double click Path or click Edit to change its value to D Nandroid sdk windowsNtools D Nandroid sdk windowsNplatform tools After you have done that start Eclipse SDK System Properties System Restore Automatic Updates Remote General LomputerName Hardware You must be logged on as an Administrator to make most of these changes Performance Open Visual effects processor scheduling memory usage and virtual memory Settings Explore Search Manage User Profiles Map Network Drive Desktop settings related to your logon Disconnect Network Drive Settings Create Shortcut Delete Rename Startup and Recovery System startup system failure and debugging information Settings Environment Variables Il Error Reporting Properties Page 14 2000 2012 Copyright IC Nexus Corporation All rights reserved Environment Variables User variables for alice lin Variable Value E Documents and Settirigstalice JiniLoc E Documents and Settings alice linjLoc Edit System Variable New L ge Delete Variable name Path System variables Variable value o
90. meter objects for Ticker and Clock Name them as tinfolist and cinfolist respectively Page 33 2000 2012 Copyright IC Nexus Corporation All rights reserved ICMTicker mTicker ICHClaock mcClock private TickerlInfo tinfolist private ClockInfo cintolist private VideoView mvideoVisew private MediaController mMediacController public RelativeLayout rlw 4 Create a relative layout ICN ImagePlayer imagePlayer private TickerInfo tinfolist m private ClockInfo cinfolist private VideoView mvideoView private MediaController mMediacontroaller reading file path private String path tnar abana C ee Tmt l c 5 1 Add a function parameter named TickerSetting for Ticker ome Pa AIC JJ r t private int Height 0 La private void TickerSettingi i int textColor Color EED backgroundcolor Color TEANSPARENT text2izt int backgroundWidth 800 backgroundHeight 150 int x 0 y O int ani begin x 1000 ani end x 240 ani begin y 580 ani end v i int ani duration 20000 ani repeat time 1 String textData Smart Display tinfolist mew TickerInfoltextColor backgroundcolor textsize backgroundWidth backgroundHeight X WW ani begin x ani end x ani begin y ani end v ani duration ani repeat time textDbata private void TickerDatasetting String text i CIintolist texthata text 5 1 1 Set parameters Page 34 2000 2012 Copyright IC Nexus Corporation All rights reserv
91. n groumdfie igit amp B Lies foe n gi Dnm i be n agi D ot i dur b D Ris tiber E ie e farm D T0 m Jd ol HM ncn or peed di _ tim gm pre Oar 282 ware I riun er eed UN cf EI fl nil n n Pamma Fut Meroen amp Pema 0 if 2077 did INT Vna He zu me Vi Baa id Sy betes bil Failing inet ti Inan La Laj Once the Finish button is clicked the New Android Project wizard will create a new project for you Now you can click the Run icon for the Eclipse to go through the compile and deploy process The Eclipse will then launch an emulator opening up a window showing a mock up of an Android mobile device if the emulator has already been configured on your development machine If it has not please refer to the following step to install your first Android Virtual Device AVD Page 29 2000 2012 Copyright IC Nexus Corporation All rights reserved AVD configuration An Android Virtual Device AVD is an emulator that lets you create a virtual output of the Android mobile interface by defining its hardware and software options The easiest way to configure your AVD is to use the AVD manager To start the AVD manager you can either go to Window gt AVD Manager in Eclipse or run the android tool on the command line 4 Android Virtual Device Manager PEE List of existing Android Virtual Devices located at E Documents and Settingstalice nt androidtavd AVD Name Target Name Platform APT Leve
92. ndow click the Android option from the context menu on the left t Q Properties for ICNMain ity e niter text d Android Resource Android 3 2 Android Open Source Pro 3 2 13 Buil d tspngie APIs oom Inc 3 2 13 CSS Code Formatter Android 4 0 Android Open Source Pro 4 0 14 HTML Code Formattei Google APIs Google Inc 4 0 14 Java Build Path Java Code Style Java Compiler Library Java Editor Is Library Javadoc Location JS Code Formatter Project Natures Project References Refactoring History Run Debug Settings Task Tags XML Code Formatter XML Syntax Resource Builders JICNService v G 20 Project Selection ICNDraw ICNDraw JICNChartDemo ICNChartDemo ACNClock ICNClock Li ICNMediaPlayer ICNMediaPlayer JICNTicker ICNTicker CNDragAndDrop ICNDragAndDrop Android Please select a library project ICNService Protect MJ CSS Code Fo Java Build Pa Java Code Sty Java Compile Java Editor Javadoc Locat Project Nature Project Refere Task Tags XML Code Fo XML Syntax amp HTML Code Fd i ICNChartDemo Run the Application Please ensure that your development platform is already connected to your workstation and this can be normally done via the USB cable Page 61 2000 2012 Copyright IC Nexus Corporation All rights reserved Select the project name you want to edit in this case
93. ne of the easiest platforms to develop applications for mobile devices it is not without its flaws As you are bound to face bugs when creating your applications you need a good debugging tool We will use the Android Debug Bridge ADB to run on both your android emulator and your development computer to debug a problem with the output of the adb logcat command on Eclipse To enable logcat in Eclipse for Android press the button Show View as a Fast View at the bottom left of the main Eclipse window and select Logcat But if you did not see the Logcat option on the list then go to Others Android gt Logcat File Edit Scripts Source Navigate Search Project Refactor Run Window Help riv BE Sad rOrar amp Gy f v a Gv Y dev Sv Package Explorer 23 i ApiDemos Ant Console Declaration Error Log Javadoc ge OE Navigator Package Explorer Problems Progress Project Explorer Search asks Templates Type Hierarchy Page 63 2000 2012 Copyright IC Nexus Corporation All rights reserved civ Busi d Y Orgy Ee r Do v v mY cuv Auc a2 T i Package Explorer 5 T p i ApiDemos y ICNChartDemo g ICNClock ys ICNCmdEmulator t ICNDragAndDrop 3 ICNDraw ia ICNFileBrowser 9 ICNImageButton gi Android 2 3 3 m Library Projects m Referenced Libraries es achartengine 0 7 0 jar src B icn
94. new Handler private Chartlnfo cinfolist private Vector lt Double gt XAxie private Vector lt Double gt YAxie private Vector Double DataYAxie new Vector lt Double gt new Vector lt Double gt new Vector lt Double gt String ChartTitle Chart Demo XName X YName Y String ChartExplain Random value chart diagram double XMin 0 XMax 20 YMin 0 YMax 15 int ColorAxes Color LTGRAY ColorLabel Color YELLOW int Colorthart Color BED ColorBackguground Color rgbD l00 50 200 int XRangeNum 5 YRangeNum 5 boolean ShowGrid false BackgroundColorApply true boolean ZoomButtonsVisible false ShowLegend false boolean ShowAxes true ShowLabels true Page 98 2000 2012 Copyright IC Nexus Corporation All rights reserved float ChartSmoothness 0 33f int XAxieNumber 21 int YAxieNumber 21 int ChartRefreshTime 500 public GraphicalView cChartView public RelativeLayout rlv protected LayoutParams mlp int InputDataSize 0 LBINfto 15902 UserImageButton ib public void info_update cinfolist new ChartInfo XMin XMax YMin YMax ColorAxes ColorLabel ColorChart ColorBackgground XRangeNum YRangeNum ChartSmoothness ShowGrid BackgroundColorApply ZoomButtonsVisible ShowLegend ShowAxes ShowLabels ChartTitle XName YName ChartExplain public Runnable showTime new Runnable public void run chart update E
95. one sone ICHDraggableltem item zone gqgetView setBackgroundcColor Color parseColor 59859898 Toast makeText SampleUserDragandPropactivity this Dropped 1000 sahog rlv removeAllViewsi rlv removeviewv iti ll String className new Stringi icnexus smartdisplav SsmplelserbragindbDr sendUserData classMame userdata 8 serconrtentVview rily 19 In the onCreate call the dragPictureAndDropToTrash function that has already established in step 5 L3 dragPicture ndDropToTrashi 20 In the onCreate add init parameter1 parameter2 Fill the x1v relative layout in parameter2 and the Command ID of ICNService in parameter 1 Mae the demo app as ICN DRAG AND DROP DEMO LIL init ICNJervice ICN COMMAND ID ICN DRAG AND DROP DEMO rlw 21 In the onCreate add bindService utv TpleTeEr FSP NNN VILA LERRET BLIBOSEFWViCB s bindServicetl m 22 In the SampleUserDragAndDropActivity override onDestroy function Page 50 2000 2012 Copyright IC Nexus Corporation All rights reserved direrride protected void onbestrovi i TODO uto generated method stub unhbindService LI Log ri SampleUserDbrag ndDrop ictrivity onDestroy unbindService done LLI super onDestroyvil 23 In the onDestroy function add unbindService and super onDestroy fitverride protected void onbDestrorvi DD a Eclrnenseratsd method s
96. ort import import import public class SampleDigitalSignage extends ICNService Binding java io java io java io java io BufferedReader File FileNotFoundException FileReader java util ArrayList java util List icnexus icnexus icnexus icnexus icnexus android android android android android android android android android android android android smartdisplay ICNDraw ICNImagePlayer smartdisplay ICNDraw ICNTextView smartdisplay ICNDraw R smartdisplay mediaplayer VideoView smartdisplay service ICNService app AOctTIVICYVS grapurcs color graphics Path graphics Typeface media MediaPlayer media MediaPlayer OnCompletionListener os Bundle Uti Log view ViewGroup LayoutParams widget MediaController widget RelativeLayout widget Toast Called when the activity is first created ICNTicker mTicker ICNCIOGK molock ICNImagePlayer imagePlayer 2000 2012 Copyright IC Nexus Corporation All rights reserved Page 88 private TickerInfo tinfolist private ClockInfo cinfolist private VideoView mVideoView private MediaController mMediaController public RelativeLayout rlv reading file path private String path private String lpath List String records new ArrayList lt String gt boolean SRSfreShPlayLiSEReGOrdS false boolean IsVideoStop false resource type private static final int LOCAL VIDEO 1 private static
97. p 9 Pydev and Pydev Extensions amp The Eclipse Project Updates http download eclipse org releases indigo http download aptana org tools studio plugin i http Pydev org updates http download eclipse org eclipse updates 3 7 http dev eclipse org svnroot dsdp org eclipse t http download aptana org tools studio plugin v http download aptana org tools studio plugin v httn download antana ora tools studio pluoain Figure 2 9 Available software sites v Ls Page 11 2000 2012 Copyright IC Nexus Corporation All rights reserved Android SDK Starter Package Please visit the following site to download the latest tools to perform Android SDK http developer android com sdk index html To save your download time a version of Android SDK is included in the NSD software DVD In the DVD locate the folder with Android SDK name and change to the folder that matches operating system Windows or Linux of your development PC Uncompress the zip files after the download completes See pictures below Figure 2 10 add ons docs extras platforms platform tools samples system images temp tools user_apk SDK Rahime bi I Fisourcetandroid sdkvindows f El Ga add ons tools AVD SLE di ase mr 1E trm M m eDE i Read me tet Flease open by toolsfanaroid bat B Figure 2 10 Linux A and Window B source folder snap shoots Step 1 Open up the Android SDK directory gt The Tools folder
98. r requirements This manual is intended to be used as a practical and informative guide only for the NSD smart display from the installation to the operation of the product If you have questions comments or concerns about your NSP smart display please let us know at sales icnexus com tw Thank you for choosing the NSD Smart Display Page 4 2000 2012 Copyright IC Nexus Corporation All rights reserved Chapter 2 Development Environment Setup Eclipse Download and Installation Instructions If you would like to download the latest Eclipse version please visit the Eclipse official website http www eclipse org and click the Downloads link on the main navigation bar The downloaded file comes in a zip file package Visit other Eclipse Sites e e a d CY JE mp 23 0 amp Home Users Members Committers Resources Projects About Us fel Search OTT Jb CC E o ee EL DLL 4 H 4 as Eclipse Downloads N Packages Developer Builds Projects EB Compare Packages Older Versions Ge Cru Gutt Cie windows i Hint You will need a Java runtime Eclipse IDE for Java Developers 128 MB Windows 32 Bit endr mment IRE 10 lise Eripe avo Downloaded 2 061 480 Times Details Windows 64 Bit SE 5 or greater is recommended All downloads are provided under the terms Eclipse IDE for Java EE Developers 212 MB Windows 32 Bit and conditions of the Eclipse Foundation e Downloaded 1 548 040 Times Detai
99. re cChartView cChartViey mCharts 0 change this cintolist H ie YAxiej ur Pt Pe cChartView mCharts change this cinfolist Zlxie Ylxiel nlp new LayoutParamsi500 350 mlp setMargins 250 150 0 Oj cChartVYiew setLayoutParams i imlp 15 You can add the parameters of the image button to ibi Below is the parameter definition int x the x coordinate of the image button int y the y coordinate of the image button int w the width of the image button int h the height of the image button String img to use the image name as the image button int did the numerical value in the image button int textcolor the text color of the image button FONT ID fontid the font type of the image button String text the text content of the image button Bx i Eu an ibi new IBInfo 800 400 120 100 R dravsble blue blank Color KED ICN ib new UserlImadgeButton this Oj ib setButtonUpiurortrue 16 The parameters of UserImageButtonare the id serial numbers for Activity and image button You may use setButtonAuto to decide whether image button will be automatically turned on JON button XP gg gg ibi new IBInfol S00 400 120 100 B dravsble blue blank Color RED ICH ib new User ImageButtoni this 01 ih setButtonUpiutoltrue Page 43 2000 2012 Copyright IC Nexus Corporation All rights reserved 17 Use setFontSize to specify the font size of the image button creat
100. rnnnnnnnrrennnnnnnnnnne 33 MEDISIN 33 1 11 9 10 ee REE EEE A E esElR M MUEUE MU 40 SampleUserDragAndDrop eeeeeilsssssssessessssesseenna nennen nnnnnnn nnne n nsns snas nnns sss nasa senis 46 Chapter 4 Example Applications on NSD rrrronnnnneronnrrnnnnnnnvnnnrnnnnnnnnvnnnrrnnnnnsssnnnnrnnnnnnnsnnnnnnnnnnnnee 52 EFE NNN 66 Appendix A NSD Software SDK AP rrrnnnnnnnnnnnnnvnvrrnnnnnnnnvvnnrnnnnnnnnvnnnrrnnsnnnssnnnrnnnnnnssennnnnnnnsnseenen 73 SEO EEE NE EEE EN 73 ACA dB Irons NN TT 78 Application with Drag and Drop Ul rrnnrrnnnnrnvnnnnnnrvvnnnnnnrrernnnnnnrrrnnnnnnrsrnnnnnnsrennnnnnsrsennnnnsnsernnnnn 82 eee SSE 88 f 9 V 98 META AP 104 RENSE 109 Appendix B NSD API Categories rrrrnnnnnnrnnnnnrvvrnnrnnnnnnnrevnnnrnnnnrrrrrnnvnnnnnnnrennnnnnnnnnnsennnnnnnnsnnsennn 117 Android apk and jar fiIl S cccccccccccesssseeeeeeceeeeesseeeeeceeseaaseeeeeeeseeausueeeeeesssaeaaseeeeeesessaseeeeeess 117 BSNS cece TT c 117 NC cipes E er see eee it tenes NE ENE 118 Sending and Receiving Commands via the Network cccccssseeeceeeeceeeeseeeeeeeseeeeeeeeeeeeeeaas 119 NSD Command DEMON seede 120 Page 3 2000 2012 Copyright IC Nexus Corporation All rights reserved Chapter 1 Introduction The NSD smart display is a combination of three components a hig
101. ropZoneEventsListener dropzoneListener new ICNDropZoneEventsListener private byte userdata new byte byte 0x0f byte 0x0e byte 0x0d byte OxOc byte O0xOb byte 0x0a byte 0x09 byte 0x08 Override public void OnDragZoneEntered ICNDropZone zone ICNDraggableItem item zone getView setBackgroundColor Color YELLOW Override public void OnDragZoneLeft ICNDropZone zone ICNDraggableItem item zone getView setBackgroundColor Color parseColor 999999 Override public void OnDropped ICNDropZone zone ICNDraggableItem item zone getView setBackgroundColor Color parseColor 999999 Toast makeText SampleUserDragAndDropActivity this Dropped 1000 show rlv removeAllViews rlv removeViewAt 1 String className new String icnexus smartdisplay SampleUserDragAndDropActivity sendUserData className userdata 8 i API 1 void OnDragZoneEntered ICNDropZone zone ICNDraggableItem item enter DropzZone 1 ICNDropZone zone Define a zone for ICNDrop Any draggable item dropped to this zone will be deleted permanently 2 ICNDraggableItem item To make an item draggable Page 85 2000 2012 Copyright IC Nexus Corporation All rights reserved 2 void OnDragZoneLeft ICNDropZone zone ICNDraggableItem item exit DropZone 1 ICNDropZone zone Define a zone for ICNDrop Any draggable item dropped to this zone will be deleted permanently 2 ICNDraggabl
102. setContent View to the relative layout object reference rlv addView imadgePlayer rlv addViewimclock Ply addView mVideovView rlv addviewi mlicker setcontentViewirlwv initiICHService ICM COMMAND ID ICN DIGITAL SIGNAGE DEMO rly Log ri SampleDigitalSignage 0onCreate bind5servicse 1 bindServiceil 11 In the onCreate method add rlv relative layout to the second parameter and the Command ID ICNService to the first parameter init Page 38 2000 2012 Copyright IC Nexus Corporation All rights reserved rlv addView imadgePlayer Cly addView me lock rlv addVisewimVvideoView rlv addViewi mTicker setcontentViewirlwv Lodg rri 2amplebigitalsigqnage toncreatese hind3serwics 71 bindServiceil rlv addView imadgePlayer rlv addViewimclock rlv addVisewimVvideoView L rlv addVierwimTicker setContentVierw rlvw initiICHService ICM COMMAND ID ICN DIGITAL SIGNAGE DEMO rlw Lowg rri S5empleDigitalsSignage tontcreste Hincservice 1 bindServiceil I 13 In the SampleDigitalSignage class override the onDestroy function 5 Override la protected void onbestroyij i v r TODO Auto generated method stub unbindServiceil Log r SampleDigitalSignage onDestroy unbindS3ervice done super onbestravi zur 14 In the onDestroy function add both unbindService and super onDestroy override protected void onbestroyti ff TO
103. shv Remember to give it a location height and width values Imageview trashy new ImageView this trashV setBackgroundResource R drawable empty trash LayoutParams lpw new LayoutParams 125 200 lpwv setMarginsii un0 300 UO Oj trashy setLayoutParams lpw ICNDPropzone dropzonel new ICHDropzone trashV dropzoneListeneser ICHDrag ndDropManager cdgetrizstancei addDropzoneidropzonel 7 2 Inthe dragPictureAndDropToTrash function add an ICNDrop Area named dropzonel Make the region of trashv as the place where one can drop an item at Imageview trashy new Imageviewithis trashV setBackgroundResourcee R drawable empty trash LayoutParams lpw new LayoutParams 126 200 lpy setMargins 1l00 300 0 Oj 8 1 In the dragPictureAndDropToTrash function add a draggable object ImageView and named it 11 Specify the source of the image its height width and position Imacgeview il new Imagevieri this il setBackgroundResource R drawable android 128 LayoutParams lpi new LayoutParamsiimgw imgh lpl setMargins 300 100 0 0 il setLayoutParamsilpl il setOonTouchListeneri ronTouchListensr Page 47 2000 2012 Copyright IC Nexus Corporation All rights reserved 8 2 In the dragPictureAndDropToTrash function add a draggable object i1 to Touchhistener ImageView il new ImageView this il setBackgroundResource R drawable android 128 LayoutParams lpi new Layo
104. ss Chart s line smoothness ShowGrid The Boolean value to specify whether to display or hide gridlines in Chart BackgroundColorApply The Boolean value to specify whether the background color is applied to Chart A false means transparent background and a true will change the ColorBackgground to the background color ZoomButtonsVisible The Boolean value to specify whether the zoom interface is displayed ShowLegend The Boolean value to specify whether Chart s text description at the bottom left corner is displayed ShowAxes The Boolean value to specify whether Chart s axes are displayed ShowLabels The Boolean value to specify whether the label names of Chart s axes are displayed ChartTitle The Boolean value to specify whether Chart s title name is displayed XName The name of Chart s x axis YName The name of Chart s y axis ChartExplain Chart s text description at the bottom left corner 7 Add a GraphicalView object named cChartView Page 41 2000 2012 Copyright IC Nexus Corporation All rights reserved int ChartBefreshTime 500 public GraphicalView ccChartVieseu public RelativeLayout rly protected LayoutParams mlp 8 Add a UserImageButton object named ib IBInfo ibi UserlImageButton ib 9 Add a new relative layout int ChartRefreshTime 500 public GraphicalView cChartVien public RelativeLayout rly protected LayoutParams mlp 10 Add a LayoutParams named mlp int Ch
105. t Eclipse for the changes to take effect Click Yes Page 7 2000 2012 Copyright IC Nexus Corporation All rights reserved Available Software Check the items that you wish to install 5 Am Work with ADT https dl ssl google com android eclipse TY uu Add y Find more software by working with the Available Software Sites preferences NAT auccm dicum Version 000 Developer Tools E 4p Android DDMS 15 0 1 v201111031820 219398 4p Android Development Tools 15 0 1 v201111031820 219398 4p Android Hierarchy Viewer 15 0 1 v201111031820 219398 Select All Deselect All Details Ww Show only the latest versions of available software Hide items that are already installed w Group items by category What is already installed Show only software applicable to target environment amp j Contact all update sites during install to find required software Figure 2 4 ADT After you restart Eclipse a pop up window will appear asking you to install the SDK to develop for Android Select Install new SDK gt click Install the latest available version of Android APIs support all the latest features gt Next gt Finish Note If you receive a message like Do you want to download install Android SDK please choose No You should follow the steps below to install Android SDK by manually way chapter Android SDK Starter Package Click the Window option on the top
106. t Tools ADT in the text box labeled Work With and the Eclipse installer will go out to that address to look for add on packages The name and the URL for the ADT reference only to be entered are Android ADT https dl ssl google com android eclipse A custom repository name to be used on your computing machine the location of the Internet resource In just a few seconds the Eclipse installer will determine if there is available software of interest to you Once found unfold the Developer Tools update entry You will be presented with all the package names and their version numbers that are available for download Select all the items underneath the Developer Tools line and then click Next You may check the Hide items that are already installed option to remove those items from the list that are already installed The remaining items will be new ones or that those have not yet been installed Figure 2 4 The Eclipse installation system will now attempt to retrieve information and check for updates of all of those Android plug in dependencies This may take a while depending on your Eclipse environment so please be patient Go to Next gt Read the license agreement gt Select I accept the terms of the license agreements Click Finish to begin the installation process If a security warning message appears click Yes to continue with the installation Once the download has finished you will be instructed to restar
107. t l private Vector lt Double gt Ylxie new Vectorczbouble l private Vector lt Double gt DataYaxie new VectorcDouble il 6 Declare the parameters that will be used in Chart Info Page 40 2000 2012 Copyright IC Nexus Corporation All rights reserved private Vector lt Double gt Yaxie new VectorczDouble il private Vector lt Double gt DataY axie new Vector lt Double gt String ChartTitle Chart Demo XName E YName Y String ChartExplain Random value chart diagram double Min 0 SMax 20 YHin YMax 15 int Color xes Color LIGRAY ColorLabel Color YELL OmN int ColorChart Color RED ColorBackgground Color rgbiioo 50 200 int RangeNum 5 YRangeNum 5 boolean ShowGrid false BackgroundColoripply true boolean zoomButtonsVisible false ShowLegend false boolean Showixes true ShowLabels true float ChartSmoothness 0 338 int XixieNurber 21 int YixieNumber 21 int ChartRefreshTime 500 Parameter definition xMin The minimum Chart s x axis value xMax The maximum Chart s x axis value yMin The minimum Chart s y axis value YMax The maximum Chart s y axis value ColorAxes Chart s axes color ColorLabel Chart s label color ColorChart Chart s line color ColorBackgground Chart s background color XRangeNum The number of Chart s x axis intervals YRangeNum The number of Chart s y axis intervals ChartSmoothne
108. ton FONT ID MINIS ib new UserImageButton this 0 ib setButtonUpAuto true Page 101 2000 2012 Copyright IC Nexus Corporation All rights reserved ib setFontSize 60 lb createButton ibl Uele NNN rlv addView cChartView rlv addView ib setContentView rlv handler postDelayed showTime ChartRefreshTime init ICNService ICN COMMAND ID ICN CHART DEMO rlv Log v SampleChart onCreate pindService bindService Override protected void onDestroy TODO Auto generated method stub unbindService Log v SampleChart onDestroy unbindService done super onDestroy public void dataArrivalCallback byte userdata int datasize Log v SampleChart dataArrivalCallback Integer toString datasize l for int 1 Oi lt datasize i44 Log v SampleChart dataArrivalCallback User Data Sering Lormac s7x userdatali ReadInputData userdata datasize API 1 ChartInfo Chartinfo double cXMin double cXMax double cYMin double cYMax int CColorAxes int cColorLabel int cColorChart aint oColorBackgground int cXRangeNum int cYRangeNum float cChartSmoothness boolean cShowGrid boolean cBackgroundColorApply boolean cZoomButtonsVisible boolean cShowLegend boolean cShowAxes boolean cShowLabels String cChartTitle String cXName String cYName String cChartExplain Page 102 2000 2012 Copyright IC Nexus Corporation All rights reserved Parameter definition
109. tring i else cpuUsageGUIList get 2 i alphaRefresh 100 cpuUsageGUIList get 2 i 1 alphaRefresh 100 cpuUsageText setText Integer toString usage public void updateMemoryUsage int usage if usage lt 0 usage gt 100 return int idle 100 usage for int i 0 i LIGHT LEVEL i if i idle 5 memoryUsageGUIList get 2 i alphaRefresh 50 memoryUsageGUIList get 2 i 1 alphaRefresh 50 Log v updateMemoryUsage Integer toString i else memoryUsageGUIList get 2 i alphaRefresh 100 memoryUsageGUIList get 2 i 1 alphaRefresh 100 memoryUsageText setText Integer toString usage public void updateUsedMemorySize float memsize ICN_MEM UNIT mu memorySizeText setText Float toString memsize mu toString private float readCPUUsage try RandomAccessFile reader new RandomAccessFile proc stat r String load reader readLine Stringi toks load split er Page 114 2000 2012 Copyright IC Nexus Corporation All rights reserved long idlel Long parseLong toks 4 long cpul Long parseLong toks 1 Long parseLong toks 2 Long parseLong toks 3 Long parseLong toks 5 Long parseLong toks 6 Long parseLong toks 7 try Thread sleep 500 catch Exception e reader seek 0 load reader readLine reader close toks load split at long idle2 Long parse
110. tub unbindServicerl Log vi SampleUserDrag ndDropA ctivity onDestroy unbindService done super onDestroay i MM Page 51 2000 2012 Copyright IC Nexus Corporation All rights reserved Chapter 4 Example Applications on NSD Inputs from the already existing source codes Users have the ability to load external source code files that have been obtained from other websites or through the developers into Eclipse as a project The external source codes can be complied into a specific development platform Note1 The development platform could be either a virtual device or a printed circuited board PCB When you have your external source code files and Java Archive files Jar ready open Eclipse The system setting below only applies to those software programs that this company has developed If the files you obtained are from other resources please modify the setting based on your preferences Importing list of source files into an Eclipse Project First of all you need to open an Android Project in Eclipse Below introduces three methods you can use depending on your preference a Click New at the top left of the screen to bring up the New Window in your Eclipse Open the Android folder to select Android Project Click Next File Edit Scripts Source Navigate Search Project Refactor Run Window Help Bae oa dg t O q Yo dv v dv Fv Select a wizard 28 p ICNImageButton ode er 43 ICNMain
111. u need to create a class that extends an activity Then you implement the MediaPlayerControl If you have remote control feature you could create a SampleMediaPlayer class that extend ICNService Binding instead public class SampleMediaPlayer extends ICNService Binding implements MediaPlayerControl Override public void onCreate Bundle savedInstanceState super onCreate savedInstanceState Then you can set up the required objects Page 104 2000 2012 Copyright IC Nexus Corporation All rights reserved prs seen ene n DEMO private VideoView mVideoView private MediaController mMediaController In the onCreate function add the feature and listener staus to the VideoView object and MediaController object For example VideoView VideoView setOnCompletionListener new OnCompletionListener Override publ ce ORI Ge me omowke dr ema de cal ae layer sate op VideoView setOnPreparedListener new OnPreparedListener Override public void onPrepared MediaPlayer argO VideoView setOnErrorListener new OnErrorListener Override publeesvord ONEN COT Medra PAVE eg ane wiles sits exp ia x ee ErrorListener is an optional item You do not have to customize or respond to an error message MediaController MediaController setPrevNextListeners ClickListener Next ClickLis tener Prev Users must customize their own button method of cache replacement for streaming media Below is an example
112. uTitleText for int i 0 i LIGHT LEVEL i cpuUsageGUIList add new ICNRegionView this Rect rectLeft new Rect USAGE SCOPE EDGE x USAGE TITLE SCOPE HEIGHT y 1 LIGHT DISTANCE Y USAGE SCOPE EDGE x LIGHT WIDTH USAGE TITLE SCOPE HEIGHT y LIGHT HEIGHT i LIGHT DISTANCE Y cpuUsageGUIList get 2 i createRect rectLeft Color GREEN Color TRANSPARENT Paint Style FILL AND STROKE rlv addView cpuUsageGUIList get 2 1 cpuUsageGUIList add new ICNRegionView this Rect rectRight new Rect USAGE SCOPE EDGE x LIGHT DISTANCE X USAGE TITLE SCOPE HEIGHT y 1 LIGHT DISTANCE T USAGE SCOPE EDGE x LIGHT WIDTH LIGHT DISTANCE X USAGE TITLE SCOPE HEIGHT y LIGHT HEIGHT 1 LIGHT DISTANCE Y cpuUsageGUIList get 2 i 1 createRect rectRight Color GREEN Color TRANSPARENT Paint Style FILL AND STROKE rlv addView cpuUsageGUIList get 2 i 1 cpuUsageText new ICNTextView this cpuUsageText setWindowRange USAGE SCOPE EDGE x USAGE IITLE SCOPE HEIGHT y LIGHT HEIGHT LIGHT LEVEL LIGHT DISTANCE Y USAGE TEXT SCOPE WIDTH USAGE TEXT SCOPE HEIGHT cpuUsageText setTextSize screen height 30 480 cpuUsageText setTextColor Color GREEN j Page 112 2000 2012 Copyright IC Nexus Corporation All rights reserved cpuUsageText setBackgroundColor Color TRANSPARENT rlv addView cpuUsageText public void createMemoryUsageGUI RelativeLayout rlv int x int y
113. utParams imgw imgh lpl setMargins 300 100 0 Oj i1 setLayoutParams lpi i1 setonTouchListener fonTouchListener 9 Inthe dragPictureAndDropToTrash function add an exit object UserImageButton named ib See below for the parameter definition int x the x coordinate of the image button int y the y coordinate of the image button int w the width of the image button int h the height of the image button String img To use the image name as the image button int did the numerical value in the image button int textcolor the text color of the image button FONT ID fontid the font type of the image button String text the text content of the image button Set the ButtonUpAuto aS true IBInfo ibi new IBInfo 400 400 120 100 R drawable blue blank Colt ser ImageButton ib new TserImageButtonithis Oi ihb setButtonlpiutoltruel ib setFontSize 60 ib createButtonolibil ib setText Exit 10 In the dragPictureAndDropToTrash function add a few view objects named trashy il dragsurface and ib in the addView function to the already established riv relative layout addVviewirtrashW addViewrill addView dragsSurface addViewrih setContentViewlrlv 11 In the dragPictureAndDropToTrash function add setContentView rlv Page 48 2000 2012 Copyright IC Nexus Corporation All rights reserved rlv addView trashV rlv addViewrill rlv addVieridragsurface rlv addViewri
114. very time you start the program You may also call it initialization check b This will be called after the video starts playing It will also be called by OnCompetionListener When the video finishes playing c The sub function of resetMedia It is a two step process for updating video addresses First you must save a specific text file path into a list The list will provide you with the ability to modify your payback in a dynamic way In the example above we have mentioned about adding playback component This process will only repeat once unless you re read the file s playlist Second once the playlist has been saved as a List this method will update the playback file location We will not go into the detailed discussion of VideoView and MediaController Here you will learn basic principles of the playback controls such as play pause changing timelines and Stop Name jDescipion public void start Starts or resumes playback public void pause Pauses playback public int getDuration Gets the duration of the current media file public void seekT o int pos Seeks to specified time position The offset is in milliseconds from the start to seek to Must be smaller than the total duration public int getCurrentPosition Gets the current playback position public int getBufferPercentage The percentage of the current Video that has been buffered To exit the player completely you must close th
115. vices daemon not running starting it now on port SH37 daemon started successfully List of devices attached 612345678 7ARBCDEF device 4 If your device is connected successfully it will be shown up with a serial number Page 32 2000 2012 Copyright IC Nexus Corporation All rights reserved Chapter 3 Guide to Build a Sample Application on NSD This chapter guides you through various procedures on how you could modify a NSD Sample Sample Digital Signage Here we will introduce how Clock and Ticker can be added to the DigitalSignage project 1 Declare a public class named SampleDigitalSignage that extends the ICNService Binding class package icnexus smartdisplay gt nm vi import java io BufferedReader 7 j public class SampleDidgitalSignage extends ICNService Binding ji created Called when the activity is first 2 Apply ICNTicker and ICNClock to create two classes named mTicker and mClock respectively package icnexus smartdisplay O CI uj import java io BufferedReader Ja public class SampleDigitalSignadge extends ICNService Binding 4i f Called when the activity is first created ICHTicker mTicker ICHClock mclock ICMImacgePlayer imadgePlayer a private TickerInfo tinfolist private ClockInfo cinfolist private VideoView mVideoVisuw private MediaController mMediacontroaller public RelativeLayout rly 3 Use TickerInfo and ClockInfo to create two para
116. will automatically save the file as readable format The command is Send User Data Bytes To Smart OxFA 0x05 OxFF 0x10 16 OxDD 0x89 Display 0x00 bytes OxBB Data Stream 16 bytes Page 108 2000 2012 Copyright IC Nexus Corporation All rights reserved Please convert your file name into hexadecimal encoding before sending the commands to the machine You may follow the procedure below Conversion tool You can send commands from ICNCmdEmulator to your NSD or Android Virtual Device via the network The character will automatically be encoded You must encode your own Com port You could use Notepad or Ultraedit for converting before sending the hexadecimal information via Docklight Eg Filename Sample mp4 After conversion 53 61 6D 70 6C 65 2E 6D 70 34 Length 00 0A MediaPlayer ID number 05 Start FA Finsh DD 89 BB Last data tranmssion FA 05 FF 00 0A 53 61 6D 70 6C 65 2E 6D 70 34 DD 89 BB ResourceUsage API The ResourceUsage Java class is a simple graphical resource usage of CPU and memory UI activity in the Android device It shows you how to complete a simple resource usage UI with some drawing classes such as as ICNRegionView ICNTextView You can rewrite your code in the ICNUsageGUl java file from your ICNMain project package icnexus smartdisplay import java io IOException import java io RandomAccessFile import java util ArrayList import icnexus smartdisplay ICNDraw ICNRegionView

Download Pdf Manuals

image

Related Search

Related Contents

untitled - BerettaWEB.com  Guide lessive et détachants écologiques  らくらく管理。 - 日立アプライアンス  Samsung ST66 Korisničko uputstvo  Crane EE-5605 User's Manual  Orden de 21 de marzo de 1986 por la que se dictan  Aide à la conduite : nouvelle donne  manual q1.5  

Copyright © All rights reserved.
Failed to retrieve file