Create fixed size list in java

This is a example about creating fixed size list in java. There are two ways to create fixed size list. 1. Using Arrays.asList(yourArrayObject); 2. Using Apache commons FixedSizeList class. Here i will explain both methods. Both are almost same. Let’s start with first one. Arrays.asList(yourArrayObject); Below is the best and simple way to create fixed […]

Share
Continue reading →

Java Collection API (About List,Set and Map)

Java Collection API (About List,Set and Map) This document will only focus on List Set and Map difference and Tree and Map difference. Difference between List and Set (Both are interface): There is only two main difference between list and set 1) List does accept duplicate value (Data), Set does not accept duplicate value (Data). […]

Share
Continue reading →

Android Enable Disable HotSpot Programmatically

This is an example of how to enable disable Hotspot programmatically. NOTE: Before enable hotspot you need to turn off Wifi. Check How to enable disable wifi in android Following method will enable disable hotspot. Following permission require : android.permission.ACCESS_WIFI_STATE android.permission.CHANGE_WIFI_STATE android.permission.ACCESS_NETWORK_STATE But to run this method you need WifiApControl.java WifiApControl.java

Share
Continue reading →

Android Network Utility

This is custom utility. It is very helpful to handle enable disable things for hardware like Bluetooth,Wifi and Hotspot. You can also identify how many number of device connected with your HotSpot. This utility have following most important methods : 1) Check Is phone connected to internet public static boolean isConnectedToNetwork(Context context); 2) Check Is […]

Share
Continue reading →

Socket programming in java

This is example of Java Socket. Here I created small chat application to explain Socket programming in java Find below class work as Server Find below class work as Client Here in both example we are using Two threads : 1. ReaderThread : To read value from InputStream 2. WriterThread : To write value to […]

Share
Continue reading →

MenuBar not working for eclipse in Ubuntu

MenuBar not working for eclipse in Ubuntu I upgrade my ubuntu from 13.04 to 13.10 but in 13.10 eclipse menubar is not working properly. In Unity there is one flag : UBUNTU_MENUPROXY, This is environment variable in ubuntu. Default value of this flag is 1. Check default value in your PC by typing below command […]

Share
Continue reading →