public void setViewSize(int width, int height) {

    mView.setAdspaceWidth(width);
    mView.setAdspaceHeight(height);
    //  mView.startReloadTimer();
    mView.loadNextAd();
  }
 @Override
 public void setProperty(String name, Object value) {
   if (name.equalsIgnoreCase("keywords")) {
     mKeywords = value.toString();
     if (mKeywords.length() > 0) mView.setKeywords(Arrays.asList(mKeywords.split(" ")));
   }
 }
 @Override
 public View createView() {
   mView =
       new AdView(
           mContext,
           REQUEST_URL,
           mControlInfo.optStringProperty("@SDAdsViewPublisherId"),
           true,
           true);
   if (mUserAge > 0) mView.setUserAge(mUserAge);
   mGender = mControlInfo.optStringProperty("@SDAdsViewUserGender");
   if (mGender.equalsIgnoreCase("female")) mView.setUserGender(Gender.FEMALE);
   if (mGender.equalsIgnoreCase("male")) mView.setUserGender(Gender.MALE);
   mKeywords = mControlInfo.optStringProperty("@SDAdsViewKeywords");
   if (mKeywords.length() > 0) mView.setKeywords(Arrays.asList(mKeywords.split(" ")));
   mView.setAdspaceStrict(
       false); // Optional, tells the server to only supply banner ads that are exactly of the
               // desired size. Without setting it, the server could also supply smaller Ads when
               // no ad of desired size is available.
   mView.setAdListener(this);
   return mView;
 }
 @Override
 public void runMethod(String name, List<Object> parameters) {
   if (name.equalsIgnoreCase("requestad")) {
     mView.loadNextAd();
   }
 }