Showing posts with label Java. Show all posts
Showing posts with label Java. Show all posts

Friday, August 01, 2014

Java Github Project URL - Kapil Sharma

Java Github Project URL: https://github.com/bornfreesoul/java

On the above URL. I regularly update code example of different types of java application. 

The purpose is to use them in your coding practice or use them as methods in your code if they suits your coding need :) 

Fast learning is all ways mutual sharing of your knowledge :) 

So keep on sharing and keep on leaning new things ;)


Saturday, September 14, 2013

How to create your first Java code on Eclipse: Class 200

     How to create your first Java code on Eclipse: Class 200

     Double click on Eclipse short-cut icon, mine Eclipse IDE is Juno flavour. 
    
    Click New+ under file menu option then again click on Java project.(Fig. J1) 
     
    Click next after entering Java Project name.(Fig. J2) 

In Java settings page (Fig. J3) just click finished. 
     
    After this the IDE workbench windows (means the windows for writing code opens) now, again right click on “src” folder select “New” and then select “Class” (Fig. J4). 
    
    A New Java “class” file windows opens up, write down the name for that class and click finished. (Fig. J5). 
     
    Now the user named class file open up. (Fig. J6
    
    Now write down the code, which shared in the Fig. J7.  
     
    And now, you can see your output/result in the eclipse-ide console window. 

Monday, August 13, 2012

Android on Linux (Ubuntu)


First download this package a .tgz. Unpack it to a safe location on your Ubuntu machine.

Package Name: Linux (i386) >> android-sdk_r20.0.1-linux.tgz

By default, the SDK files are unpacked into a directory named android-sdk-linux_x86.

Make a note of the name and location of the SDK directory on your system—you will need to refer to the SDK directory later, when setting up the ADT plugin and when using the SDK tools from the command line.

Troubleshooting Ubuntu If you need help installing and configuring Java on your development machine, you might find these resources helpful:o https://help.ubuntu.com/community/Javao https://help.ubuntu.com/community/JavaInstallation


  • Here are the steps to install Java and Eclipse, prior to installing the Android SDK and ADT Plugin.


1. If you are running a 64-bit distribution on your development machine, you need to install the   
    ia32-libs package using apt-get::apt-get install ia32-libs
2. Next, install Java: apt-get install sun-java6-jdk
3. The Ubuntu package manager does not currently offer an Eclipse 3.6 version for download,  
     so we recommend that you download  Eclipse from eclipse.org (http://www.eclipse.org/ 
     downloads/). A Java or RCP version of Eclipse is recommended.
4. Follow the steps given in previous sections to install the SDK and the ADT plugin.

The Android SDK separates tools, platforms, and other components into packages you can download using the Android SDK Manager. The original SDK package you've downloaded includes only the SDK Tools. To develop an Android app, you also need to download at least one Android platform and the latest SDK Platform-tools. You can update and install SDK packages at any time using the Android SDK Manager. If you've used the Windows installer to install the SDK tools, you should already have the Android SDK Manager open. Otherwise, you can launch the Android SDK Manager in one of the following way.


  • On Mac or Linux, open a terminal and navigate to the tools/ directory in the Android SDK, then execute android sdk.


When you open the Android SDK Manager, it automatically selects a set of recommended packages. Simply click Install to install the recommended packages. The Android SDK Manager installs the selected packages into your Android SDK environment. 

The following sections describe some of the available SDK packages and more about which ones we recommend you install.Once you have installed your packages, continue to the next page.























Figure Alpha. The Android SDK Manager shows the SDK packages that are available, already installed, or for which an update is available.

Source: http://developer.android.com/sdk/installing/index.html

Tuesday, March 06, 2012


Mockito: 
 
It lets you write beautiful tests with clean & simple API.

Mockito tests are very readable and they produce clean verification errors.


Some features:
1.) Mocks concrete classes as well as interfaces
2.) Little annotation syntax sugar - @Mock
3.) Verification errors are clean - click on stack trace to see failed verification in test; click on exception's cause to navigate to actual interaction in code. Stack trace is always clean.
4.) Allows flexible verification in order (e.g: verify in order what you want, not every single interaction)
5.) Supports exact-number-of-times and at-least-once verification
6.) Flexible verification or stubbing using argument matchers (anyObject(), anyString() or refEq() for reflection-based equality matching)
7.) Allows creating custom argument matchers or using existing hamcrest matchers

Distribution:
Single-jar distribution includes cglib, objenesis and source code
Zip distribution contains all jars, javadoc and source code