View RSS Feed

All Blog Entries

  1. Servlet Performance Tips

    by , 02-18-2012 at 03:14 PM
    • Cache static data using jspInit() method.
    • Release static data in jspDestroy() method.
    • To concatenate string use, StringBuffer.
    • Do not use println() method.
    • Do not use PrintWriter to send binary data. Use ServletOutputStream.
    • Always flush data in sections.
    • Use getLastModified() method to handle browser and server cache.
    • Use application server cache.
    • Use session in following order: HttpSession, Hidden fields, Cookies, URL rewriting. ...
    Categories
    Performance
  2. JSP Performance Tips

    by , 02-18-2012 at 03:13 PM
    • Cache static data using jspInit() method.
    • Release static data in jspDestroy() method.
    • To concatenate string use, StringBuffer.
    • Do not use println() method.
    • Do not use PrintWriter to send binary data. Use ServletOutputStream.
    • Do not use sybchronized blocks in service method.
    • Do not create session object with directive <%@ page session="false" %>
    • Scope of ‘useBean’ action should be minimized.
    • Minimize the use ...
    Tags: jsp, performance Add / Edit Tags
    Categories
    Performance
  3. Listing the installed look and feels

    by , 02-15-2012 at 07:55 PM
    Java Code:
    import javax.swing.UIManager;
    
    public class TestClass {
    
    	public static void main(String args[]) {
    		UIManager.LookAndFeelInfo laf[] = UIManager
    				.getInstalledLookAndFeels();
    		for (int i = 0, n = laf.length; i < n; i++) {
    			System.out.print("LAF Name: " + laf[i].getName() + "\t");
    			System.out.println("  LAF Class name: "
    					+ laf[i].getClassName());
    		}
    		System.exit(0);
    ...
    Categories
    Uncategorized
  4. Adding External Jars in Eclipse

    by , 02-11-2012 at 05:46 PM
    There are 2 methods to add external jars in your Eclipse.

    Method 1

    Following steps explains this method.
    • Select your project and right Click. Select “Build Path”
    • Select “Configure Build Path”. It will open project properties.
    • Click “Add Variables”
    • Click new and type name of the new variable.
    • Select folder containing your jar for the path.
    • Click “Ok”

    Method 2

    • Right click your project. ...
    Tags: eclipse, jars Add / Edit Tags
    Categories
    JAR
  5. Converting a CVS Module into an Eclipse Java Project

    by , 02-11-2012 at 05:44 PM
    Follow these steps to convert a CVS module into an Eclipse Java Project.

    • Checkout your CVS module.
    • Launch your Eclipse
    • Select “New Project” -> “Java Project”
    • Enter the project name
    • Uncheck “Use Default” check box and select your CVS module directory
    • Click “Finish”
    • After completing above process, Eclipse will create “.project” and ”.classpath” files in your CVS module directory
    • Configure your “Java Build” path for ...
    Tags: cvs, eclipse Add / Edit Tags
    Categories
    CVS
  6. Eclipse – Convert Project Type

    by , 02-11-2012 at 05:42 PM
    It is not an easy job to change the project type in Eclipse, once it is created. For example, if you want to convert a simple java project to a dynamic web project. In this case, you cannot take benefits of web project perspective like web servers etc. In such situation, you might want to convert this project to a dynamic web project. To perform this type change, you need to change the project settings.

    In a case where you want to convert a Java Project, open “Resource” perspective ...
    Categories
    Project
  7. JD-Eclipse

    by , 02-11-2012 at 05:41 PM
    If you want to see all of your java sources in debugging process even if you do not have them then use “JD-Eclipse plug-in” for your Eclipse platform. JD-Eclipse is a free plug-in for any non commercial purposes. So you can use it in any commercial software products. This plug-in can be used freely for your personal need in any commercial or non commercial environments.

    Name:  1.JPG
Views: 579
Size:  26.9 KB

    JD-Eclipse plug-in


    Following platforms are supported ...
    Tags: jd-eclipse Add / Edit Tags
    Categories
    Plugins
  8. File I/O in eclipse

    by , 02-11-2012 at 05:38 PM
    In this section, we will explain the File I/O process in which your program will read from a text file and write to a text file. Following steps explains this process.

    • Create a new Java Program in your Eclipse.
    • Write the following lines of code into your Java Program.
    • Compile and run the Java Program.
    • It will read from a file and write it to another file.

    Java Code: This is the code to read and write a file
    import java.io.*;
    class FileRead 
    {
     public static void
    ...
    Categories
    Eclipse Files
  9. Eclipse General Usage Tips

    by , 02-11-2012 at 03:54 PM
    In this section, we will discuss some generic useful tips.
    • Double click to maximize window: You can maximize or restore a panel by double clicking its header.
    • Shorthand Templates: Shorthand typing is supported in Eclipse. Type the first few characters of any command and press ctrl+space and it will show you the related complete commands. It helps you in finding useful commands, help and speed up your development.
    • Intelli-Sense: Press ctrl-space to activate the intelli-sense. It
    ...
    Tags: eclipse tips Add / Edit Tags
    Categories
    Eclipse Examples
  10. Eclipse Debugging

    by , 02-11-2012 at 03:08 PM
    Debugging a program is very important in programming. It helps you in find errors and saves lot of time. In the following steps, we will create and debug a Java Program.

    1. Write a Java Program

    Write a program that computes the factorial of a number n. This program should have an error and gives wrong output. We will debug this program to find the error.

    2. Set Breakpoint


    Name:  1.JPG
Views: 177
Size:  20.9 KB

    Break Points

    ...
    Categories
    Debug
  11. Writing Your First Java Program in Eclipse

    by , 02-11-2012 at 03:03 PM
    Follow these steps to write your first Java program in Eclipse.

    1. Launch Eclipse

    • Click on “eclipse.exe” is the installation director of Eclipse.
    • Select a folder for your workspace.
    • Close the “welcome” screen.

    2. Create New Java Project

    For new application, you will create a new project to keep the entire related source and other files. To create a new Java project follows these steps.

    • Choose New from ...
  12. Create new Form in Eclipse

    by , 02-11-2012 at 02:59 PM
    Click the JFormDesigner button in toolbar of Eclipse. Also it can be initiated using following short keys.
    • For Windows (Ctrl+Shift+V)
    • For Mac (Shift+Command+V)

    To create a new form using Eclipse’s Package Explorer, select destination folder and right click. It will open following dialog box.

    Name:  1.JPG
Views: 7788
Size:  52.8 KB

    Create new Form in Eclipse
    Tags: eclipse, new form Add / Edit Tags
    Categories
    Eclipse GUI
  13. Benefits of using Eclipse Plug-ins

    by , 02-11-2012 at 02:56 PM
    Eclipse Plug-ins provides following benefits as compared to other development environments.

    • Integrated editor to create and design in Eclipse.
    • It uses current project’s source folders and classpath.
    • When you make changes in design, it changes in code accordingly.
    • In Java editor, you can fold generated Java code.
    • In Java editor, you can navigate to event handlers.
    • Strings in designer and properties file have two way synchronization. ...
  14. Conditional breakpoints in Eclipse

    by , 02-11-2012 at 02:55 PM
    To debug a Java Program in Eclipse, it allow to setup “conditional break points”. Conditional break points are based on conditions. Your debugging thread will stop when the specified condition is matched at the break point line.

    To setup a new conditional break point follow these steps.

    • Double click on the required line in your code on which you are interested to setup break point.
    • Right click -> Properties -> Insert condition.

    The ...
    Categories
    Eclipse Debug
  15. Increasing Eclipse Memory’s setting for Android Project

    by , 02-11-2012 at 02:49 PM
    The Android project has a large size and it causes memory issues while compiling this project. To avoid such memory issues, increase memory size. To increase the memory size, edit “eclipse.ini” file. This file is located at following location:

    Java Code:
    /Applications/eclipse/Eclipse.app/Contents/MacOS/eclipse.ini
    Default memory parameters are as shown below.

    Java Code:
    -Xms40m 
    -Xmx256m 
    -XX:MaxPermSize=256m
    Following ...
  16. Eclipse Remote Debugging

    by , 02-11-2012 at 02:46 PM
    Follow these steps to set up remote debugging in Eclipse.

    • Open your java project.
    • Select project.
    • Click Run -> Debug Configurations as shown below.

    Name:  1.JPG
Views: 536
Size:  12.5 KB

    Debug Configurations


    • A new dialog box will open with different configuration options. Select “Remote Java Application as shown below.

    Name:  1.JPG
Views: 550
Size:  19.2 KB

    Debug Configurations Option with Remote Java
    ...

    Updated 02-11-2012 at 03:50 PM by Eclipse

    Categories
    Eclipse Remote
  17. Eclipse Memory Analyzer (MAT)

    by , 02-11-2012 at 02:41 PM
    Eclipse Memory analyzer (MAT) is used to analyze memory leaks in your application. If an object has no reference, it is released by Java Garbage Collector. In a situation you get OutOfMemoryError, you can instruct Java Virtual Machine to create heap dump. The Eclipse Memory Analyzer provides a visual image of Java heap dump and helps to identify memory leaks. Use the following command to guide JVM to create a heapdump.

    XX:+HeapDumpOnOutOfMemoryError

    Name:  1.JPG
Views: 656
Size:  36.0 KB
    ...
  18. Installing Eclipse Plug-ins

    by , 02-11-2012 at 02:38 PM
    Eclipse is an extendible integrated development environment, which is open source platform and supports integration of new plug-ins. Eclipse supports building of new tools that can be integrated with it. Other than core runtime environment, everything in Eclipse is a plug-in. All the plug-ins are developed and integrated in almost same way.

    In this section, we will discuss on installing an Eclipse plug-in. below image shows the Eclipse SDK folder.

    Name:  1.JPG
Views: 592
Size:  4.9 KB
    ...

    Updated 02-11-2012 at 03:46 PM by Eclipse

    Categories
    Eclipse Plugin , Eclipse Install
  19. Eclipse Plug-in Deployment

    by , 02-11-2012 at 02:33 PM
    To deploy an Eclipse plug-in, deploy following into Eclipse intallation’s plug-in folder.

    • Manifest File
    • Jar Files
    • Any other resources

    Now Eclipse can activate this plug-in when it is required to perform some functionality. To activate a plug-in:

    • Load runtime class
    • Instantiate it
    • Initialize it

    Plug-in class is responsible for doing special tasks like allocation and reallocation of resources. For some ...
  20. The Eclipse Plug-in Model

    by , 02-11-2012 at 02:31 PM
    Plug-in is a component that supports a particular service or functionality in the Eclipse workbench. This component can be integrated into system at deployment time. Eclipse supports a wide variety of these plug-ins that can work together to support an environment for development. A plug-in in Eclipse is embodied in plug-in runtime class instance. This class provides some configuration functionality for the plug-in instance. A plug-in class must extend org.eclipse.core.runtime.Plugin which is an ...
  21. Develop a Java EE Application in Eclipse

    by , 02-11-2012 at 02:30 PM
    1. Setup Eclipse for Web Development

    • Install Eclipse for Java EE
    • Install a web server like tomcat of glassfish
    • Configure web server in your Eclipse
    o Launch Eclipse->Window->Preference->Server Node->Runtime Environment->Add->Expand Apache and add tomcat

    2. Hello Word JSP

    • Create a new Web Application
    o File->New->Dynamic Web Project
    o Enter “HelloJSP” as project name and enter finish
    ...
  22. Eclipse Architecture

    by , 02-11-2012 at 02:24 PM
    Eclipse is based on plug-ins and uses them to provide core functionality as compared to different other application where hard coded functionality is normally used. Eclipse is based on a runtime system called Equinox that is an implementation of OSGi core framework specification.
    This plug-ins is software components that allow Eclipse to extend using other languages like Python or C. Also this plug-ins provides support to work with network applications. Using this plug-ins, you can write ...
  23. What is Eclipse?

    by , 02-11-2012 at 02:22 PM
    Eclipse is an integrated development environment (IDE) that provides a software development environment and supports plug-ins. Eclipse is developed mostly in Java and it is used to develop Java applications with the help of plug-ins. Eclipse is also know as Eclipse ADT(Ada Development Toolkit) for Ada, for C/C++ it is called CDT, for Java it is called JDT and for PHP it is called PDT.

    It is released under Eclipse Public License; it is open source and free software. Below figure shows ...
    Tags: eclipse Add / Edit Tags
    Categories
    Eclipse Framework
  24. Exploring the Different Types of Android Dialogs

    by , 02-11-2012 at 01:04 PM
    Android SDK contains different types of Dialogs. These dialogs include following:

    • Dialog: Base class for all dialogs as shown in figure. It is usually used to inform user and is the simplest form of a dialog.
    • AlertDialog: This dialog contains a number of buttons as shown in figure. It is used to get user confirmation on some specific operations like delete a file.
    • CharacterPickerDialog: It is used to pick an accented character that is associated with base character. ...
    Categories
    Android Dialog
  25. Managing Android Application Permissions

    by , 02-11-2012 at 01:02 PM
    Android platform has a strong security model. It is based on Linux kernel and used its security as part of Android security model. Android application exists and run in its own virtual machine and it operates within boundaries of its Linux user account. Below figure explains this security model in depth.

    First declare access permissions in the Android manifest file before an application can access a privileged resource on its handset. It’s ensures security and enables that android ...
  26. Working with Layouts

    by , 02-11-2012 at 01:00 PM
    XML files that are called “layouts” are used to define Android application user interface screens. The XML files are a special type of resource and treated as a resource. These XML files are used to describe screen layout like how this screen will look like. This layout resource can be considered as a template. A layout resource is filled with different supported view controls which may refer to other resources like colors, strings, drawables and dimensions.

    These XML resources are ...
    Categories
    Android Layout
  27. Logging Android Application Information

    by , 02-11-2012 at 12:58 PM
    Android has a powerful logging utility class that is called “android.util.Log”. Different log messages are categorized in different groups with errors being the most severe. Following table list some popular methods of the Log class.

    Name:  1.JPG
Views: 477
Size:  19.0 KB

    Android Log Table


    First parameter passed to each Log method is a tag and its data type is String. The most common practice is to define a global static string that represents the complete application ...
    Categories
    Android Log
  28. Using Intents to Launch Other Applications

    by , 02-11-2012 at 12:53 PM
    Normally, activity classes within application’s package are launched. There are cases in which applications are interested in launching external activity class in other applications with suitable permissions. You can initialize applications by creating intent actions such as following:

    • Built-in web browser is launched and a URL address is supplied.
    • A web browser is launched and search string is supplied.
    • Built-in Dialer application is launched and a phone number ...
  29. Launching Activities Using the Application Context

    by , 02-11-2012 at 12:51 PM
    Call the startActivity() method of the application context. It is most commonly used to launch the activity. startActivity() method takes only one parameter which is called Intent. The below code shows a startActivity() method with an explicit intent.


    Java Code: This is the code to launch an activity
    startActivity(new Intent(getApplicationContext(),MenuActivity.class));
    In the above code, target activity is launched on request of intent, called MenuActivity. This MenuActivity class must be registered ...
  30. How to take emulator or device screenshot?

    by , 02-11-2012 at 12:46 PM
    You can take screenshots of the emulator or handsets which is very useful for debugging as shown in figure below.
    When you are using real devices, this screenshot aspect of DDMS perspective is very helpful. Follow below steps, to take a screen shot of your device and see what is happening.

    1. Select your device or emulator from DDMS perspective. The device you are selecting must be connected with USB data cable.
    2. Select your desired screen on the device or emulator. ...
Page 24 of 48 FirstFirst ... 14222324252634 ... LastLast