Showing posts with label Android app. Show all posts
Showing posts with label Android app. Show all posts

Saturday, November 17, 2012

SQLite database on Android platform


Android provides nice way of storing data into database and this is possible with its internal library SQLite. SQLite is a very light weight database and its included into android's library stack.
See android architecture here for more details.

     + 

SQLite is opensource database, to learn more about the SQLite refer here.

This example demonstrate how SQLite can be used in Android application.
I have used few basic example of create database and table, insert record, select record from table and delete table.

This blog also explains the example for the android basic widgets which includes TextView and buttons. If user wants they can use other external tool for the development of gui ( for eg. droiddraw , etc), i have have done most of the gui development by modifying the xml directly or with the default gui builder.

Create Database


Create Table


Insert record into table


Query SQLite table


Delete table and close database connection




This is a simple android which which shows a thought of the day to a user, if user wants to see more thoughts than user can press next else user can press thanks button. Purpose of this post is just to show the capability of SQLite, so there are only 20 records available in the table and they are shown in some random number.





You can either checkout or download this sample application code from here.

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.

Heroku Custom Trust Store for SSL Handshake

  Working with Heroku for deploying apps (java, nodejs, etc..) is made very easy but while integrating one of the service ho...