Created
October 4, 2013 10:55
-
-
Save marinat/6824208 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 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 | |
} | |
} |
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 android.content.Context; | |
import android.util.Log; | |
import android.widget.Toast; | |
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 message = args[0].getAsString(); | |
Context toastContext = context.getActivity(); | |
Toast toast = Toast.makeText(toastContext, message, Toast.LENGTH_SHORT); | |
toast.show(); | |
Log.i("Notification Extension", "Toast OK"); | |
} catch (Exception e) { | |
e.printStackTrace(); | |
Log.i("Notification Extension", "Toast Error"); | |
} | |
return null; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment