Browsed by
Month: January 2015

List Iteration using Lambda Expression in Java 8

List Iteration using Lambda Expression in Java 8

Lambda Expression: Lambda expressions are introduced in Java 8 and I feel its a great feature. Here we are going to see how to iterate the array list using Lambda expression.   List Iteration using Lambda Expression: import java.util.ArrayList; import java.util.List; import java.util.Arrays; public class LambdaIteration{ public static void main(String[] args){ List<String> progLangLst = new ArrayList<String>(); progLangLst.add("C"); progLangLst.add("C++"); progLangLst.add("Java"); progLangLst.add("PHP"); progLangLst.add(".Net"); // old way [from java 1.5] System.out.println("Printing the list values – old way"); for(String progLang : progLangLst){ System.out.println(progLang); }…

Read More Read More

673 total views, no views today

Detecting Phone shake using jQuery ios-shake.js

Detecting Phone shake using jQuery ios-shake.js

Detecting Phone shake using jQuery ios-shake.js: We all are having smart phones and checking all the details/shoppings/study everything with mobile only. So all the companies are changing and concentrating more on mobile view/mobile apps than web developments. Even we are already having many mobile apps to change the songs based on the mobile shake. Today we are going to see the phone detection using used jquery ios shake js and it is expected to be implemented in all the areas…

Read More Read More

754 total views, no views today

JSON in Servlet with Ajax call

JSON in Servlet with Ajax call

JSON in Servlet with Ajax call: JSON is a amazing alternate for XML to pass/transfer the informations. It is required to know how to handle JSON in servlet. In servlet it can be handled like this, request.setCharacterEncoding("utf8"); response.setContentType("application/json"); // json is the JSON object. response.getWriter().print(json); But if you want to call your servlet through ajax, then we should handle the JSON response in JS also to display JSON in jsp page, else only object object will be printed in JSP…

Read More Read More

848 total views, 1 views today

Android Toast Example

Android Toast Example

Android Toast Example: Android toast can be used to display the internet connectivity status and application exit status. It can be used to make the more interaction to the application. Android toast example given below to help you in android programming!.             Toast.makeText(): Toast.makeText method used to display the toast. we need to pass the three parameters, 1. Context 2. String to display in toast (EditText value should be used with getText method) 3. Toast…

Read More Read More

683 total views, 1 views today