Berker
Berker

Reputation: 81

Fcl file can be supported by Android tablet?

I use jfuzzylogic application for my thesis project. When I tried to run jfuzzylogic application on Android platform, I was faced with a problem. After I run this code below, fcl file couldn't be loaded. I guess Android platform can't detect or recognize fcl file. However, when I run this same jfuzzylogic code block in regular computer, fcl file was loaded fine. Does someone has any suggestion about this problem? Is it possible to run jfuzzylogic app in Android tablet? Here is the code:

 import net.sourceforge.jFuzzyLogic.FIS;

 import android.widget.TextView;


public class Mixing implements Runnable {


public Interfacekit mixkit,sonarkit;
public TextView[] Rfidviews; 

int count;  


public Mixing(Interfacekit sonarkit,Interfacekit dishkit,Interfacekit mixkit,Rfid mrfid1,Rfid mrfid2, Rfid mrfid3,Rfid mrfid4,Rfid dishrfid,Rfid sinkrfid,Rfid stoverfid,Temperature eggtemp,Temperature stovetemp,final TextView[] Rfidviews)
{
    this.sonarkit=sonarkit;
    this.Rfidviews = Rfidviews;

    new Thread(this).start();
}



public void run()   

{
    while(count==1){


                 //////////////////////////initial states

        if(mixkit.getattach()==true||sonarkit.getattach()==true ) 


        {


                    Rfidviews[20].post(new Runnable() {
                        public void run() {
                            {




                                // Vassiliki


                                // Load from 'FCL' file

                                String vassiliki_fileName1= "vassiliki_examinable.fcl";

                                // Vassiliki Examinable     

                                /* I FACED PROBLEM IN THIS LINE. THIS FCL FILE WASN'T LOADED SINCE I GUESS ANDROID TABLET CAN'T DETECT
                                 * OR RECOGNIZE FCL FILE.
                                 */
                                FIS vassiliki_examinable_obj1 = FIS.load(vassiliki_fileName1,true);

                                // Error while loading?
                                if( vassiliki_examinable_obj1 == null ) { 
                                    System.err.println("Can't load file: '" 
                                                           + vassiliki_fileName1 + "'");
                                    return;
                                }


                                int sonar1 = sonarkit.getsonar(2);
                                if (sonar1 != 0){


                                vassiliki_examinable_obj1.setVariable("proximity", sonar1);
                                vassiliki_examinable_obj1.setVariable("obj_orient_perception", 1);
                                vassiliki_examinable_obj1.setVariable("obj_size", 40);

                                vassiliki_examinable_obj1.evaluate();

                                double ex_toaster=vassiliki_examinable_obj1.getVariable("examinable").getValue();

                                if(ex_toaster>10){

                                     Rfidviews[20].setText("Toaster");

                                }


                                }

                                else
                                    Rfidviews[20].setText(" ");








                            }
                        }
                    });









        }           



    }

}

}

Upvotes: 1

Views: 285

Answers (1)

Juan Rada-Vilela
Juan Rada-Vilela

Reputation: 195

Use jfuzzylite instead. It is free and open source. It does not require third-party libraries, contains more features than jfuzzylogic (except for parameter optimization), the binary size is less than 300KB, and it works perfect on Android. Visit www.fuzzylite.com.

Upvotes: 0

Related Questions