| | |
| | | public final static String POSITION_SPLASH = "splash";//开屏 |
| | | public final static String POSITION_VIDEO_PLAY_PRE = "videoPlayPre";//视频播放前贴 |
| | | public final static String POSITION_EXIT_APP = "exitApp";//APP退出广告 |
| | | public final static String POSITION_SEARCH = "videoSearch";//搜索页广告 |
| | | |
| | | public static AD_TYPE getSmallExpressAdType() { |
| | | if (BeibeiConstant.AD_TYPE != null && AdTypeVO.TYPE_CSJ.equalsIgnoreCase(BeibeiConstant.AD_TYPE.getExpressSmallType())) { |
| | |
| | | if (!StringUtils.isNullOrEmpty(config)) {//万一没设置起就用广点通 |
| | | try { |
| | | JSONObject object = new JSONObject(config); |
| | | return AD_TYPE.valueOf(object.optString(positionName)); |
| | | object = object.optJSONObject(positionName); |
| | | if (object != null) |
| | | return AD_TYPE.valueOf(object.optString("type")); |
| | | } catch (JSONException e) { |
| | | e.printStackTrace(); |
| | | } catch (Exception e1) { |
| | |
| | | return null; |
| | | } |
| | | |
| | | public static String getAdPid(Context context, String positionName) { |
| | | SharedPreferences share = context.getSharedPreferences("adConfig", Context.MODE_PRIVATE); |
| | | String config = share.getString("config", ""); |
| | | if (!StringUtils.isNullOrEmpty(config)) {//万一没设置起就用广点通 |
| | | try { |
| | | JSONObject object = new JSONObject(config); |
| | | object = object.optJSONObject(positionName); |
| | | if (object != null) |
| | | return object.optString("pid"); |
| | | } catch (JSONException e) { |
| | | e.printStackTrace(); |
| | | } catch (Exception e1) { |
| | | return null; |
| | | } |
| | | } else { |
| | | return null; |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | |
| | | } |