As per Google Play Store policies 'Beginning August 1st 2014, all updates and new apps uploaded to the Play Store must use the advertising ID (when available on a device) in lieu of any other device identifiers for any advertising purposes'
Can any one please guide me how to use Android Advertising ID. If some code posted will be more helpful for me.
As i was not using any ad's, is it mandatory that i have to use Advertising Id here ?
How to get Ad Tracking preference ?
Your apps don't need the advertising ID if they don't contain ads.
The advertising ID works like cookies in a web browser, is only meant for advertising purposes and enables users to reset or opt out of targeted ads within apps.
In admob, the advertising ID is available via the google play services library and not the deprecated GoogleAdmobADSSdk-6.X.X.jar.
So in future, if you wish to monetize your apps using admob, just make sure you use admob via the google play service library.
Thanks
EDIT: To answer your other question, according to the official docs, you are allowed to use the device ID for non-advertising purposes:
"Q: Can I use a persistent identifier for non-advertising purposes?
A: Yes, provided you have a privacy policy and handle the data in accordance with the Developer Terms, and all applicable privacy laws in the areas you make your app available."