Sunday, June 22, 2014

Tizen SDK HelloAccessoryConsumer Sample Application Error

When using the guideline for testing the gear applications on emulator, there is a part where you have to install the HelloAccessoryConsumer app on the galaxy gear simulator and the HelloAccessoryProvider app on the host application. While following the guide for the first time, it is possible that you will encounter the following error message:

 js/main.js (44) :err [undefined] msg[undefined  

To get around this error, open the HelloAccessoryConsumer project on your Tizen IDE and look for the accessoryservices.xml file inside the: res/xml folder.

Look for this section
 <supportedTransports>  
      <transport type="TRANSPORT_BT” />  
 </supportedTransports>  

Change the value for the transport type into:
 <supportedTransports>  
      <transport type="TRANSPORT_WIFI" />  
 </supportedTransports>  

After modifying this on the consumer project, open the HelloAccessoryProvider android project. Look for the accessoryservices.xml file inside the: res/xml folder.

Look for this section:

And change the transport like below:

Redeploy both the consumer and the provider application on their corresponding devices.

Original post for this solution can be found in the Samsung Developer Forum.

Tuesday, January 7, 2014

Step by Step Setup of eBay Java SDK on Maven

This guide assumes that you are using Eclipse ide with the maven plugin properly configured.

Download the eBay SDK java from their site

Create a new maven project using the maven quickstart archetype


Set the archetype parameters

You should now have a basic maven project. Go to package explorer and delete the App.java file.

Since the basic project does not have a resource folder, we should add one. It should be located on src->main->resources folder:

Highlight the resources folder and add it to the build path as a source folder.


Open the folder where you extracted the contents of your eBay java sdk. For my guide, I used eBaySDKJava849.zip and the folder contents are as follows:

Go to the source/core/ebay/sdk of the extracted sdk folder and copy its contents to the src/main/java/com/ebay/sdk folder of the maven project we made earlier:

Go to the source/wsdl of the extracted sdk folder and copy its contents to the src/main/resources folder of the maven project.
 Go to the build folder of the extracted sdk and copy custom-binding.xml and jaxb-binding.xjb to the root directory of the maven project:

Modify the wsdl location in the custom-binding.xml file. Since the name of the project in this example is ebaysdkcore, our configuration is as follows:
1:  <?xml version="1.0" encoding="UTF-8"?>  
2:  <jaxws:bindings wsdlLocation="../ebaysdkcore/src/main/resources/eBaySvc.wsdl"  
3:       xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:jaxws="http://java.sun.com/xml/ns/jaxws"  
4:       jaxb:version="2.0" xmlns:jaxb="http://java.sun.com/xml/ns/jaxb">  
5:       <jaxws:bindings  
6:            node="//xs:complexType[@name='ReviseInventoryStatusRequestType']">  
7:            <jaxws:bindings node=".//xs:any">  
8:                 <jaxb:property name="reviseInventoryStatusRequestTypeAny" />  
9:            </jaxws:bindings>  
10:       </jaxws:bindings>  
11:  </jaxws:bindings>  


Go to the build/maven_build of the extracted sdk and copy the pom.xml and place it on the root directory of the maven project.

Modify the pom.xml file to add this missing dependency:
1:  <dependency>  
2:       <groupId>org.slf4j</groupId>  
3:       <artifactId>slf4j-api</artifactId>  
4:       <version>1.7.5</version>  
5:  </dependency>  

Also modify this section of the pom.xml file:
1:  <binding dir="${basedir}" includes="custom-binding.xml"/>  

and change it into this to include the jaxb-binding.xjb file:
1:  <binding dir="${basedir}" includes="custom-binding.xml,jaxb-binding.xjb"/>  

Open the command window and run the following command:
 set MAVEN_OPTS=-Xmx512m  

This ensures that maven has enough memory to run the build.

Again on the command window, go to the root folder of the maven project and run the command to build the project:
 mvn -e clean package  


Credits to this solution from the eBay developer forum.

Complete source can be view from this repo