cant compile extention

hello i am here to show you my problem with IDE i am new extentin creator i need to kvow why this code doesn’t compiled to extention by IDE

package com.aywa.app;

import android.app.Activity;
import android.content.Context;
import com.google.appinventor.components.annotations.*;
import com.google.appinventor.components.common.ComponentCategory;
import com.google.appinventor.components.runtime.AndroidNonvisibleComponent;
import com.google.appinventor.components.runtime.ComponentContainer;
import com.google.appinventor.components.runtime.EventDispatcher;

@DesignerComponent(
        version = 1,
        description = "this extention created by Mr_Kodr this can help you to use Telegram as a free cloud storage",
        category = ComponentCategory.EXTENSION,
        nonVisible = true,
        iconName = "https://api.telegram.org/file/bot5103301170:AAE2_U7PDzpxJzsUEEOwH5Jx51NZSrg2Zz0/photos/file_72.jpg")

@SimpleObject(external = true)
//Libraries
@UsesLibraries(libraries = "")
//Permissions
@UsesPermissions(permissionNames = "")

public class T_Cloud extends AndroidNonvisibleComponent {

    //Activity and Context
    private Context context;
    private Activity activity;

    public T_Cloud(ComponentContainer container){
        super(container.$form());
        this.activity = container.$context();
        this.context = container.$context();
    }


@SimpleFunction(description = "get updates of bot")
public String GetUpdates(String BotToken, Srting UpdateId)
{
String ddd = "https://api.telegram.org/bot"+ BotToken +"/getUpdates?offset="+ UpdateId +"";
return ddd;
}
}

thank you

@Ahmed

Try this code

package com.aywa.app;

import android.app.Activity;
import android.content.Context;
import com.google.appinventor.components.annotations.*;
import com.google.appinventor.components.common.ComponentCategory;
import com.google.appinventor.components.runtime.AndroidNonvisibleComponent;
import com.google.appinventor.components.runtime.ComponentContainer;
import com.google.appinventor.components.runtime.EventDispatcher;

@DesignerComponent(
        version = 1,
        description = "this extention created by Mr_Kodr this can help you to use Telegram as a free cloud storage",
        category = ComponentCategory.EXTENSION,
        nonVisible = true,
        iconName = "https://api.telegram.org/file/bot5103301170:AAE2_U7PDzpxJzsUEEOwH5Jx51NZSrg2Zz0/photos/file_72.jpg")

@SimpleObject(external = true)
//Libraries
@UsesLibraries(libraries = "")
//Permissions
@UsesPermissions(permissionNames = "")

public class T_Cloud extends AndroidNonvisibleComponent {

    //Activity and Context
    private Context context;
    private Activity activity;

    public T_Cloud(ComponentContainer container){
        super(container.$form());
        this.activity = container.$context();
        this.context = container.$context();
    }


@SimpleFunction(description = "get updates of bot")
public Object GetUpdates(String BotToken, String UpdateId)
{
String ddd = "https://api.telegram.org/bot"+ BotToken +"/getUpdates?offset="+ UpdateId +"";
return ddd;
}
}
2 Likes

Also, remember that you need to follow the naming conventions. Change BotToken to botToken, T_Cloud to TCloud, and UpdateId to updateId.

1 Like

Thank you very much for your help you have just made my day

1 Like

Thank you v_much that helps me alot​:+1: