Quantcast
Channel: Recent Threads — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 204402

Functions can't be access in Android using Embeddinator-4000

$
0
0

I had followed the tutorial of getting started in android and use the Embeddinator-4000 to code in C# and build in Android Studio. I met some problems when calling the functions from C# class.

These are the codes

using System;
using System.Collections;
using System.Collections.Generic;

namespace CalculatorLibrary
{
public class TestingCalculator
{
    public TestingCalculator()
    {

    }
    public double Addfunction(double value1, double value2)
    {
        return value1 + value2;
    }

    public ArrayList ArrayListFunction(string first)
    {
        ArrayList al = new ArrayList();
        al.Add(first);

        return al;
    }

    public int Testing(int value1)
    {
        return value1;
    }

    public List<String> List(string first)
    {
        List<String> List = new List<string>();
        return List;
    }

    public IDictionary<int, object> GetProducts(int departmentID)
    {
        return new Dictionary<int, object>
            {
                { 1, new { Description = "Something" } },
                { 2, new { Description = "Whatever" } },
            };
    }

    public string[] StringArray(string arr)
    {
        string[] array;
        array = new string[3];
        return array;
    }

    public int[] intArray(int a)
    {
        int[] array;
        array = new int[3];
        return array;
    }

    public object objectm(object a)
    {
        object b = new object();
        return b;
    }

}
}

After I build the project it would output an aar file. Then I import the aar file into Android Studio.

package com.example.khortsuming.calculatorfinal;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import calculatorlibrary.calculatorlibrary.TestingCalculator;
import md54223a39312377e7a37c3fe640756f5f0.CalculatorActivity;

public class TestingActivity extends AppCompatActivity {

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_testing);

            TestingCalculator testingCal = new TestingCalculator();
            testingCal


}
}

When I want to call in Android Studio I only can access

It only passes Addfunction(double) and Testing(int) others could not be seen!


Viewing all articles
Browse latest Browse all 204402

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>