Hi
I'm completely new to Xamarin. I'm using VS2017 and I've included some AIDL files for a Sunmi V1 POS device. Eventually I need it to print to the device's thermal printer when a new order is received, but I'm struggling with the basics.
I've added the AIDL files and a Java class called TransBean (all provided by Sunmi), and I can see that when I build it, it's converted all this to C# classes. I have set the build action to AndroidInterfaceDescription for all AIDL files. Not sure what I should do for the Java file but I tried setting it to AndroidJavaSource but it didn't seem to help.
The Problem
But the generated TransBean.cs has no contents (not even the class definition). As a result, I'm getting build errors saying it can't find TransBean.
Just realised that I can't post screenshots, although I have a few that I can send (will try to describe instead)
The generated TransBean.cs file has no contents. I would have assumed it should contain a C# representation of the Java class.
The AIDL file for TransBean just looks like this
package com.sunmi.trans;
parcelable TransBean;
The TransBean.java file has lots of content e.g.
package com.sunmi.trans;
import android.os.Parcel;
import android.os.Parcelable;
public class TransBean implements Parcelable {
private byte type = 0;
private String text = "";
private byte[] data = null;
private int datalength = 0;
public TransBean(){
type = 0;
data = null;
text = "";
datalength = 0;
};
This is the generated TransBean.cs file. As you can see, it's empty
// This file is automatically generated and not supposed to be modified.
using System;
using Boolean = System.Boolean;
using String = System.String;
using List = Android.Runtime.JavaList;
using Map = Android.Runtime.JavaDictionary;
namespace Com.Sunmi.Trans
{
}
As a result, anything that needs to use it throws a build error (TransBean does not exist in the namespace), such as this line (also auto-generated from a different AIDL file I guess)
void CommitPrint (Com.Sunmi.Trans.TransBean [] transbean, ICallback callback);
In the above line,
Please could someone tell me what I'm doing wrong? I'm guessing when the C# file is being generated, the contents of the Java file is supposed to be converted into C# and inserted into the resulting .cs file but maybe it's not picking it up.
Thanks!