Access Api In Extension

i want to access an api in my extension
means like web component
i want to add one function = get
and other event got
so i search on internet but confused
can anyone give a simple source
i even seen ai source code of web component but still cant find solution

You can create a Web component inside of your extension. This also applies to other App Inventor components.

This library includes all components from App Inventor. As you can see from here:


I really dont know how to do it​:sweat_smile:

I have already checked it
But thanks

You just need to create a new variable with Web component type.

Web w = new Web(container);

Replace container with your ComponentContainer.

Components that can contain other components need to implement this interface.

1 Like

Thanks thats helpful to everyone :grin::kissing_heart:

   public void GetOnlineRes(){
     Web w = new Web(GetOnlineRes);
     urlString = "";
     public void Get() 

is it ok:sweat_smile:

can i get an simple example:cold_face:

Yes why not.
Following example shows how to get response content from Google’s website.

    public static String Web() throws IOException {
    StringBuilder result = new StringBuilder();
    URL u = new URL("");
    HttpURLConnection web = (HttpURLConnection) u.openConnection();
    BufferedReader rd = new BufferedReader(new InputStreamReader(web.getInputStream()));
    String line;
    while ((line = rd.readLine()) != null) {
    return String.valueOf(result);
1 Like

Thanks :grin:
But the thing i wanted is Available Now!:blush:

1 Like

Thank you so much

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.