#This Eclipse project is outdated. Please refer to the Android Studio app for a more current example of how to use the CommuteStream SDK: https://github.com/CommuteStream/SimpleBanner-AndroidStudio
SimpleBanner provides a basic example of how to use the CommuteStream SDK. These instructions are designed for Eclipse users.
- Android SDK 3.2 or higher
- Google Play Services SDK and Google Mobile Ads SDK for Android
- CommuteStream SDK for Android
- Working AdMob Ad ID
- Eclipse
- https://github.com/CommuteStream/simplebanner.git
- In Eclipse, Click the File menu, and select Import.
- Select Existing Android Code Into Workspace, click Next.
- Click the Browse button and select the base directory of the source code.
- Click Finish.
- Right click on your app project in Eclipse and select Properties.
- Select Android and make sure you have selected a version greater that 3.2 under Project Build Target.
- If you havn't already, install Google Play Services: https://developer.android.com/sdk/installing/adding-packages.html
- Right click on your app project in Eclipse and select Properties.
- Select Android and then click Add.... Find the google-play-services_lib project and select OK to add the Google Play services library.
- Download the jar file from https://commutestreamdev.com/downloads/commutestream.jar
- Right click on your app project in Eclipse and select Properties.
- Select Java Build Path and the Libraries tab.
- Click Add External JARs... to add the CommuteStream Jar file.
- Select the Order and Export tab; check the box next to the Jar file.
- The android-support-v4.jar is included in the Android SDK in the \extras\android\support\v4 folder. Visit http://developer.android.com/sdk/compatibility-library.html#Downloading for more information.
- Include this jar the same way as the CommuteStream jar above.
- Log into the AdMob interface (https://apps.admob.com/).
- Setup a new + New ad unit or find an Ad Unit ID that you already have setup.
- In SimpleBanner.java, replace "INSERT_YOUR_ADMOB_AD_UNIT_ID_HERE" with the valid Ad unit ID.
-
Go to http://commutestream.com/publisherinterface/app. After signing in you will be provided with a CommuteStream Ad Unit ID. Leave the browser window open, as we will need this ID in step 8 below.
-
Log into the AdMob interface (https://apps.admob.com/).
-
Click on Monetize tab of main menu.
-
Click on All apps in left column, then select the app that contains the ad unit you are using.
-
On the right side of the screen click Edit mediation link next to the ad unit you are using.
-
Click + New ad network
-
Click + Custom Event, then enter the following in the three fields that pop up, and click Continue:
Class Name: com.commutestream.ads.Banner Label: CommuteStream Parameter: <Your Ad Unit ID obtained in step 1>
-
Adjust the Default eCPM for CommuteStream to be the largest amount. Since we pay you the most you will want our ads to have first priority.