eBay with Qt

Posted on March 21st, 2012

My cousin sister wanted to learn Qt/QML so I thought it would be better if she starts with some project after learning some basics. I suggested her to try some tutorials from ZetCode. But after hearing about Symbian 2012Q1 contest from me, she insisted me to help her make an entry for the contest. After doing a lot of search and brainstorming we decided we will make a eBay app for Symbian devices. The reason for selecting eBay were simple, first it has a good set APIs and provides with XML based response which I’m more familiar with rather than JSON; second, the official eBay app is now not available for Nokia Belle devices.

To manage work I asked my sister to focus on QML GUI as it is little easier to learn than Qt. I got going with developing Qt API for corresponding eBay APIs. As eBay provides XML response which is little similar to Flickr API response so I tried to built my APIs referring QtFlickr API which I use for FlickrUp. For now, I’m naming my eBay API QtEbay beacuse of its similarity with QtFlickr.

Difficulties

Problem with eBay API is that its a hell lot confusing. There are a number of sets – Shopping, Finding, Trading, Merchandising and they give XML response in different formats. And one cannot make a mobile app using only one of the above set of API. Also, response is not that well organized. There is new XML element for every data which is little difficult to parse. Parsing data becomes much more difficult when there are different number of multiple entries of a XML element for a set of items. Like here,
<title>Harry Potter / Hogwarts ULTIMATE COLLECTORS Package! Letter,Tags,Ticket,Yule,Map</title>
<globalId>EBAY-GB</globalId>
<primaryCategory>
<categoryName>Harry Potter</categoryName>
</primaryCategory>
<paymentMethod>MOCC</paymentMethod>
<paymentMethod>PayPal</paymentMethod>
<paymentMethod>PersonalCheck</paymentMethod>
<autoPay>false</autoPay>
<postalCode>DN226BL</postalCode>
<location>United Kingdom</location>
<country>GB</country>
<shippingInfo>
<shippingServiceCost currencyId="USD">6.34</shippingServiceCost>
<shippingType>Flat</shippingType>
<expeditedShipping>false</expeditedShipping>
<oneDayShippingAvailable>false</oneDayShippingAvailable>
<handlingTime>1</handlingTime>
<shipToLocations>US</shipToLocations>
<shipToLocations>CA</shipToLocations>
<shipToLocations>AU</shipToLocations>
<shipToLocations>JP</shipToLocations>
<shipToLocations>Europe</shipToLocations>
</shippingInfo>
<sellingStatus>
<currentPrice currencyId="GBP">24.99</currentPrice>
<convertedCurrentPrice currencyId="USD">39.71</convertedCurrentPrice>
<sellingState>Active</sellingState>
<timeLeft>P19DT20H33M14S</timeLeft>
</sellingStatus>
<conditionDisplayName>New</conditionDisplayName>
</condition>
<isMultiVariationListing>false</isMultiVariationListing>
</item>
<item>
<title>Nokia 5310 XpressMusic - Red (T-Mobile) Cellular Phone NEVER USED T-Mobile</title>
<globalId>EBAY-US</globalId>
<primaryCategory>
<categoryName>Cell Phones &amp; Smartphones</categoryName>
</primaryCategory>
<productId type="ReferenceID">99986195</productId>
<paymentMethod>PayPal</paymentMethod>
<autoPay>false</autoPay>
<postalCode>36117</postalCode>
<location>Montgomery,AL,USA</location>
<country>US</country>
<shippingInfo>
<shippingServiceCost currencyId="USD">12.0</shippingServiceCost>
<shippingType>Flat</shippingType>
<expeditedShipping>false</expeditedShipping>
<oneDayShippingAvailable>false</oneDayShippingAvailable>
<handlingTime>2</handlingTime>
<shipToLocations>US</shipToLocations>
</shippingInfo>
<sellingStatus>
<currentPrice currencyId="USD">56.0</currentPrice>
<convertedCurrentPrice currencyId="USD">56.0</convertedCurrentPrice>
<bidCount>25</bidCount>
<sellingState>Active</sellingState>
<timeLeft>P0DT0H8M53S</timeLeft>
</sellingStatus>
<condition>
<conditionId>3000</conditionId>
<conditionDisplayName>Used</conditionDisplayName>
</condition>
</item>

Here shipToLocations element vary for different entries it is difficult for me to parse with my current method. Wish they had separated location with comma and returned with a single entry.

Progress

Despite some difficulties and hiccups, I managed to get Shopping, Trading, Finding & Merchandising APIs with a lot of help from eBay’s developer API test tool. And after giving some demos to my sister, she was able make QML GUI for our prototype. This is what we were able to achieve:


We tried to make a simple design for the application following Symbian guidelines to submit it for the contest, similar to Nokia store app.

We are aiming for a simple app with feature of showing current top items, search, categories, user data addition & removal of items into user watchlist. Hopefully we will be able to complete the application with desired goals up to final date submission for the contest.

2 Comments to “eBay with Qt”

Leave a Comment to pecuna91