[FREE] Math Capacity Units Converter Extension 🧪

Hi everyone,

Today I am presenting you my brand new extension: Capacity Units! :test_tube: :test_tube: :test_tube:

1. Introduction

This extension helps you convert 2 different types of capacity units to each other: milliliters (mL) and liters (L).

Currently this is easy, no documentation is needed.

Next version: add cubic centimeters / decimeters / meters

2. Overview of Blocks

3. Downloads

AIX file: com.appybuilder.gordonlu0749.Capacity.aix (5.4 KB)

AIA test file: capacity_test.aia (6.3 KB)

Source code (for reference only)

import android.content.Context;
import android.util.Log;
import com.google.appinventor.components.annotations.*;
import com.google.appinventor.components.runtime.*;
import com.google.appinventor.components.common.ComponentCategory;

@DesignerComponent(version = 1,  description = "This extension converts milliliters and litres to each other.",
    category = ComponentCategory.EXTENSION,
    nonVisible = true,   iconName = "https://lh3.googleusercontent.com/ogw/ADea4I42VqEybFK87QSOLCsJXghDvdf0uhA3Rya5Li0g=s32-c-mo")
@SimpleObject(external = true)
public class Capacity extends AndroidNonvisibleComponent {
private ComponentContainer container;
/**
 * @param container container, component will be placed in
 */
public Capacity(ComponentContainer container) {
    super(container.$form());
    this.container = container;
}
  
  @SimpleFunction(description = "Converts milliliters to liters.")
public double MillilitersToLiters (double milliliters) { 
return milliliters / 1000; 

}
  
  @SimpleFunction(description = "Converts liters to milliliters.")
public double LitersToMilliliters (double liters) { 
return liters * 1000; 

}
  
}

If you don't mind, please poll below.

Is this extension good?

  • Yes, this extension is very good!
  • No, this extension is not good.

0 voters

11 Likes

Nice extension @Gordon_Lu :grinning: keep up your good work

2 Likes

This is extension is so good

1 Like

great to see, that you are learning to create extensions...it is a nice start...
however the goal in creating extensions should be to provide solutions, which are not possible using existing blocks...

you might understand, that we do not really need another extension, which is able to divide or multiply by 1000 or similar...

Taifun


Trying to push the limits! Snippets, Tutorials and Extensions from Pura Vida Apps by icon24 Taifun.

9 Likes

Good Work! @Gordon_Lu :+1:

1 Like