changed code to make project as library and can be used with android projects