Blackberry java development allows to create a database on the device. There are many possible ways to create database. I have recently used Sqlite database for my application. Following is what I have done to use that with my application.
1) Create a database through through blackberry emulator. Following is the code to do that.
URI uri = URI.create("file:///SDCard/Databases/employee.db");
Database sqliteDB = DatabaseFactory.create(uri);
Statement st = sqliteDB.createStatement("CREATE TABLE Employee...
Thursday, 15 November 2012
Saturday, 18 August 2012
Java Design Patterns : Behavioral Patterns
Behavioral patterns are concerned with the flow of control through a system. Some ways of organizing control within a system can yield great benefits in both efficiency and maintainability of that system. Behavioral patterns distill the essence of proven practices into readily understood, well known, and easy-to-apply heuristics. Following is the list of all Behavioral patterns: Chain of ResponsibilityCommandInterpreterIteratorMediatorMementoObserverStateStrategyVisitorTemplate Method ...
Tuesday, 14 August 2012
Java Design Patterns : Structural Patterns
Structural patterns describe effective ways both to partition and to combine the elements of an application. The ways structural patterns affect applications varies widely: for instance, the Adapter pattern can let two incompatible systems communicate, while Facade lets you present a simplified interface to a user without removing all the options available in the system. Following is the list of structural patterns : AdapterBridgeCompositeDecoratorFacadeFlyweightProxy...
Thursday, 9 August 2012
Four level accordion menu using jQuery

Here is a demo to use jQuery for left hand side menu. Attaching code for the same also. Click here for c...
Tuesday, 7 August 2012
Java Design Patterns : Creational Patterns
These patterns support one of the most common tasks in object-oriented programming—the creation of objects in a system. Most OO systems of any complexity require many objects to be instantiated over time, and these patterns support the creation process by helping to provide the following capabilities: Generic instantiation – This allows objects to be created in a system without having to identify a specific class type in code. Simplicity – Some of the patterns make object creation easier, so callers will not have to write large, complex code to...
Saturday, 4 August 2012
Java Design Patterns : Classification
The 23 design patterns covered in the original Design Patterns book had several known applications and were on a middle level of generality, where they could easily cross application areas and encompass several objects. The authors divided these patterns into three types: creational, structural, and behavioral. Creational patterns create objects for you rather than having you instantiate objects directly. This gives your program more flexibility in deciding which objects need to be created for a given case. Structural patterns help...
Java Design Patterns : Learning Process
We have found that, regardless of the language, learning design patterns is a three-step process. Acceptance Recognition Internalization First, you accept the premise that design patterns are important in your work. Then, you recognize that you need to read about design patterns so you will know when you need them. Finally, you internalize the patterns in sufficient detail that you know which ones might help you solve a given design problem. For some lucky people, design patterns are obvious tools, and these people can grasp...
Friday, 3 August 2012
Java Design Patterns : Definition
We all talk about the way we do things in our jobs, hobbies, and home life, and we recognize repeating patterns all the time. Sticky buns are like dinner rolls, but I add brown sugar and nut filling to them. Her front garden is like mine, but I grow as till be in my garden. This end table is constructed like that one, but in this one, there are doors instead of drawers. We see the same thing in programming when we tell a colleague how we accomplished a tricky bit of programming so he doesn't have to recreate it from scratch....
Java Design Patterns : History
It Came From Outer Space... via U.C. Berkeley The inspiration for design patterns in software development is usually attributed to Christopher Alexander, a professor of architecture at U.C. Berkeley. In the late ‘70s, he published several books that introduced the concept of patterns and provided a catalog of patterns for architectural design. Alexander's work sparked interest in the object-oriented (OO) community, and within the next decade, a number of pioneers had developed patterns for software design. Kent Beck and Ward Cunningham were...
Wednesday, 1 August 2012
Java Design Patterns : Why ?

Sitting at your desk in front of your workstation, you stare into space, trying to figure out how to write a new program feature. You know intuitively what must be done, what data and what objects come into play, but you have this underlying feeling that there is a more elegant and general way to write this program. In fact, you probably don't write any code until you can build a picture in your mind of what the code does and how the pieces of the...
Friday, 20 July 2012
XMPP CHAT ROOM MECHANISM # PART-2
In last we have seen how to get list of all available rooms in server. This post is about how to use those information to chat in a room.Once user get list of all room. He needs to choose one room out of it to chat with. User will send presence to existing room. Here there is a little bit change in presence stanza. User needs to add nick name for the room. All other user will see him as his nick name rather than username. e.g.<presence from='{user-jid}/{resource}' to='{room-id}@conference.domain/{nick-name}'></presence>Server will send...
Thursday, 19 July 2012
XMPP Chat room mechanism # Part-1
XMPP protocol provides specification for multi-user chatting(MUC). It is about service provider to implement it. You need to enable MUC from server side. Provider would also give facility to create persistent chat rooms. In terms of XMPP, chat room is known as conference. User can also create a new conference from client program.When user is loggin in, he needs to ask for available service on server side. User need to send following XML to server.<iq type='get' from='{user-jid/resource}' to='domain' id='discoitem1'> <query xmlns='http://jabber.org/protocol/disco#items'/></iq>Server...
Thursday, 12 July 2012
OpenFire Sub Group
XMPP has concept of chat rooms. A chat room is basically a conference room where users can discuss on some points. But Yahoo has provided room facility as social chatting rooms where any member can join the group and chat with other members. In this feature "nested chat rooms" are provided.XMPP is not basically providing nested or child chat rooms. But twisting the logic little bit can make it possible with normal XMPP also. Recall the concepts of domain name. Facebook has domain "facebook.com". Then they have started services of application. They...
Friday, 6 July 2012
J2ME Theme development

LWUIT would not be best option for desktop base application. But when you need some good UI in mobile application. The UI that can attract people directly. You must need LWUIT. I have recently completed one project with J2ME with LWUIT.
Here with attaching demo for what you can do with LWUIT.
As well sharing resource file for this theme. Make sure you use same version of LWUIT for editing theme and mobile library otherwise it won't work....
Monday, 2 July 2012
Hibernate Caching: Part II
In first part of Hibernate Caching, we discussed about overall caching mechanism, strategies, implementation & configurations. Now in part two, we will look into Query cache and Caching association.
In many applications we have certain data sets which are permanent (not changing frequently) in nature but still dynmic like currencies supported, languages supported, countries etc. In such cases, it is useful to cache the exact results of a query, rather than caching certain objects. These queries would return exactly the same data set each...
Sunday, 1 July 2012
Hibernate Caching
Caching is widely used for optimizing database applications. A cache is
designed to reduce traffic between your application and the database by
conserving data already loaded from the database. Database access is
necessary only when retrieving data that is not currently available in
the cache. The application may need to empty (invalidate) the cache from
time to time if the database is updated or modified in some way,
because it has no way of knowing whether the cache is up to date.
When we use hibernate as persistence layer framework,...
Tuesday, 19 June 2012
XMPP Plain Authentication
All of the communication between clientand server are done by passing XML. So it is important to getknowledge about XML first. Following are the links to get hands onXML.Javaworld : http://www.javaworld.com/jw-04-1999/jw-04-xml.htmlW3C School : http://www.w3schools.com/xml/ For authenticating user to the xmppserver. Client needs to open a stream. XMPP works on stream base. A stream is a sequence of data ofundetermined length. It's called a stream because it's like a streamof water that continues to flow. There's no definite end to it. A better...
Wednesday, 6 June 2012
Chat Application Protocol Suggestion
Using XMPP is the easiest way toimplement chat application for any of the platform. There are manyoptions available in market which can be used to develop a chatapplication. There are many limitations and drawbacks of using someother protocol for chatting.
Following are some of the benefits ofusing XMPP.
Decentralization
The architecture of the XMPP network is similar to email; anyone canrun their own XMPP server and there is no central...
Subscribe to:
Posts (Atom)