Guide for beginner Extension Developers

What’s about topic

Hello everyone This topic is about to help the newones that want to begin creating extension
Today I am showing How to start creating extension
So without wasting any time Lets Start

IDE

First you need a IDLE guess for creating a extension if you are beginner so you can start from here
https://editor.appybuilder.com/

Or you can follow this guide to Install a IDLE in your computer

Let’s Start

Package Name

So guys first you have to learn about your extension package name

If you are using appybuilder then you cannot give package name tp your extension
You can give package name to your extension when you are using extension templator for making extension
How can you give package

image

As you can see the image my extension java file is placed in com/test/sumit1334 that is created by you. Your package name must equal to your path like my path is com/test/sumit1334 so my extension package name is com.test.sumit133 just replace bracket by dots
I hope you understand package

we have to learn how to create blocks

Also follow this

1. Event Blocks

Preview

component_event (3)

as you can see this blocks is created by this code

As I have written comments on lines
I hope you have understood

2. Return Method Block

Preview

blocks - 2020-12-31T104024.736

This block is created by this code

image

Here I have returned a string so I have given String datatype if you want to return different datatypes then give your datatypes see here example

image

In this ex i have returned a integer

YailList ex

image

Some method of Yaillist

For better understanding read comment on codes

Now I will return a list
On returning a list you cant return a linkedlist or any other list you have to return a YailList
Like this

I have written comment on every code line I hope you will understand by comments

3. Non return Method Block

Preview

blocks - 2020-12-31T104011.316

If you want to return nothing in a blocks then you have to type void after public
See Image of codes

image

4. Get Property Block

Preview

component_set_get

First you have to make variable to store your property like this
If you will not make a variable to store property then what will you return?

image

This block is written by following code

image

5. Set Property Block

Preview

blocks - 2020-12-31T104043.412

As I have created a variable property we will edit that variable in this block
see the code

How to use constructor in blocks

Constructor is like a procedure block its short our code firt I will show you returnabel constructor
see ex

Non returnable constructo

It is also a procedure but it does not return a value. it do task
codes ex

I hope you understand

How to call event from method

Here guys we will call event block through methods like this
As I have already created a event block

As you can see this I have passed the value in Simpleevent()

Here the tutorial finishes
I hope it helped you

Do not go on extension name

Going to create your first extension make sure to follow the naming convention

This extension source code

30 Likes

nice tutorial

4 Likes

Well done @iamwsumit

I am looking for this your code is also open source i will do practise it

1 Like

@iamwsumit Tutorial is helpful. I also want to make an extension. But I am using Mobile. So, I can’t install that app. So, what should I do?

2 Likes

You can try appybuilder if you have mobile

2 Likes

Great job BR0THER

4 Likes

Thanks u all

2 Likes

Which IDLE you are using?

Looks very nyc

2 Likes

It is IntelliJ Idea

Yes you are right its ui is very awesome!

1 Like

you mentioned to follow the naming conventions… great…
but unfortunately you do not follow the conventions yourself in this guide?
please update your examples accordingly… thank you…

Taifun

3 Likes

I’m thinking of starting but I have to do a bigger project again for the guide
thanks

FIKIR_KUMESI

1 Like

Very good, I bet you’ve spent so much time on this. But here’s something that I have some other suggestions:

  • Explain what return data type is accepted, like YailList is accepted but HashMap is not.
  • Explain what does the code do and how it works, especially description of blocks, EventDispatcher, annotation etc.
  • How about UsesAssets, UsesServices, SimpleObject, constructor, extends, and package name? These should be explained briefly.
  • Custom icons (both online and local)

False. It is not a must to store in a variable. It can return whatever the developer wants. For instance, constants. And if you’re to store a variable, use private for good practice.

It is not a must to have default value. And, you should describe list of the editor types.

?

2 Likes

Sorry @Taifun I have not created this extension for launching just for example also i have not said follow my blocks name that is reason why i have shared yoiur guide

1 Like

How to handle actions in extension.
Like user clicks on a button and we can handle it in extension.

Use AndroidViewComponent and convert to a View by .getView();
Example:

@SimpleFunction
public void MethodName(AndroidViewComponent component) {
  component.getView().setOnClickListener(new View.OnClickListener() {

    @Override
    public void onClick(View v) {
        // Do some job here
    }

});

You can check in Android Studio Documentation:
https://developer.android.com/reference/android/view/View.OnClickListener

Take note that if you set the listener here, the original one will be ignored.

3 Likes

it is your decision to provide a good quality guide or a bad quality guide…
let me suggest you to provide something useful and of good quality…

Taifun

1 Like

I can’t verify my email in appybuilder code editor.doesn’t coming any verify email.i tried different email many time

also working for me

1 Like