это моя проблема: мне нужно использовать dll для библиотеки sdk bluebox rfid с проектом android studio, я должен знать, возможно ли вызвать dll из моего проекта, если это возможно, как я могу интегрировать dll в свой проект и вызвать ниже я связал ссылку на dll 1> я использую android studio 4.0 2> dll имеет метод для общения с rfid uhf
https://www.4shared.com/rar/RL6sKmQZiq/rfid_dll.html
этот мой код c# вызывает эту dll
private void ThreadAcquisition () {
try
{
while (ThreadRun[Convert.ToInt32(Thread.CurrentThread.Name)])
{
int ThreadIndex = Convert.ToInt32(Thread.CurrentThread.Name);
try
{
// set variables for tags number
int TagsNo;
IntPtr Tags = IntPtr.Zero;
// read the datas from reader
int Err = BLUEBOXLib.DataRequest(ref HandleArray[ThreadIndex], out Tags, out TagsNo);
if (Err == 0)
{
// print the tags read
for (int Index = 0; Index < TagsNo; Index++)
{
// pointer to the buffer that contains data received from the call of data request
IntPtr Tmp = new IntPtr((int)Tags + (Index * Marshal.SizeOf(typeof(BLUEBOX_Tag))));
// now got the pointer to the struct, get the structure from the memory
BLUEBOX_Tag Tag = (BLUEBOX_Tag)Marshal.PtrToStructure(Tmp, typeof(BLUEBOX_Tag));
// create the strings array for antenna and id
string Antenna = (Convert.ToString(Tag.Antenna));
string Input = (Convert.ToString(Tag.Input));
string TagType = "-";
switch (Tag.TagType)
{
case 1:
TagType = "BLUEBOX SHORT";
break;
case 2:
TagType = "BLUEBOX MEDIUM";
break;
case 3:
TagType = "BLUEBOX LARGE";
break;
case 8:
TagType = "ISO 14443A";
break;
case 9:
TagType = "NXP MIFARE 1k";
break;
case 10:
TagType = "NXP MIFARE 4k";
break;
case 11:
TagType = "NXP MIFARE Ultralight";
break;
case 12:
TagType = "ISO 15693";
break;
case 13:
TagType = "NXP ICODE SLI";
break;
case 14:
TagType = "TI Tag-It HF-I";
break;
case 15:
TagType = "EM EM4035";
break;
case 16:
TagType = "ST LRI 64/512/2k";
break;
case 17:
TagType = "FUJITSU MB89R118";
break;
case 18:
TagType = "ISO 14443B";
break;
case 19:
TagType = "ST SR 176";
break;
case 20:
TagType = "ISO 18000-6B";
break;
case 21:
TagType = "ISO 18000-6C";
break;
case 22:
TagType = "ACTIVE";
break;
case 23:
TagType = "EM EM4035";
break;
case 24:
TagType = "ATMEL T5557";
break;
case 25:
TagType = "NXP ICODE SLI-S";
break;
case 26:
TagType = "NXP HITAG 1";
break;
case 27:
TagType = "NXP MIFARE Mini";
break;
case 28:
TagType = "NXP MIFARE Desfire";
break;
case 29:
TagType = "NXP MIFARE 1k 7-byte-UID";
break;
case 30:
TagType = "NXP MIFARE 4k 7-byte-UID";
break;
case 31:
TagType = "NXP MIFARE Plus 2k";
break;
case 32:
TagType = "NXP MIFARE Plus 4k";
break;
case 33:
TagType = "ST SRI 512";
break;
case 34:
TagType = "JCos";
break;
case 35:
TagType = "PICOPASS";
break;
case 37:
TagType = "IBM JCOP";
break;
case 38:
TagType = "IBM JCOP31";
break;
case 39:
TagType = "IBM JCOP41";
break;
}
string Id = "";
for (int k = 0; k < Tag.Length; k++)
{
Id += Marshal.ReadByte(Tag.Id, k).ToString("X2").ToUpper() + " ";
}
// create the row to add to the table
Array Row = new string[] { ThreadIndex.ToString(), Antenna, Input, TagType, Id, "0" };
// add the row to the table
this.Invoke(new ThreadAcquisitionCallBack_1p(AddDataRequestTable), Row);
}
// free the allocated buffer from the reader
Err = BLUEBOXLib.FreeTagsMemory(ref HandleArray[ThreadIndex], ref Tags, TagsNo);
Thread.Sleep(10);
}
switch (Err)
{
case 0:
break;
case -2:
MessageBox.Show("BLUEBOXLib.dll: Invalid handle!", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Error);
break;
case -4:
MessageBox.Show("BLUEBOXLib.dll: Invalid parameters!", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Error);
break;
case -5:
MessageBox.Show("BLUEBOXLib.dll: Generic error!", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Error);
break;
case -6:
MessageBox.Show("BLUEBOXLib.dll: Timeout error!", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Error);
break;
case -7:
MessageBox.Show("BLUEBOXLib.dll: Communication error!", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Error);
break;
case -8:
MessageBox.Show("BLUEBOXLib.dll: Connection error!", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Error);
break;
case -9:
MessageBox.Show("BLUEBOXLib.dll: Memory allocation error!", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Error);
break;
case -10:
MessageBox.Show("BLUEBOXLib.dll: Invalid command!", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Error);
break;
case -11:
// tag not found
Err = 0;
break;
case -12:
// tag error
Err = 0;
break;
default:
MessageBox.Show("BLUEBOXLib.dll: Internal error!", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Error);
break;
}
if (Err != 0)
{
ThreadRun[0] = false;
}
}
catch (Exception Ex)
{
MessageBox.Show(Ex.Message + "\n\n" + Ex.ToString(), this.Text, MessageBoxButtons.OK, MessageBoxIcon.Error);
/*---------> for (int RowIndex = 0; RowIndex < this.DeviceDataGridView.RowCount - 1; RowIndex++)
{
ThreadRun[RowIndex] = false;
}---------->*/
}
}
try
{
int ThreadIndex = Convert.ToInt32(Thread.CurrentThread.Name);
// close the connection
BLUEBOXLib.Close(ref HandleArray[ThreadIndex]);
// free library resources
BLUEBOXLib.End(ref HandleArray[ThreadIndex]);
}
catch (Exception Ex)
{
MessageBox.Show(Ex.Message + "\n\n" + Ex.ToString(), this.Text, MessageBoxButtons.OK, MessageBoxIcon.Error);
}
finally
{
//this.Invoke(new ThreadAcquisitionCallBack_0p(this.ClosingConnection));
}
}
catch (Exception Ex)
{
Me