Saturday, November 5, 2011

Android App / Mobile Trading Client

My first android app for trading client.
Very happy today, finally i did it, it was long pending task.
I have intention to use QuickFix/J a Fix Protocol based open source library.

For the android app demo purpose (click here to download sample code) i have removed the JMS web service call which can send the order to Fix Protocol based client and just shown the order

                  JMS Web Service                                         Fix Message on TCP/IP To Exchange                            
Mobile Client ===>    JMS Queue  ===> Fix based Client (Broker)   ===>  Fix based Server (Exchange)
                                        QuickFix/J based client Parser
                                      FROM CLIENT TO BROKER-EXCHANGE DATA FLOW

               Order Status Update (Broadcast-Uni-cast/ TCP-IP Message)
Fix based Server (Exchange)    ===>     Fix based Client (Broker)    ===>   Mobile Client
                                                                                           Order Status Update (may be SMS)

                                      FROM EXCHANGE-BROKER TO CLIENT DATA FLOW

User enters the required Symbol(Script) and other details for Buy/Bid and click on Order button. Android app sends the data to JMS queue which is running on a remote machine at Broker's office and which is based on JMS WebService .

Broker has a Fix protocol based parser running which collects the order from the queue and prepare the Fix based message to Fix protocol based Server, which is located at Stock Exchange.

Once order is confirmed from Exchange the same is sent to Broker and which updates the Client.

Android made the work easy for development, i am not able to find anything much to explain anything in detail. May be have look of the code.

Note: Target audience for this blog and code is only developer and not the android phone user.


  1. Waoh Deepak

    This looks great..
    Can you make one for Indian markets??
    That would be so awesome and a superseller...


  2. Thanks Rahul, Indian exchanges are FIX (FIX protocol) enabled or they are in process adopting FIX as well apart from their proprietary protocol. And i have considered (used) FIX protocol to do the same as an example. May be i will post a basic client ( trading client) and server( Exchange) example in the next post.

  3. This comment has been removed by the author.

  4. Thanks Deepak Singhvi very much. I tried to connect fix protocol on android.

  5. Deepak - Can you please let me know the external jar you used and also the sample value for the attribure "url" in sendOrder method ?

  6. my external jars were for JMS (activemq-core-5.5.0), XMPP(smack.jar). xmpp is used as using the android we cannot use JMS, so i used xmpp and created Broker and Client to send order via JMS.

    public class XmppBroker implements Service {...} and
    public class XMPPClient extends Activity{...}

    using XMPP i was able to send packets.

  7. Deepak - Thanks for sharing the info. I want to send/receive a simple xml message to/from a JMS QUEUE hosted in a glassfish server. How can i do that from my android application ?