Android Question SLC problem

JDS

Active Member
Licensed User
Longtime User
I'm using the SLC to create a wrapper around toughpad.jar
But when testing and running SLC I get an error
"package com.panasonic does not exist"

B4X:
package jds.b4a.toughpad;

import anywheresoftware.b4a.BA;
import anywheresoftware.b4a.BA.DependsOn;
import anywheresoftware.b4a.BA.ShortName;
import com.panasonic.*; /** failes on this line**/

@SuppressWarnings("unused")
@ShortName("ToughPad")

public class Toughpad {
   
   
    public int multiply(int x) {
        return x * 2;
    }
}

When opening the *.java in eclipse then I get (when typing) a reference to the library. I've added an zip with the folder which I'm using in SLC.

Any thoughts?
 

Attachments

  • Screenshot.png
    Screenshot.png
    60.4 KB · Views: 186
  • Toughpad.zip
    67.1 KB · Views: 177

Johan Schoeman

Expert
Licensed User
Longtime User
I'm using the SLC to create a wrapper around toughpad.jar
But when testing and running SLC I get an error
"package com.panasonic does not exist"

B4X:
package jds.b4a.toughpad;

import anywheresoftware.b4a.BA;
import anywheresoftware.b4a.BA.DependsOn;
import anywheresoftware.b4a.BA.ShortName;
import com.panasonic.*; /** failes on this line**/

@SuppressWarnings("unused")
@ShortName("ToughPad")

public class Toughpad {
 
 
    public int multiply(int x) {
        return x * 2;
    }
}

When opening the *.java in eclipse then I get (when typing) a reference to the library. I've added an zip with the folder which I'm using in SLC.

Any thoughts?
Try to use
B4X:
import com.panasonic.toughpad.android.api.*;
import com.panasonic.toughpad.android.apitocontract.*;
import com.panasonic.toughpad.android.contract.*;
 
Upvote 0

JDS

Active Member
Licensed User
Longtime User
With the above answers I got the SLC to compile.
But how do I get the underlying functions of the toughpad.jar visible?
 
Upvote 0

Johan Schoeman

Expert
Licensed User
Longtime User
With the above answers I got the SLC to compile.
But how do I get the underlying functions of the toughpad.jar visible?
You will have to add the necessary Java code to your wrapper to make use of the functionality in the Jar.
 
Upvote 0

JDS

Active Member
Licensed User
Longtime User
Hi Erel,

We choose B4A for two reasons: simple (1) and we don't have experience with Java (2).
However we need to create this library but don't have any idea how te start.

In the example code we see
B4X:
@Overridepublic View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
// NOTE: Reset state from previous invocationsreaders = null;
selectedReader = null;

View view = inflater.inflate(R.layout.fragment_apitest_barcode, container, false);


txtBcrLog.setText("");
onBarcodeDisabled();


ToughpadApi.initialize(getActivity(), this); /** important **/

return view;
}

public void onApiConnected(int version) { /** important **/
readers = BarcodeReaderManager.getBarcodeReaders();

List<String> readerNames = new ArrayList<String>();
for (BarcodeReader reader : readers) {
readerNames.add(reader.getDeviceName());
}

public void onRead(BarcodeReader bsObj, final BarcodeData result) {/** important **/
PrintLogText(result.getTextData());

});
}

In the above snipped of the exampe I see some functions which could be important for us: "onApiConnected" ,"ToughpadApi.initialize" and "onRead".
How do I get those visible for B4A?
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
Upvote 0
Top