German Apps Can Be Also Published Now

Today Intel starts to accept also German apps in the Intel AppUp developer program. This way at this point already 4 languages are supported by AppUp:

  • English
  • French
  • German
  • Spanish

As I do have a lot of German apps, too, I’ll start to submit them to AppUp now. Obviously there won’t be much downloads of the German apps at the moment, because Intel needs to fill the store with apps first, before they can start to distribute the store to end customers. But I’m confident that when distributed there will be good download counts as for the English system then. ;-)

JBoss Startup Takes Very Long

In the last weeks we noted startup problems of our productive JBoss server several times: either it did not startup at all or it took very (up to an hour!) long.

In the server log files we found exceptions like this one:

2011-04-19 08:36:09,484 ERROR [de.absoft.portal.core.listener.PortletContextListener] Exception while parsing 'portlet.xml'
org.dom4j.DocumentException: Error on line 573 of document http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd : src-resolve: Cannot resolve the name 'xml:lang' to a(n) 'attribute declaration' component. Nested exception: src-resolve: Cannot resolve the name 'xml:lang' to a(n) 'attribute declaration' component.

We figured out that the exception is thrown when this document on the Sun webpage is – for whatever reason – not reachable. Additionally this error may also occur if you try to start JBoss without an internet connection at all.

But the main problem is that before it throws this exception, it waits for a timeout. This leads to the extremely long startup time in this case.

As it is completely insane that the JBoss startup relies on a Sun server that obviously does not run very steadily, we searched for a solution.

The only reason for this issue was that the validation feature was enabled in code. So we just needed to remove these lines of code:

reader.setFeature("http://xml.org/sax/features/validation", true);
reader.setFeature("http://apache.org/xml/features/validation/schema", true);
reader.setFeature("http://apache.org/xml/features/validation/schema-full-checking", true);
reader.setFeature("http://apache.org/xml/features/validation/dynamic", true);

Of course, this validation feature is very useful for debugging reasons, but it should definitely be disabled for productive environments.

Did you also note JBoss startup problems due to this feature already yourself?

Intel AppUp Supporting MeeGo Apps Now

Beside Windows applications now also MeeGo apps can be submitted to the Intel AppUp developer program now.

But what the heck is “MeeGo”?

MeeGoYes, I also did not hear about this operating system before. So let’s see what the MeeGo webpage itself tells us about this system:

The MeeGo project provides a Linux-based, open source software platform for the next generation of computing devices. The MeeGo software platform is designed to give developers the broadest range of device segments to target for their applications, including netbooks, handheld computing and communications devices, in-vehicle infotainment devices, smart TVs, tablets and more – all using a uniform set of APIs based on Qt. For consumers, MeeGo will offer innovative application experiences that they can take from device to device.

OK, so basically MeeGo is (yet) another platform for netbooks, tablets and other mobile devices. But Intel really is focussing on pushing this new platform and we’ll see how much success it will have at the end.

Anyway, I’ll try to port at least one of my apps to this new system – just to see how it works.

Did you tried MeeGo yourself already or even published an app for it?

Winner of the Vodafone Android Competition

Some minutes ago I was informed that I am one of the winners of the Vodafone Android Competition! :-)

Vodafone Developer

My Android app Energy Costs Calculator was selected as the best new Android app of this week.

I have to admit that I even did not know I was participating in any competition. So this e-mail of Vodafone was a very positive surprise. ;-)

I want to thank Vodafone for the price, a HTC Legend (Android smartphone):HTC Legend

European Software Conference 2010 in Vienna

This weekend I was attending to the European Software Conference (ESWC) in Vienna (Austria). The purpose of this conference is to provide an easy way for sharing information between software developers and companies as well as organizations who provide products and services to software developers.

European Software Conference 2010 (Vienna)

Especially the exchange of experiences with other developers was great – I’ll be at the ESWC in 2011, too! :-)

Intel AppUp: New App Store for Netbooks and Tablets

What’s Intel AppUp?

Intel AppUp

Intel AppUp is an app store for netbooks and tablets. The user can directly download, install and – in case of paid apps – buy products from the AppUp app store.

But why Intel thinks it will be successful with yet another app store?

Of course, there won’t be many people that download the AppUp client software that is necessary to use the app store from the AppUp webpage. But in cooperation with Intel’s hardware partners the AppUp client will get pre-installed on many netbook and tablet devices. That’s the way Intel will spread this client to as many users as possible.

But why that’s interesting for me as a developer?

I’m always searching for a new distribution channel for my products and as it’s very easy to get an app into the AppUp store, I’ll just try that. ;-)

More about that and the validation process in another post.

Using the Shopping.com API in PHP

After an example of the eBay Finding API and the Amazon Product Advertising API in previous posts, I finally want to show an example of the Shopping.com API.

First of all you need to register for a free Shopping.com developer account.

Then you can start building the API request URL:

http://publisher.api.shopping.com/publisher/3.0/rest/GeneralSearch?
	apiKey=%apikey%&
	trackingId=%trackingid%&
	subTrackingId=%subTrackingId%&
	categoryId=%categoryId%&
	keyword=%keyword%&
	pageNumber=%pageNumber%&
	numItems=%numItems%&
	hybridSortType=%hybridSortType%
	hybridSortOrder=%hybridSortOrder%

Now let’s see what the individual parameters mean:

  • GeneralSearch: we need the operation GeneralSearch for our keyword-based search.
  • apiKey: you get this API key in your Shopping.com developer account.
  • trackingId: you need to request a tracking ID from Shopping.com to earn some money with your traffic.
  • subTrackingId: choose any additional code here you want to use as optional tracking (e. g. for special campaigns).
  • categoryId: the category you want to search in (leave empty to search in all categories).
  • keyword: your search keywords. Make sure you use utf8_decode if the keywords are in UTF-8.
  • pageNumber: for the first request you set this to 1 and increase it in previous requests if you need more items.
  • numItems: here you can choose how many items (maximal 100) are returned per request.
  • hybridSortType: choose if you want the result to be sorted by relevance or price.
  • hybridSortOrder: choose if you want the result to be sorted ascending or descending.

That’s all: we just need to pass this URL again to the small function we used already in the eBay Finding API and the Amazon Product Advertising API examples and receive the XML response data:

/**
 * Returns the SimpleXML object.
 *
 * @param string $url The URL to receive the XML document.
 * @return string The SimpleXML object.
 *
 */
function getXml($url) {
	$ch = curl_init();
	curl_setopt($ch, CURLOPT_URL, $url);
	curl_setopt($ch, CURLOPT_HEADER, false);
	curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
	curl_setopt($ch, CURLOPT_TIMEOUT, 3);
	$result = curl_exec($ch);
	curl_close($ch);

	return simplexml_load_string($result);
}

As you can see the Shopping.com API is very easy to handle as it is also the smallest of these three APIs.

Did you use the Shopping.com API yourself already?
Do you know other interesting online shopping APIs?

Using the Amazon Product Advertising API in PHP

As I have started with an example of the eBay Finding API in a previous post, I want to continue with the Amazon Product Advertising API now.

Again we need to start with a sign up for a free Amazon Web Services account. To make money with your Amazon traffic you also need to register for the Amazon affiliate program.

Now we can start to build the request URL for the Amazon Product Advertising API:

http://ecs.amazonaws.com/onca/xml?
	AWSAccessKeyId=%awsAccessKeyId%&
	AssociateTag=%associateTag%&
	ItemPage=%itemPage%&
	Keywords=%keywords%&
	Operation=%operation%&
	ResponseGroup=%responseGroup%&
	SearchIndex=%categoryId%&
	Service=AWSECommerceService&
	Timestamp=%timestamp%&
	Signature=%signature%

Let’s see what the individual parameters mean:

  • ecs.amazonaws.com: based on the country you want to target, you have to use a specific endpoint. It is ecs.amazonaws.com for USA.
  • AWSAccessKeyId: you get this access key in your Amazon Web Services account.
  • ItemPage: for the first request you set this to 1 and increase it in previous requests if you need more items. Each response has up to 10 items (you cannot change that).
  • Keywords: your search keywords. Make sure you use rawurlencode here.
  • Operation: the name of the operation of the Amazon Product Advertising API you want to call. For the keyword search we choose ItemSearch.
  • ResponseGroup: based on the level of detail you need in the response, choose a useful response group. For item searches I choose Medium most of the time.
  • SearchIndex: a search index is a kind of first level category. If you want to search in everything, just choose All.
  • Service: just use AWSECommerceService here.
  • Timestamp:a timestamp generated in PHP like this:
    rawurlencode(gmdate('Y-m-d\TH:i:s\Z'))
  • Signature: that’s the funniest part: please see below how to generate this signature.

To be able to send a valid API request, you have to calculate the signature as following:

$request = "GET\necs.amazonaws.com\n/onca/xml\n";
$request .= "AWSAccessKeyId=%awsAccessKeyId%&AssociateTag=%associateTag%&ItemPage=%itemPage%&Keywords=%keywords%&Operation=%operation%&ResponseGroup=%responseGroup%&SearchIndex=%categoryId%&Service=AWSECommerceService&Timestamp=%timestamp%";
$signature = rawurlencode(base64_encode(hash_hmac('sha256', $request, %secretKey%, true)));

You get the needed %secretKey% in your Amazon Web Services account, too.

When you’ve done everything correctly, you can pass the resulting request URL to this small function that we used already for the eBay Finding API request and receive the XML document response of the API:

/**
 * Returns the SimpleXML object.
 *
 * @param string $url The URL to receive the XML document.
 * @return string The SimpleXML object.
 *
 */
function getXml($url) {
	$ch = curl_init();
	curl_setopt($ch, CURLOPT_URL, $url);
	curl_setopt($ch, CURLOPT_HEADER, false);
	curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
	curl_setopt($ch, CURLOPT_TIMEOUT, 3);
	$result = curl_exec($ch);
	curl_close($ch);

	return simplexml_load_string($result);
}

Unfortunately I have to say that I think the Amazon Product Advertising API is really confusing and badly documented. Especially if you need to work with these search indices and categories (so-called nodes) that’s not very funny at all. And there are even things that are not bad, but just wrong documented in the Amazon Product Advertising API documentation.

What’s your opinion about the Amazon Product Advertising API?

Using the eBay Finding API in PHP

While working on a client project I needed to connect the website to the eBay Finding API to show eBay items on the website.

In the following I want to show how to get eBay items from the eBay Finding API based on a keyword search.

First of all you need to join the free eBay developers program to get your application ID. If you additionally want to earn some money with your eBay traffic – and probably that’s the reason why you want to integrate eBay items in your website ;-) – you also need to apply to the eBay partner network.

After you have been registered in the eBay developers program and partner network, you can use following URL in your request to query for eBay items:

http://svcs.ebay.com/services/search/FindingService/v1?
	OPERATION-NAME=%operationName%&
	SERVICE-VERSION=%serviceVersion%&
	GLOBAL-ID=%globalId%&
	SECURITY-APPNAME=%appId%&
	RESPONSE-DATA-FORMAT=%responseDataFormat%&
	REST-PAYLOAD&
	affiliate.networkId=%networkId%&
	affiliate.trackingId=%trackingId%&
	affiliate.customId=%customId%&
	paginationInput.entriesPerPage=%entriesPerPage%&
	paginationInput.pageNumber=%pageNumber%&
	keywords=%keywords%

Now let’s see what the individual parameters mean:

  • OPERATION-NAME: the name of the operation of the eBay Finding API you want to call. For the keyword search we choose findItemsByKeywords.
  • SERVICE-VERSION: the API version you’re using (the current one is 1.0.0 right now).
  • GLOBAL-ID: here you need to include the ID of the eBay site you’re using.
  • SECURITY-APPNAME: the application ID you got from the eBay developers program website.
  • RESPONSE-DATA-FORMAT: you can choose here how the data should be returned. I use XML, but you also could choose JSON or NV (name-value pair).
  • REST-PAYLOAD: just specify this without a value after the standard headers above.
  • affiliate.networkId: you get this ID from the eBay partner network.
  • affiliate.trackingId: you get this ID from the eBay partner network.
  • affiliate.customId: choose any additional code here you want to use as optional tracking (e. g. for special campaigns).
  • paginationInput.entriesPerPage: here you can choose how many items (maximal 100) are returned per request.
  • paginationInput.pageNumber: for the first request you set this to 1 and increase it in previous requests if you need more items.
  • keywords: last but not least you include your search keywords here. Make sure you use utf8_decode if the keywords are in UTF-8.

Finally we just need to receive our XML data. Therefore I use this simple function to get the data from the URL and load the XML document:

/**
 * Returns the SimpleXML object.
 *
 * @param string $url The URL to receive the XML document.
 * @return string The SimpleXML object.
 *
 */
function getXml($url) {
	$ch = curl_init();
	curl_setopt($ch, CURLOPT_URL, $url);
	curl_setopt($ch, CURLOPT_HEADER, false);
	curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
	curl_setopt($ch, CURLOPT_TIMEOUT, 3);
	$result = curl_exec($ch);
	curl_close($ch);

	return simplexml_load_string($result);
}

Of course, there is very much more you can do with the eBay APIs. For example I also needed to get items by category as well as the most watched items. That’s also pretty easy. If you need more, you can even do the whole buying process directly through the eBay APIs: this way the user does not need to leave your website at all to buy an item.

Finally I want to say that in fact the eBay APIs are very big and complex APIs, but the documentation is quite good, too. There are much worse examples of big APIs (see also my post about the Amazon Product Advertising API).

Did you use the eBay APIs yourself already?

Developing a Browser Toolbar: Summary (5/5)

This post series reflects my article “Developing a Browser Toolbar” published in the ASPects in January 2010 (Volume 23, Issue 1), a magazine of the Association of Shareware Professionals (ASP).

As you can see, developing a browser toolbar is a good piece of craftsmanship, but although I could not describe each step in detail, writing your own toolbar should be at least faster after reading this post series and especially the linked tutorials.

If you want to test how this toolbar works on your system, you can download a stand-alone installer from my webpage.

Finally I want to encourage you to test every small code change in the Internet Explorer toolbar on all important operation systems (at least Windows XP, Vista and 7) and browser versions, because the results can be really different – far more different than when developing “normal” Windows applications.

What’s your experience with creating browser toolbars?

Contents of Post Series “Developing a Browser Toolbar”: