I'm trying to follow Amazon instructions for implementing the Mobile Ads API, ran into a few issues/questions. Would appreciate all pointers. Anyone here implemented Amazon? I posted this in Amazon forum as well.
4 steps according to Amazon:
1. Incorporate the API into Your Project
2. Update the Android Manifest
3. Set Your Application Key
4. Add the Amazon Ad Layout to Your App
Steps 1 and 2 are automatic as I am using the Eclipse plugin, and it seems they completed OK
So I continued with step #3, Amazon says
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
AdRegistration.setAppKey("0123456789ABCDEF0123456789ABCDEF");
}
I got an error "R cannot resolve to a variable", how do I fix this?
I commented out line // setContentView(mGLView);
The next error is AdRegistration cannot be resolved, and my appkey was not resolve either
Did I miss a step?
Then I did the next step and added, all the lines gave errors.
// Programmatically create the AmazonAdLayout
this.adView = new AdLayout(this);
LinearLayout layout = (LinearLayout) findViewById(R.id.mainLayout);
// Set the correct width and height of the ad
LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(
LinearLayout.LayoutParams.MATCH_PARENT,
LinearLayout.LayoutParams.MATCH_PARENT);
layout.addView(this.adView,lp);
this.adView.loadAd(new AdTargetingOptions()); // This AsyncTask retrieves an ad
Thanks in advance
Comments
http://docs.giderosmobile.com/interface/ads
https://deluxepixel.com
Something like this should work (simply put it inside onCreate after
Bonus content, positioning an ad:
Likes: SinisterSoft
https://developer.amazon.com/appsandservices/resources/promotional-tools/featured-developer-program#benefits
This is worth more than the cost of the Indie licence imho.
https://deluxepixel.com
Thanks all. Yes, right after I posted the question, I downloaded and installed the Ads plugin last night. The docs for installing are easy to follow, the docs for using the plugin are a bit sparse. Will read up more tonight.
Project has compilation errors
I spent the last 2 days repeating all the steps but still has the same error. The only thing I found unusual is the gideros.jar file which gives me "Failed to loas Main-Class manifest attribute from ...\..\...\gideros.jar
If I remove the ads, re-export from gideros and re-import into Eclipse, export from Eclipse is successful.
Would appreciate all pointers. I know others have made it work so it must be me.
Thanks
"Failed to loas Main-Class manifest attribute from" Is really unusual, anything else?
And you can always send me a project to ar2rsawseen at gmail dot com to check out for you
https://deluxepixel.com