Creating the Android project to work with Sybase Unwired platform in Eclipse or Sybase Unwired Workspace
Creating the Android Project
Create a new Android
project in Sybase Unwired WorkSpace. Add library resources to the project and set
other application
properties.
Prerequisites
To help create your project—and in a subsequent topic, build the user
interface—download the SUP101 Android Object API (2.2 SP02) example project from the SAP
Community Network (SCN) Web site at http://scn.sap.com/docs/DOC-8803.
Task
The left pane of the Workspace Navigator should list the SUP101Android project. In the
src folder, a default Sample Activity class was automatically
generated when you created the project.
Tip: To correct a misspelled package
name, right-click the package and select to change the name and update all references.
Adding Compiler and Library Resources
Add compiler and library resources to the Android project.- Add a compiler resource to the root directory of the
project:
- In Windows Explorer, browse to SUP_HOME\MobileSDK22\ObjectAPI\Android and copy the armeabi folder and these JAR files: AfariaSLL.jar, ClientLib.jar, sup-client.jar, and UltraLiteJNI12.jar.
- In Workspace Navigator, expand SUP101Android, select the libs folder, and paste the armeabi folder and JAR files into it.
- Add library resources to the project:
- In Workspace Navigator, right-click the SUP101Android project, click Properties, and select Java Build Path.
- Click the Libraries tab and select Add JARs.
- In the JAR Selection window, expand the SUP101Android\libs folder and select AfariaSSL.jar, ClientLib.jar, sup-client.jar, and UltraLiteJNI12.jar.
- Close the windows.
Copying Unwired Platform Files to Sample Project
Copy the object API code
you generated using the Generate Code wizard for
Android.
- In Workspace Navigator, go to the SUP101 project and copy the com folder in \Generated Code\Android\src\.
- Go to the SUP101Android project and paste the com folder in to the src directory. Select Yes to All to copy over existing folders.
Creating the User Interface
Copy the Java code files, which provide the functionality and layout of the user interface, from the SUP101 Android Project example project archive to the SUP101Android project.Adding User Permissions and a Class to the Android Manifest File
Add user permissions to the Android project. Also add a Detail
Activity class to the AndroidManifest.xml file. This
declaration launches a customer detail screen where you can make changes when you test the
application.
Creating a Launch Configuration for the Project
Create
a new
launch configuration for the
SUP101Android
project. The configuration
specifies
how the application
launches,
and defines
the target Android platform.
Prerequisites
In the Sybase Unwired WorkSpace, use the AVD Manager to add a
new target Android Virtual Device
(AVD).
Task
Testing the Device Application on the Android Emulator
Run the
SUP101Android
application on the Android emulator, and change customer information to update the
interface.
From where should I get the following files?
ReplyDeleteCustomerListAdapter.java, DetailActivity.java, and SUP101SampleActivity.java
They are not present in http://scn.sap.com/docs/DOC-8803 as mentioned in this article.