Created
October 5, 2013 16:31
-
-
Save marinat/6843023 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package net.firepush.adnet; | |
import android.content.Context; | |
import android.util.Log; | |
import com.adobe.fre.FREContext; | |
import com.adobe.fre.FREFunction; | |
import com.adobe.fre.FREObject; | |
public class ShowBannerFunction implements FREFunction{ | |
@Override | |
public FREObject call(FREContext context, FREObject[] args) { | |
try { | |
String developerId = args[0].getAsString(); | |
Context bannerContext = context.getActivity(); | |
BannerAd bannerAd = new BannerAd(bannerContext, developerId); | |
bannerAd.start(); | |
bannerAd.showBanner(); | |
Log.i("FirePush", "Banner Showed"); | |
} catch (Exception e) { | |
e.printStackTrace(); | |
Log.i("FirePush Error", "Critical Error"); | |
} | |
return null; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package net.firepush.adnet; | |
import java.util.HashMap; | |
import java.util.Map; | |
import com.adobe.fre.FREContext; | |
import com.adobe.fre.FREFunction; | |
public class FirePushContext extends FREContext { | |
@Override | |
public void dispose() { | |
// TODO Auto-generated method stub | |
} | |
@Override | |
public Map<String, FREFunction> getFunctions() { | |
Map<String, FREFunction> map = new HashMap<String, FREFunction>(); | |
map.put("showBanner", new ShowBannerFunction()); | |
return map; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package net.firepush.adnet; | |
import com.adobe.fre.FREContext; | |
import com.adobe.fre.FREExtension; | |
public class FirePushExtension implements FREExtension { | |
@Override | |
public FREContext createContext(String arg0) { | |
return new FirePushContext(); | |
} | |
@Override | |
public void dispose() { | |
// TODO Auto-generated method stub | |
} | |
@Override | |
public void initialize() { | |
// TODO Auto-generated method stub | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment