If you want to fetch the package name of your app or currently opened app in android, than use the below code. Please let me know if you face any problem here.
//this will return package name of your app
//this will return package name of your app