Is it possible to access a user's dictionary on mobile?

If I wanted to develop a mobile app that utilized the Android / iOS word dictionary, could I do that with Corona? Would I have to use the Enterprise edition?

The base sample for Corona Enterprise on iOS is accessing the dictionary. The same example on Android uses a web dictionary. But I would think that you could find a web dictionary that had a REST based API which Corona SDK could just do a network.request() call too.

Rob

I’m trying to figure out how exactly I’m supposed to use network.request() for this. Am I supposed to do something like this?

network.request(“http://www.thefreedictionary.com/test”, “GET”, networkListener)

But that just gives me the source code. How can I extract the definition?

You have to request a URL that returns data that you want to use. It does not look like thefreedictionary.com has any API end points that return anything but a full HTML page. You could take that code, write it to a temporary file and then feed it to a native.newWebView() to at least show the results. 

The definition is inside a uniquely ID’ed <div> in the page. You could feed the results through an XML parser and find the tag with the right ID, but after that the content inside that ID isn’t designed well for extraction.

There may be other dictionary sites that offer an API.

Rob

The base sample for Corona Enterprise on iOS is accessing the dictionary. The same example on Android uses a web dictionary. But I would think that you could find a web dictionary that had a REST based API which Corona SDK could just do a network.request() call too.

Rob

I’m trying to figure out how exactly I’m supposed to use network.request() for this. Am I supposed to do something like this?

network.request(“http://www.thefreedictionary.com/test”, “GET”, networkListener)

But that just gives me the source code. How can I extract the definition?

You have to request a URL that returns data that you want to use. It does not look like thefreedictionary.com has any API end points that return anything but a full HTML page. You could take that code, write it to a temporary file and then feed it to a native.newWebView() to at least show the results. 

The definition is inside a uniquely ID’ed <div> in the page. You could feed the results through an XML parser and find the tag with the right ID, but after that the content inside that ID isn’t designed well for extraction.

There may be other dictionary sites that offer an API.

Rob