Java Question Library Methods

Johnmcenroy

Active Member
Licensed User
Longtime User
Sorry for such a simple question , but I cannot find answer for it.
I have in library @BA.ShortName("TEST") and two methods in class TEST_THIS , for example TEST1 and TEST2.

In B4A I add my library and write:
B4X:
Dim testing As TEST

TEST.            ' So after point I must see ONLY two methods - TEST1 and TEST2 
                    ' but I see ALSO - background , color , invalidate and so on.
Why ? Thanks.

P.S. I have changed ViewWrapper to AbsObjectWrapper and now I see only these methods
But with AbsObjectWrapper library doesn't work correctly. So is there another way to show only my methods in B4A ?
 
Last edited:

tchart

Well-Known Member
Licensed User
Longtime User
Check the corresponding XML file. Are the methods listed in there? If they aren't then B4A wont see them. Make sure when you export the "documentation" that you have the project select int he Eclipse and not the class otherwise it doesn't export all the documentation (might not bee the issue if you only have one class).
 

NFOBoy

Active Member
Licensed User
Longtime User
I had this happen to me... and I was exporting everything... two issues for me:

1) forgetting to put public at the front

2) set or get options that get the set or get stripped from them in b4a (probably not an issue when you only have two methods, but when you're up to 30+, then they become fun exercise for the brain
 

Johnmcenroy

Active Member
Licensed User
Longtime User
I have the following code:
B4X:
package mopublibfull;

import android.content.Intent;
import anywheresoftware.b4a.BA;
import anywheresoftware.b4a.objects.ViewWrapper;
import com.mopub.mobileads.MoPubView;
import com.mopub.mobileads.Global;

@BA.ActivityObject
@BA.Author ("Johnmcenroy")
@BA.Version(1.0F)
@BA.Permissions(values={"android.permission.INTERNET","android.permission.ACCESS_NETWORK_STATE","android.permission.ACCESS_COARSE_LOCATION"})
@BA.DependsOn (values={"mopub-sdk","android-support-v4"})
@BA.ShortName("MopubAds")
public class MoPubLibFull extends ViewWrapper<MoPubView> {
   
   
   /**
    * // Enter your Banner Ad Unit ID from [url=http://www.mopub.com]MoPub - World's Largest Mobile Ad Server and RTB Exchange for iOS and Android[/url]
    */
   
   public void InitializeMopub_Banner(BA ba , String adUnitId)
     {
      setObject(new MoPubView(ba.context));
      ((MoPubView)getObject()).setAdUnitId(adUnitId);
      ((MoPubView)getObject()).loadAd();
     }
   
   
   /**
    * // Destroys MoPub Banner Ads
    */
   
   public void DestroyMopub_Banner(BA ba)
     {
      ((MoPubView)getObject()).destroy();
     }
   
   
   /**
    * // Enter your Interstitial Ad Unit ID from [url=http://www.mopub.com]MoPub - World's Largest Mobile Ad Server and RTB Exchange for iOS and Android[/url]
    */
   
   public Intent ShowMopub_Interstitial(BA pBA, String AdUnitID){
        
      Intent intent1 = new Intent(pBA.activity,MoPubLibFullInt.class);
      intent1.putExtra("AdUnitID", AdUnitID);
        return intent1;
    }
   
   
   /**
    * // Enter your TapForTap API 
    * <b>USE BEFORE InitializeMopub_Banner !</b>
    * Don't forget to add Custom Native Network in MoPub Console , class name - com.mopub.mobileads.TapForTapBanner
    */
   
   public void AddToMopub_Tapfortap_Banner (BA ba , String TapAPI)
   {
     Global.TapAPIba = TapAPI;
   }
   
   
}

So only 4 methodes BUT in B4A I write:

Dim Banner As MopubAds

Banner. AND after this point i have not 4 methodes but far more , ALSO
color , background , visible and so on.
 
Last edited:

Johnmcenroy

Active Member
Licensed User
Longtime User
Ok , I understood . Thanks Erel . But maybe there is some tools to sort methodes , so that my methodes will be first in this list ?
The methods you see come from ViewWrapper. You should keep them. They allow you to treat this view like any other view.

Edit: In this case it is not very useful I think , I understood . Thanks again.
 
Last edited:
Top