Develop your own Magento mobile application

Great! I’ll give you some pointers on how to get a grasp on Magento’s XMLConnect, an extension that serves Magento Mobile application.
Keep in mind that XMLConnect extension comes ‘preinstalled’ in Magento CE 1.5 and later, but you can get it from Magento Connect.

The Big Picture

Awhile ago, Magento Mobile was released for iPhone, iPad and Android devices. It consists of two parts: a Magento web store with an XMLConnect extension installed and configured, and a native application itself.

1) Set up a Magento store on your web server with some sample data
2) In Magento admin->Mobile->Manage Apps add a new mobile application
3) Install Magento Mobile on your device
4) Start Magento Mobile on your device with your Magento store url and the app code of the application you just created in Magento admin->Mobile

While exploring Magento Mobile, keep an eye on (Apache) activity log file to see exactly what the application is requesting from the server.
For instance, the first request would probably be the application configuration 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 browser navigate to:

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

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

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

You probably already know something about parsing XML data. I will show you a better way (probably) which will allow you to have more modularity and sustainability in an Android application development.

Hello guys am able to post cart items through /xmlconnect/cart/product/255 but android retrieves 0 items in cart after adding any ideas.I have the following in
header:
Cookie = app_code=defand1;screen_size=2400×1600

Where can I find all the urls for xmlconnect.
I get list of products under a category using: catalog/category/id/3/offset/0/count/100
For Example If I want to get all products, then whats the url. For Login GET and Login post, etc. Where can I find all the urls, methods, parameter to send , etc

Here is an magento mobile app i purchased from gumroad https://gum.co/zeoNP. It works with xmlconnect methods and built on ionic framework. You can build both andriod and ios app from this framework. You will get source code you can alps customize it. Or you can use this technics to build your own magento app. https://gum.co/zeoNP

@Ivica : Thanks for this excellent post.
I have a magento e-commerce store(website) but I am not able to see Magento admin->Mobile this option inside my magento web store’s admin panel.Could you please help me out with this.Do I need to install any plugin or extension for this.
Eagerly waiting for your response.

I would agree with @Chris and @Piotr on the value the mobile app can being to the store. It may cost to have native app with source codes but its worth it at the end of the day when you look at mobile app revenues. The development of native app takes lot of time, I like to recommend magapp – Native mangeto app to the readers of this post. Find more details on: http://magentomobileapp.com/

I am creating mobile app using xmlconnect in magento. While i am submitting my app it is asking for Activation Key. Its cost is approx $.699. I need it just for checking my app. is it possible to find its activation key

Thanks for this write-up!
I would add that Native app is faster in performance and higher in reliablity than any other solutions. Moreover, just native app can let you take full advantages of the latest mobile technology, like mobile payment, segmenting notifications or store locating, etc…
Here I thought I should mention http://www.simicart.com. SimiCart is a Magento mobile app builder, which will automatically build a naitive app for your online business within the information you provide. Within 3 mins, not 30 days or 3 months as normal, you can have powerful app with optimized mobile UI.

hi, i want to develop a app,but the add img button is not working….event not showing …..i didnt change anything….just installing the magento…..and i reinstalled those button still not showing….why?cant find the problem

@Trinetr have you tried Meets? Meets is an SDK both for Android and iOS and allows you to connect to a Magento store and perform most of the use cases of the current Magento REST and SOAP APIs. In addition is an open source project, so you can download the SDK and use it in your own project completely free. Check out at meets.io

I want to create an Android or iPhone app for my magento store (built using Magento CE edition) using APIs provided,i don’t want to use “Magento Mobile” product and want to host the app in play store or Apple Store.
Do i need to get license from magento people for my app ?

the price is just so high for me. I’ve done some research on the market. There are alot of extensions that can help me build a shop app on mobile. Have anyone used this product before: http://www.magestore.com/simicart/? It is powered by magestore,

I want to know about /xmlconnect/configuration/index/app_code/defand1/screen_size/480×800

We get all information about screen i.e colour,font etc. from this url. Can I use this url for getting store information,products in it,images of product by specifying some different parameter after /defand1/ ?

Another point:
I noticed that magento support both paypal from the magento store and paypal via mobile sdk integrated in the mobile app.

If I wanted to support the regular paypal standard payment from a mobile application, what can I do?
Can this be also done with opening a web view with the paypal redirected url and still manage to close the loop between the app, paypal and magento with a successful order?

You’ll find out more in an article to come, but for now I can tell you that Mobile handles everything natively, no need for web views or anything.
I’ll show you a rather simple way to have Android maintain this session without you, as a developer, having to worry about it at all.

Once you understand those initial requirements for this kind of application, and have them properly set, developing core functionality becomes pretty straightforward.

@His
This is actually a great question, and I intend to write an article about it, I’ll do my best to squeeze it into my schedule this week.

XMLConnect logs in a customer and handles session just like any other regular Magento extension, with the only difference that it gives an XML response.

Therefore, all Magento Mobile has to do is maintain this session (cookies) just like your web browser does. That is, if you want to do the same for your custom application, you have to make your application cookie-aware.

Ivica, I was wondering how the magento mobile /XMLconnect handles user authentication? Since this does not use the magento built in api, how does it connect to the user to the store? Does it just bring a webview that is optimized to look and feel like you are still on a native page or does it use some curl or particular api calls to authenticate the user, pull cart data and order history?

@Ivica Thanks – that’s what i meant. I’d rather try and make my own using something like mobi-cart to start.. just by exporting the xml data… then try my own app by scratch. Look forward to reading more.

@Ivica, sure if you want to build something else. As for developing online store, if you count time spent on developing such app (and as you know it’s not easy eg with iPhone) it will be much higher than license cost, i’m sure about this one. Have fun with Magento Mobile

@Chris, you can develop your own application or buy Magento Mobile. Just ‘tweaking’ Magento Mobile demo app is not an option, if that’s what you asked. What I will try is to give some pointers for everyone who wishes to develop his own app.

@Piotr, I think $7k for the source code is just too much for many developers/companies out there, or if they want to build something completely different and don’t need most of it. Or they just want to learn for the fun of it, like I do 🙂

Your email address will not be published. Required fields are marked *

Comment

You may use these HTML tags and attributes: <a href="" title=""> <blockquote cite=""> <code> <del datetime=""> <em> <s> <strike> <strong>. You may use following syntax for source code: <pre><code>$current = "Inchoo";</code></pre>.