Thursday, January 19, 2017

Android How to check App is in Background or Foreground

In some case, you might want to check your app is running in background or foreground, such as you want to show push notification message only when the app is in background. The following method will be very easy to know app running state.



Share:

Wednesday, January 18, 2017

Java Best Books For Learning - Best of lot, Must Read : From Beginner to Professional

We are sharing the best books for learning Java, which are read by almost every Java Developer, make you different and give an extra edge against the students who have just basic knowledge java.


Share:

Monday, January 16, 2017

Java Difference between Abstract class and Interface

Abtract class and interface both are used to achieve abstraction.
In this post, I will show you Diffence between Abstract class and Interface.


Share:

Wednesday, January 11, 2017

Java Count Number of Words in String

In this post, I will show you How to count number of Words in the String. It's easy via array and string class.




For example : "Hello World"
Result : 2.

Coding:


public class StringDemo
{
    static int i,c=0,res;
    static int wordcount(String s)
    {
        char ch[]= new char[s.length()];      //in string especially we have to mention the () after length
        for(i=0;i<s.length();i++)
        {
            ch[i]= s.charAt(i);
            if( ((i>0)&&(ch[i]!=' ')&&(ch[i-1]==' ')) || ((ch[0]!=' ')&&(i==0)) )
            c++;
        }
        return c;
    }
    
    public static void main (String args[])
    {
        res=StringDemo.wordcount("Java Tutorial for Begginers");
        //string is always passed in double quotes
        
        System.out.println("Result : " +res);
    }
}
Result : 3

Good luck!
Share:

Java Difference between String, StringBuffer and String Builder

In this post, I will show you The difference between String, StringBuffer and String Builder. As you will find that there are minor differences between the above classess.


Share:

Java Difference between ArrayList and Vector

This question is mostly used as a start up question by Interviewers testing deep roots of the Collection. Some differences between ArrayList and Vector.



Share:

Java Spring How to use JDBCTemplate Query

In this post, I will show you How to use JdbcTemplate query() method to query or extract data from database.



Share:

Tuesday, January 10, 2017

Java How to implement Jersey Restful Webservice

In this post, I will show you How to implement Jersey Restful Webservice.


Share:

Monday, January 9, 2017

Java How to read and write Json

In this post, I will show you How to read and write Json using JSON.simple.





Share:

Java How to generate random number in a range

In this post,  I will show you How to generate random in a range (integer range) via follwing ways.




Share:

Java How to convert String to Date

In this post, I will show you How to convert String to Date in Java.




Share:

Java How to add day to current date

In this post, I will show you How to add day to current date, using following APIs.

Share:

Java How to send email via Gmail SMTP

In this post, I will show you How to send email via Gmail SMTP, using both TLS and SSL connection.



Share:

Java Read and Write PDF

In this post, I will show you How to read and write PDF in java using iText PDF library.


Share:

Java How to count duplicated items in List

In this post, I will show you How to count number of duplicated items in a List.



Share:

Java How to validate phone number

In this post, I will show you How to validate phone number using Regular expression.


Share:

Sunday, January 8, 2017

Java How to write to File

In this post, I 'll show you how to write to File via  following APIs:



Share:

Java How to send HTTP GET/POST

In this post, I will show you standard method to make HTTP GET/POST request using java.



Share:

Apache POI - Java Reading and Writing Excel file

We 'll guide you about how to read and write excel file using Apache POI


Share:

Android Push Notification with Firebase Cloud Messaging & Java Server

Now, Google Inc removed GCM and start using FCM to push notification.
We 'll instruction to you How to intergrate Firebase to your backend, so that you can send messages from your server.




Share:

Android Build Application with Firebase Realtime Database

In this post, I will show you How to build Application with Firebase. You can download source code here Demo Chatting.



Share:

Total Pageviews