Technote Rhapsody-7.5.2-002: How to integrate Rhapsody-7.5.2 with TI

Technote Rhapsody-7.5.2-002: How to integrate Rhapsody-7.5.2 with TI
Code Composer Studio 5.0 for developing android applications on
Ubuntu-10.04 64-bit
Elvis Dowson <[email protected]>
Overview
This document describes how to integrate Rhapsody-7.5.2 with TI Code
Composer Studio 5.0 for developing android applications on Ubuntu-10.04 64bit.
Procedure
Step 01.00: Install Rhapsody-7.5.2.
Step 02.00: Install TI Code Composer Studio 5.0.
Step 03.00: Install the Android SDK.
Download android-sdk_r07-linux_x86.tgz from the following location:
http://developer.android.com/sdk/index.html
Extract the android-sdk_r07-linux_x86.tgz package to your development tool
location, e.g. /tool or /opt
Add the location of the android-sdk-linux_x86/tools folder to the PATH
environment variable in your .bashrc file.
export ANDROID_SDK="/tool/android-sdk-linux_x86"
export PATH="$ANDROID_SDK/tools:$PATH"
Step 03.01: Install the android ADT plugin for eclipse.
Click on Help > Install New Software and add the following update site:
https://dl-ssl.google.com/android/eclipse/
Copyright © 2010 Elvis John Dowson!
Page 1 of 14
Select the Developer Tools, click on Next, complete the installation and restart
eclipse.
After restarting eclipse, click on Window > Preferences > Android and set the
SDK location:
Click on OK.
Step 03.02: Add the Android SDK components.
Click on Window > Android SDK and AVD Manager.
Copyright © 2010 Elvis John Dowson!
Page 2 of 14
Select Available Packages and select the required android sdk components, e.g.
android-2.2, android-2.1, etc.
Click on the Install Select button. In the Choose Packages to Install window,
select the Accept All option and click on the Install button.
Select Installed Packages to see the list of installed packages.
Copyright © 2010 Elvis John Dowson!
Page 3 of 14
Step 03.03: Create an AVD instance.
Select Virtual Devices and click the New button.
In the Create new Android Virtual Device (AVD) dialog, enter the following details
to create a new AVD instance for android-2.1:
Name
:
Android-2.1-HVGA
Target : Android-2.1-update1 - API Level 7
SD Card Size :
256 MiB
Skin Built-in:
HVGA
Click on the Create AVD button.
You should not be able to see the newly created AVD for Android-2.1-HVGA.
Copyright © 2010 Elvis John Dowson!
Page 4 of 14
Launch the emulator by selecting the Android-2.1-HVGA AVD and clicking on
the Start button.
The emulator should take about 1 to 2 mins to fully start up and display the
android desktop home-screen.
Step 03.04: Test the AVD instance.
Create an android example project, e.g. HelloAndroid, and test its execution on
the emulator.
To manually install and uninstall an application, type the following commands:
cd bin
adb install *.apk
adb uninstall this.is.package.name
Copyright © 2010 Elvis John Dowson!
Page 5 of 14
Step 04.00: Install the Rhapsody Eclipse workflow integration.
Click on Help > Install New Software, click on the Add button.
Click on the Local button to add a new local update site. Point it to the
rhapsody-7.5.2/Eclipse installation folder.
Click on OK.
In the Install Available Software window, select the Model Driven Development >
IBM Rhapsody Rhapsody Workflow Integration option.
Click on Next, and install the eclipse integration and restart TI CCS 5.0.
Copyright © 2010 Elvis John Dowson!
Page 6 of 14
Verify the Rhapsody eclipse plugin installation by clicking on Help > About Code
Composer Studio.
You should see a Rhapsody logo.
Step 05.00: Run the Rhapsody Home Alarm sample.
Step 05.01: Enable the Rhapsody animation port.
Enable TCP port 6423 for animation:
$ sudo /sbin/iptables -I INPUT -p tcp --destination-port 6423 -j ACCEPT
Enable UDP ports for eclipse plugin communication:
$ sudo /sbin/iptables -I INPUT -p udp --destination-port 5003:5004 -j ACCEPT
List the ports:
$ sudo /sbin/iptables -L
Step 05.02: Launch Rhapsody and load the Rhapsody model.
$ cd /tool/ibm/rhapsody-7.5.2
$ ./RhapsodyInJ &
Open the AndroidSample/RhapsodyHomeAlarm project.
If you get an error could not find file Android21.sbs, update the model by
browsing to the following location:
<RHP>/Share/Profiles/Android/Android21/Android21.sbs
Copyright © 2010 Elvis John Dowson!
Page 7 of 14
Step 05.03: Launch TI CCS 5.0 and import the Eclipse project.
Switch to the Java perspective.
Click on File > Import > Existing Projects into Workspace
Browse to the location of the AndroidSample/AndroidHomeAlarm project.
Click on Finish.
Copyright © 2010 Elvis John Dowson!
Page 8 of 14
Step 05.04: Update the Eclipse project properties.
Right-click the AndroidHomeAlarm project and select Properties.
Select Java Compiler, check the Enable project specific settings options, and
set the JDK Compiler Compilance level to 1.5.
Copyright © 2010 Elvis John Dowson!
Page 9 of 14
Select Java Build Path, click on the Libraries tab, click on the Add External JARs
button, and add the following Rhaposdy libraries located in the <RHP>/Share/
LangJava/lib folder:
anim.jar
animcom.jar
oxf.jar
oxfinst.jar
Copyright © 2010 Elvis John Dowson!
Page 10 of 14
Build the project by clicking on menu option Project > Build Project.
Copyright © 2010 Elvis John Dowson!
Page 11 of 14
Step 05.05: Link the Rhapsody project to the Eclipse project.
Expand the Rhapsody Components folder, right click on the
AndroidHomeAlarmComponent > Eclipse Configurations >
AndroidHomeAlarm configuration, and select the Create IDE Project option.
In TI CCS 5.0, select the existing AndroidHomeAlarm project. Click on Finish.
In Rhapsody, the AndroidHomeAlarm eclipse configuration tags will be
automatically updated as follows:
IDEName :
IDEProject
:
IDEWorkspace :
Eclipse
AndroidHomeAlarm
/tool/tutorial
Copyright © 2010 Elvis John Dowson!
Page 12 of 14
Step 05.06: Run the android eclipse application.
In TI CCS 5.0, right click on the AndroidHomeAlarm project, select Run
Configurations, highlight Android Application and click on the New icon.
Name:
AndroidHomeAlarm
Project : AndroidHomeAlarm
Copyright © 2010 Elvis John Dowson!
Page 13 of 14
Click on the Target tab, and select the Android-2.1-HVGA AVD.
Click on Run.
Related Topics
None.
Related Links
None.
Copyright © 2010 Elvis John Dowson!
Page 14 of 14