Posts

Adding Google Map API to Android App

Image
Android development is  fun relative to other similar technology platforms and you can call it as a hobby too.  DEVELOPING Android  application will give same amount of fun as playing with application in phone. Google made it so easy by providing few APIs that is also for free! Here I'm going  to explain about Google Map API and how one can make use of these APIs in his Android app. I'm making use of the Android Studio, steps may vary depending upon the tool you use Step 1 : Creating Android Project Open Android Studio and create a new  Android Project     Provide a valid package name and click on Next .    Select Minimum SDK as per the requirement. If you are developing application for KitKat version    you can chose API 19    Click on Next         Select Google Map Activity as a launcher activity. (You can also select other activity as launcher activity and can ...

Create DAO using hibernate in few clicks

Image
Hibernate is a high-performance Object/Relational persistence and query service which is licensed under the open source GNU Lesser General Public License (LGPL) and is free to download. Hibernate not only takes care of the mapping from Java classes to database tables (and from Java data types to SQL data types), but also provides data query and retrieval facilities. So here I'm going to describe how to generate POJO( Plain Old Java Object ) from database and corresponding DAO ( Data Access Object )  to manipulate/query tables programming way. I'm using Eclipse Mars  in this example. Step 1 :  Install JBoss tool from Eclipse Market Place which has a Eclipse plugins for Hibernate  Help->Eclipse Marketplace Step 2 : Create a Maven Project as shown Select Artifact type as maven-archetype-quickstart then click  Next        Enter GroupId , artifact Id and package name then click Finish which will c...

Functional Programming in JAVA

JAVA 8 release is the package of all surprises, functional programming is one among them. Let's explore a bit on functional programming style in java... Functional programming is the natural successor to Object Oriented programming.The objective of the design of the FPL is to mimic mathematical functions to the greatest extent possible. Will start with examples for functional programming in java Normally if we want to write any functions say addition of two numbers we were following below approach: public int add(int x,int y) {    return x+y; } The above piece of code can be written in FP style like Function<Integer,Integer> adder = (x,y)->x+y; Where Function belongs to the package  java.util.function General prototype     java.util.function.Function<T,R>      where T is input datatype, R is return data type. Java has one more Interface called  BinaryOperator under  java.util.function  which ...

Password Manager

Image
We deal with passwords everyday and it is very important to have a strong password now a days. So here is the sample application created by me (Yeah! during boring time 😜) Hope you guys will like it!. Initial Screen:- This is the startup screen which allows you to enter environment and username of the credential after entering details click on Generate Password. Password generated ;- Here you are allowed to store generated password with username and environment details locally in desktop so that you can get it at any time. It also allows you to change password format that gets generated so that you can make it even more complicated. This application was developed using Java SE using NetBeans editor You can find source code in git  link Happy Coding :)

Lambda expression in Java - A new way of coding

Image
How it looks if we have functionality of passing the method implementation as a parameter?Awesome isn't it? Yeah now we can do this magic in Java through Lambda expression.Oracle recently included Lambda expression in Java as a part of Java 8 release. So let's explore few things about Lambda expression in Java. A lambda expression is like syntactic sugar for an anonymous class with one method whose type is inferred.  Syntax :  The main syntax of a lambda expression is “parameters -> body”. The compiler can usually use the  context of the lambda expression to determine the functional interfac e  being used and the types of  the parameters. There are four important rules to the syntax: Declaring the types of the parameters is optional. Using parentheses around the parameter is optional if you have only one parameter. Using curly braces is optional (unless you need multiple statements). The “return” keyword is optional if you have a sing...