问题
I just received email from Google that on 17th oct on-wards they will stop displaying ads as the methods got deprecated.I also studied about it on some links as follows :-
https://firebase.google.com/docs/admob/android/quick-start
https://github.com/googleads/googleads-mobile-android-examples
The above is GitHub link , the sample provided by Google with new SDK , as that is for android -studio , as my applications are already in market from past 2 years. So Do I need to migrate my whole project to Android studio ? Or is there some way to do updation in eclipse ?
I also Found a link which states that if we are using Google Play services with version higher that 4 then our ads will not get effected by Google
Here is the link :- Upgrade your Android Google Mobile Ads SDK to ensure ads keep serving
Here is my Google Play Service version detail :-
android:versionCode="5089000"
android:versionName="5.0.89-000"
Method i am using to get Ads :-
private void getAds() {
try {
AdRequest adRequest = new AdRequest.Builder()
.addTestDevice(AdRequest.DEVICE_ID_EMULATOR)
.addTestDevice("").build();
adView.loadAd(adRequest);
adView.setBackgroundColor(Color.BLACK);
} catch (Exception e) {
e.printStackTrace();
}
}
In My XML :-
<com.google.android.gms.ads.AdView
android:id="@+id/adView"
android:layout_width="match_parent"
android:layout_height="60dp"
android:layout_gravity="bottom"
ads:adSize="BANNER"
ads:adUnitId="YOUR KEy"
android:background="@drawable/container_ads_bg" />
Please Have a look at this link too :-
https://firebase.google.com/docs/admob/android/existing-app
This shows that this can be done in eclipse too.
The thing is my code is pretty old its almost 3 years old so i am little afraid in migrating it , but if i have no other option left with me then i will surely migrate it.
So do I need to update the SDK and Configure it with FireBase ?
Please let me know ,as we have very less time left to update the SDK.
Thanks.
回答1:
I would suggest migrate to Android Studio and use inbuilt utility of adMob and Firebase
In your case, please import your project into Android studio, it will suggest, ways to update project with latest SDKs.
来源:https://stackoverflow.com/questions/39463150/ads-mob-sdk-updation-in-eclipse