Develop your own Magento mobile application

来源:互联网 发布:微信网络答题系统 编辑:程序博客网 时间:2024/05/22 03:26

Do you want to develop your own Magento mobile application?

Great! I’ll give you some pointers on how to get a grasp onMagento’s XMLConnect, an extension that servesMagento Mobile application.

Keep in mind that XMLConnect extension comes ‘preinstalled’ inMagento CE 1.5 and later, but you can get it from MagentoConnect.

The Big Picture

Awhile ago, Magento Mobile was released for iPhone, iPad andAndroid devices. It consists of two parts: a Magento web store withan XMLConnect extension installed and configured, and a nativeapplication itself.

XMLConnect extension’s purpose here is to serve your applicationwith requested data (category listing, product information, etc.)and execute desired actions (buy, log in, checkout, etc.).
Basically, application sends a request (plain HTTP GET/POST) toyour Magento store (XMLConnect) and it responds with an XMLresult.

The best way to get familiar with XMLConnect is to see it inaction:

1) Set up a Magento store on your web server with some sampledata
2) In Magentoadmin->Mobile->Manage Appsadd a new mobile application
3) Install Magento Mobile on your device
4) Start Magento Mobile on your device with your Magento store urland the app code of the application you just created inMagento admin->Mobile

While exploring Magento Mobile, keep an eye on (Apache) activitylog file to see exactly what the application is requesting from theserver.
For instance, the first request would probably be the applicationconfiguration request.

/xmlconnect/configuration/index/app_code/defand1/screen_size/480×800

We recognize in this request an app code (in this example it is“defand1″) and your device’s screen size (here it’s“480×800″).
Let’s check out what is the result of this request. In your browsernavigate to:

http://magentoivica.loc/xmlconnect/configuration/index/app_code/defand1/screen_size/480×800
(obviously, replace “magentoivica.loc” with your web server name.Recognize the rest of the url?)

Voilá, what you should get is an entire configuration of yourapp (as it is set in your Magento admin) in an XML format.

Using this practice, you can easily explore most of thecapabilities of XMLConnect. Also, it may be necessary to get intothe code of XMLConnect if you want to master some of the moreadvanced actions (such as the checkout process).

Ok, now you know basics of using XMLConnect, how to make arequest and what to expect as a result. But, how to use thisinformation in an Android (Java) environment?

You probably already know something about parsing XMLdata. I will show you a better way (probably) which willallow you to have moremodularity andsustainability in an Android applicationdevelopment.

So, stay tuned :)

原创粉丝点击