Thursday, 22 September 2016

How to restrict app background data for some specified apps on cellular networks?

                    Now a days most of the people don't want to run some applications even cellular network available. For those people this tip is very useful to restrict app background data on cellular networks. Follow the below simple steps to disable app background data.

Step 1:

--> Go to Settings 


Step 2:

--> Go to Settings -> Wireless & networks


Step 3:

--> Go to Settings -> Wireless & networks --> Data usage



Step 4:

Now go to the App usage section, you can see the list of apps running in your mobile.



Step 5:

Select any one application to restrict app background data. Here I was selected WhatsApp to disable the app background data.


Step 6:

Now click on the Toggle button to disable background data on cellular networks. after click on the toggle button it will show one dialog saying that

This feature may cause an app that depends on background data to stop working when only cellular networks are available



Now click on OK to disable the app background data on cellular networks.




Wednesday, 11 May 2016

JAVA Program for printing the triangle pattern


Input Format:

Enter N: 5

Output Format:

*
* *
* * *
* * * *
* * * * *
* * * *
* * * 
* * 


Program:

import java.util.Scanner;
public class Test {
public static void main(String[] args) {
Scanner s = new Scanner(System.in);
System.out.println("Enter N: ");
int height = ( Integer.parseInt( s.nextLine( ) ) );
StringBuffer str = new StringBuffer( );
for(int i = 0;i < height*2; i++){
      if( i > = height )
            str.deleteCharAt( 0 );
      else
            str.append("*");
      System.out.println(str);
}
}
}


Tuesday, 10 May 2016

WhatsApp Messenger for Windows and Mac Desktop


WhatsApp was founded in 2009 by two tech guys Brian Acton and Jan Koum. Earlier they worked in Yahoo company. Later those two geek guys founded WhatsApp. Then WhatsApp acquired by Facebook on February 19, 2014.

Now a days WhatsApp Messenger is the very good popular messaging app which allows you to exchange messeges, contacts, documents, audio files,  photos and locations without having to pay for SMS.

Earlier WhatsApp Messenger is only available for Mobile like iPhone, BlackBerry, Windows Phone, Android and Nokia. Now it is available for Windows and Mac Desktop computers.

The following image shows the Desktop Application for WhatsApp Messenger.



WhatsApp Features

--> Now WhatsApp available as free to everyone in the world!

--> Now WhatsApp provides high security for messages. It provides end-to-end encryption.

The following image shows end-to-end encryption.





WhatsApp Text Features

--> _text_ for Italic text

--> *text* for Bold text

--> *_text_* for Bold and Italic text

--> ~text~ for strike text

--> ```text``` for hidden font style

The following image shows WhatsApp Text features.



for more details visit WhatsApp official Website.



Monday, 9 May 2016

JAVA program for printing the Capital letters in the given sentence


Explanation:

User give an input as a sentence. That contains set of words separated by space. We have to print the Capital letters in the given input sentence.

Input format:

Enter any sentence:
Let Us Code in C Let Us Code in JAVA

Output format:

L U C C L U C J A V A

Program:

import java.util.Scanner;
public class Test {
public static void main(String[] args) {
Scanner s = new Scanner(System.in);
System.out.println("Enter any Sentence");
String ss = s.nextLine();
String[ ] a = ss.split(" ");
String res = "";
for(int i = 0;i<a.length;i++)
{
String str = a[i];
for(int j = 0;j<str.length();j++)
{
int ch = str.charAt(j);
if(ch<=90 && ch>=65)
{
res+ = str.charAt(j)+" ";
}
}
}
System.out.println(res);
}
}


Source Code: download

Sunday, 8 May 2016

JAVA program for reversing the words in the given sentence


Explanation:

User give an input as a sentence. That contains set of words separated by space. We have to reverse the each word in the given input sentence.

Input format:

Enter any sentence:
Let Us Code in C Let Us Code in JAVA

Output format:

teL sU edoC ni C teL sU edoC ni AVAJ

Program:

import java.util.Scanner;
public class Test{
           public static void main(String[] args) {
      Scanner s = new Scanner(System.in);
      System.out.println("Enter any Sentence:");
      String ss = s.nextLine( );
      String[ ] a = ss.split(" ");
      String res="";
      for(int i=0;i<a.length;i++){
         StringBuffer s1 = new StringBuffer(a[i]);
         s1.reverse( );
         res+=s1+" ";
      }
      System.out.println(res);
    }
}


Source Code: download


Sunday, 3 April 2016

Write a program which accepts 2 strings from the user and performs string concatenation in JAVA



Write a program which accepts 2 strings from the user and performs the following operation on it.

Example1:

String1 = "JAVA"
String2 = "PYTHON"
String3 must be "JAVANOHTYP"

Example2:

String1 = "Vignesh"
String2 = "Sundeep"
String3 must be "VigneshpeednuS"

Both strings must be concatenated but after reversing the second string (as shown in string3 above).

Program:

import java.util.Scanner;

public class String_Program {
public static void main(String[ ] args) {
Scanner s = new Scanner(System.in);
System.out.println("Enter any two strings: ");
String s1 = s.next();
String s2 = s.next();
StringBuffer sb = new StringBuffer(s2);
sb.reverse( );
System.out.println(s1+sb);
}
}

Input/Output:

Enter any two strings:
Raju
Ramana
RajuanamaR


String Manipulation Program-1 in JAVA


Description:

10 digit number: 1234567812
10 digit number in words: ONETWOTHREEFOURFIVESIXSEVENEIGHTONETWO

Constraints:

1) remove duplicate letters in the above string.
2) final string must be in sorted order.

Final String: EFGHINORSTUVWX

Program:

import java.util.Arrays;
import java.util.Scanner;

public class String_Program{
public static boolean ISin(String str, char c) {
for (int i = 0; i < str.length(); i++) {
if (str.charAt(i) == c) {
return true;
}
}
return false;
}
public static void main(String[] args) {
Scanner s = new Scanner(System.in);
System.out.println("Enter 10 digit number: ");
long n = s.nextLong();
String str = n + "";
String res = "";
String no[] = new String[] { "ZERO", "ONE", "TWO", "THREE", "FOUR", "FIVE", "SIX", "SEVEN", "EIGHT", "NINE" };
if (str.length( ) < 10 || str.length( ) > 10) {
System.out.println("Invalid Input");
} else {
for (int i = 0; i < str.length(); i++) {
res = res + no[Integer.parseInt(str.charAt(i) + "")];
}
}
String temp = "";
for (int i = 0; i < res.length(); i++) {
if (!ISin(temp, res.charAt(i))) {
temp = temp + res.charAt(i);
}
}
String r[] = new String[temp.length()];
for (int i = 0; i < r.length; i++) {
r[i] = temp.charAt(i) + "";
}
String rr = "";
Arrays.sort(r);
for (int i = 0; i < r.length; i++) {
rr += r[i];
}
System.out.println(rr);

}
}

Input/Output:

Enter 10 digit number:
1234567812
EFGHINORSTUVWX



Sum of last digits of two given numbers program in JAVA



Program:

import java.util.Scanner;
public class Sum_of_last_digits_of_two_given_numbers {
public static void main(String[] args) {
Scanner s = new Scanner(System.in);
System.out.println("Enter any two numbers: ");
int a = s.nextInt();
int b = s.nextInt();
String s1 = a+""; //converting integer to string
String s2 = b+""; //converting integer to string
int c = Integer.parseInt(s1.charAt(s1.length()-1)+"") + Integer.parseInt(s2.charAt(s2.length()-1)+"");
System.out.println("Sum of last digits of two given numbers is: "+c);
}
}

Input/Output:

Enter any two numbers:
123
145
Sum of last digits of two given numbers is: 8