Traditional solution to this problem is :
calculate the sum of the square of each digit until it is equal to 1 or has a recurrence
However,there is no need to calculate the sum every time.
As we all know,

each digit's range is [0,9]

the range of Integer is [0,2^311],that is [0,10] in number of digits
which means the square sum of each digit would always be in range[0 , 9 * 9 * 10) or [0 , 810)
to speed up our processing,we can precalculate the happy numbers in range[0. 810)
,
and store them in our program for later lookups
Here is my implementation:
//this is the bitset representation of happy numbers in range[0,810)
private static final long[]happyMark = new long[]{580548859274370L, 35812649762896L,
5764889547766761510L, 158621866461187L, 9061136725337702208L,
8574391826910016959L, 4683743612499927428L, 286423854940160L,
29290989780729856L, 7566260683533189120L, 1170945809492058640L,
720593571220033568L, 292095590400L};
public boolean isHappy(int n) {
if( n>810 ){
int sum = 0, remainder = 0;
while( n>0 ){
remainder = n%10;
sum += remainder*remainder;
n /= 10;
}
n = sum;
}
int idx = ( n>>6 );
long bitRep = ( 1L<< (n&0x3f) );
return ( happyMark[idx]&bitRep )!=0;
}