How to and where to unbind service my application is crashing due to beacon service exception

please reply me as fast as possible

stopRanging will unbind service, you can see from AprilBeaconDemos

by calling stop ranging it will stop scanning for beacons for a while i want to range beacons for all the time when app is running.
where I need to call stopranging method in onstop or ondestroy method.please let me know.

You can put the ranging in a service

hell where do i have to kept the stopRanging() method in order to eradicate the crashing in the application.
my application is crashing by displaying service leaked exception.

can i get the crash log

sure please check this file sorry i send through mail hell please check it

05-28 11:05:48.776: E/AndroidRuntime(14740): java.lang.NullPointerException: Attempt to invoke virtual method ‘android.content.res.Resources android.content.Context.getResources()’ on a null object reference

crash may be for this reason

check the line 427

service leaked exception again app is crashing please guide me where it is happening

i am sending my 2 class files

Because your app is crash of notification is null , and your app crash but the service have not unbind.
Check your code of line 427 , the notificaiton is null

service exception can’t make your app crash , you should check the log to find what cause the crash.