Aurelius and Android

Wagner,


I am confused, I read a previous post where you said that Aurelius does not support Android.

I just opened the product link and it says http://www.tmssoftware.com/site/aurelius.asp#features that the android platform is supported, actually all the XE6 platforms.

One of the reasons I got Aurelius was because it is cross platform, specially Android.

I am having a lot of trouble with debuging with my project, I cannot generate a debug version, I need to use showmessages everywhere in a release compiled apk.

What is the current position, is Aurelius supported on Android? Is it going to be?

Thank you


Where did I say Aurelius does not support Android?

Yes, it does support both Android and iOS platforms.

I am sorry Wagner. I got so stressed with this compiler that I made a confusion.


To let you know, I could now make it run, my entire ERP is running on android with Aurelius connecting using RemoteDB and ElevateDB.

Up to know working like a charm.

Thanks

Wagner,


I am having the same problem on Aurelius:

  AddFind('usuario.login',
    function(AParam: Variant): TNaharEntity
    begin
      result := OManager.Find<TEntityUsuario>.Where(TLinq.Eq('Login', AParam)).UniqueResult;
    end);

That find raises an exception: Unable to convert UnicodeString to String. 

That happens even if I change the AParam to a direct string like 'admin'.

I am trying to find where, my compiler is not generating debug information, it stop with Internal Error.

Something on Aurelius side is not understand but the compiler. Did you experiment that before?

Eduardo

Changing debuging parameters I could get some debuging information running on android.


What I am getting is EVariantTypeCastError "could not convert variant of type (unicodestring) into type (string)"

If I replace the AParam (that received a string from TEdit.Text with the user login) to a direct string like 'admin', I receive the same error.

Now I could manage to have the stack. 

I am not sure now where the problem is, since I can see that Aurelius reached RemoteDB, and seems that the Variant param I was passing to the Find criteria was understood ('admin' string).

Could it be a retrieving value issue on the RemoteDB side? 

This very same code works fine when connected to ElevateDB. What I did is start using RemoteDB (since there is no ElevateDB client on Android) and created my own "remote db server"

This server is connected to the same ElevateDB server that I connect by windows ( I am always using remote connection for ElevateDB)

How can I identify where the problem is, since I was afraid of the delphi compilation on Android, could it be Android side or Server side?

System._DbgExcNotify(25045,0x61d565a8,0x5ec5f3f7,0x61d565a8,0x5ec5f3f7)
System.NotifyReRaise(0x61d565a8,0x5ec5f3f7)
System._RaiseAtExcept(0x61d565a8,0x5ec5f3f7)
System._RaiseExcept(0x61d565a8)
System.Variants.VarCastError(258,256)
System.Variants.VarCastAsString(@0x619b67c8: { = { = {RawData = {258, 0, 1640688684, 0}},  = {VType = 258,  = { = {VBytes = {0, 0, 0, 0, 0, 0, 44, 236, 202, 97, 0, 0, 0, 0}},  = {VWords = {0, 0, 0, 60460, 25034, 0, 0}},  = {Reserved1 = 0,  = { = {VLongs = {-332660736, 25034, 1536753664}},  = {Reserved2 = 0, Reserved3 = 60460,  = { = {VRecord = {PRecord = 0x5b990000, RecInfo = 0xadc914f8}},  = {VUString = 0x5b990000},  = {VPointer = 0x5b990000},  = {VArray = 0x5b990000},  = {VAny = 0x5b990000},  = {VString = 0x5b990000},  = {VUInt64 = 12522563295801573376},  = {VInt64 = -5924180777907978240},  = {VLongWord = 1536753664},  = {VWord = 0},  = {VByte = 0},  = {VShortInt = 0},  = {VUnknown = 0x5b990000},  = {VBoolean = False},  = {VError = 1536753664},  = {VDispatch = 0x5b990000},  = {VOleStr = 0x5b990000},  = {VDate = -3.9401428240994018e-088},  = {VCurrency = 153675.3664},  = {VDouble = -3.9401428240994018e-088},  = {VSingle = 8.61313429e+016},  = {VInteger = 1536753664},  = {VSmallInt = 0}}}}}}}}},{ = { = {RawData = {1637573976, 1637574600, 1637573864, 1590039255}},  = {VType = 25944,  = { = {VBytes = {155, 97, 200, 103, 155, 97, 232, 100, 155, 97, 215, 18, 198, 94}},  = {VWords = {24987, 26568, 24987, 25832, 24987, 4823, 24262}},  = {Reserved1 = 24987,  = { = {VLongs = {1692950939, 316105115, 1537629894}},  = {Reserved2 = 24987, Reserved3 = 25832,  = { = {VRecord = {PRecord = 0x5ba65ec6, RecInfo = 0xac1c14f8}},  = {VUString = 0x5ba65ec6},  = {VPointer = 0x5ba65ec6},  = {VArray = 0x5ba65ec6},  = {VAny = 0x5ba65ec6},  = {VString = 0x5ba65ec6},  = {VUInt64 = 12401810530793578182},  = {VInt64 = -6044933542915973434},  = {VLongWord = 1537629894},  = {VWord = 24262},  = {VByte = 198},  = {VShortInt = -58},  = {VUnknown = 0x5ba65ec6},  = {VBoolean = 24262},  = {VError = 1537629894},  = {VDispatch = 0x5ba65ec6},  = {VOleStr = 0x5ba65ec6},  = {VDate = -3.2867608944006316e-096},  = {VCurrency = 153762.9894},  = {VDouble = -3.2867608944006316e-096},  = {VSingle = 9.36581013e+016},  = {VInteger = 1537629894},  = {VSmallInt = 24262}}}}}}}}})
System.Variants._VarCast(@0x619b67c8: { = { = {RawData = {258, 0, 1640688684, 0}},  = {VType = 258,  = { = {VBytes = {0, 0, 0, 0, 0, 0, 44, 236, 202, 97, 0, 0, 0, 0}},  = {VWords = {0, 0, 0, 60460, 25034, 0, 0}},  = {Reserved1 = 0,  = { = {VLongs = {-332660736, 25034, 1536032768}},  = {Reserved2 = 0, Reserved3 = 60460,  = { = {VRecord = {PRecord = 0x5b8e0000, RecInfo = 0xb46414f8}},  = {VUString = 0x5b8e0000},  = {VPointer = 0x5b8e0000},  = {VArray = 0x5b8e0000},  = {VAny = 0x5b8e0000},  = {VString = 0x5b8e0000},  = {VUInt64 = 12998537481418571776},  = {VInt64 = -5448206592290979840},  = {VLongWord = 1536032768},  = {VWord = 0},  = {VByte = 0},  = {VShortInt = 0},  = {VUnknown = 0x5b8e0000},  = {VBoolean = False},  = {VError = 1536032768},  = {VDispatch = 0x5b8e0000},  = {VOleStr = 0x5b8e0000},  = {VDate = -2.5593868614315258e-056},  = {VCurrency = 153603.2768},  = {VDouble = -2.5593868614315258e-056},  = {VSingle = 7.99388934e+016},  = {VInteger = 1536032768},  = {VSmallInt = 0}}}}}}}}},{ = { = {RawData = {1637573976, 1637574600, 1637573912, 1590086533}},  = {VType = 25944,  = { = {VBytes = {155, 97, 200, 103, 155, 97, 24, 101, 155, 97, 133, 203, 198, 94}},  = {VWords = {24987, 26568, 24987, 25880, 24987, 52101, 24262}},  = {Reserved1 = 24987,  = { = {VLongs = {1696096667, -880451173, 1538088646}},  = {Reserved2 = 24987, Reserved3 = 25880,  = { = {VRecord = {PRecord = 0x5bad5ec6, RecInfo = 0xa91314f8}},  = {VUString = 0x5bad5ec6},  = {VPointer = 0x5bad5ec6},  = {VArray = 0x5bad5ec6},  = {VAny = 0x5bad5ec6},  = {VString = 0x5bad5ec6},  = {VUInt64 = 12183104473889857222},  = {VInt64 = -6263639599819694394},  = {VLongWord = 1538088646},  = {VWord = 24262},  = {VByte = 198},  = {VShortInt = -58},  = {VUnknown = 0x5bad5ec6},  = {VBoolean = 24262},  = {VError = 1538088646},  = {VDispatch = 0x5bad5ec6},  = {VOleStr = 0x5bad5ec6},  = {VDate = -7.9345728735292323e-111},  = {VCurrency = 153808.8646},  = {VDouble = -7.9345728735292323e-111},  = {VSingle = 9.75987509e+016},  = {VInteger = 1538088646},  = {VSmallInt = 24262}}}}}}}}},256)
System.Variants.VarAsType({ = { = {RawData = {1637573976, 1637574032, 1600341209, 1637574020}},  = {VType = 25944,  = { = {VBytes = {155, 97, 144, 101, 155, 97, 217, 68, 99, 95, 132, 101, 155, 97}},  = {VWords = {24987, 26000, 24987, 17625, 24419, 25988, 24987}},  = {Reserved1 = 24987,  = { = {VLongs = {1155096987, 1703173987, 1536975259}},  = {Reserved2 = 24987, Reserved3 = 17625,  = { = {VRecord = {PRecord = 0x5b9c619b, RecInfo = 0xae0014f8}},  = {VUString = 0x5b9c619b},  = {VPointer = 0x5b9c619b},  = {VArray = 0x5b9c619b},  = {VAny = 0x5b9c619b},  = {VString = 0x5b9c619b},  = {VUInt64 = 12538044419520881051},  = {VInt64 = -5908699654188670565},  = {VLongWord = 1536975259},  = {VWord = 24987},  = {VByte = 155},  = {VShortInt = -101},  = {VUnknown = 0x5b9c619b},  = {VBoolean = 24987},  = {VError = 1536975259},  = {VDispatch = 0x5b9c619b},  = {VOleStr = 0x5b9c619b},  = {VDate = -4.0421182499477257e-087},  = {VCurrency = 153697.5259},  = {VDouble = -4.0421182499477257e-087},  = {VSingle = 8.80348294e+016},  = {VInteger = 1536975259},  = {VSmallInt = 24987}}}}}}}}},256)
Aurelius.Drivers.Remotedb.TXDatasetResultSetAdapter.GetFieldValue(0x61d57158,0)
Aurelius.Drivers.Base.TDriverResultSetAdapter__1<Remotedb.Client.Dataset.TXDataset*>.GetFieldValue(0x61d57158,'A_ID')
:5F635DB2 __stub_in20v0__ZN8Aurelius7Drivers4Base26TDriverResultSetAdapter__1IPN8Remotedb6Client7Dataset9TXDatasetEE13GetFieldValueEN6System13UnicodeStringE
Aurelius.Commands.Abstractcommandperformer.TAbstractSQLPerformer.ReadFieldValue(0x670786b0,0x61d5716c,'A_ID',35)
Aurelius.Commands.Selecter.TSelecter.HasNullId(0x670786b0,0x61d5716c)
Aurelius.Commands.Selecter.TSelecter.ReadObject(0x670786b0,nil,0x66c257b8,0x61d5716c,1,0)
Aurelius.Commands.Selecter.TSelecter.SelectFetch(0x670786b0)
Aurelius.Engine.Objectmanager.TObjectManager.TEngineCursor.Next(0x67078648)
Aurelius.Engine.Objectmanager.TObjectManager.List(0x61de2fb0,0x66862a20,0x668687b8)
Aurelius.Criteria.Base.TCriteria.FillList(0x66862a20,0x668687b8)
Nahar.Model.Globalsystem.TCriteria.UniqueResult<Nahar.Entity.Usuario.TEntityUsuario*>(0x66862a20)
Aurelius.Criteria.Base.TCriteria__1<Nahar.Entity.Usuario.TEntityUsuario*>.UniqueResult(0x66862a20)
Nahar.Model.Globalsystem.TNaharModelGlobalSystem_Initialize$3102$ActRec.$5$Body(0x66880168,{})
:5FADF5E2 __stub_in20s__ZN5Nahar5Model12Globalsystem46TNaharModelGlobalSystem_Initialize$3102$ActRec7$5$BodyERKN6System7VariantE
Nahar.Model.TNaharModel.GetFindData(0x668831c0,'usuario.login',{})
:5FA72028 __stub_in92s__ZN5Nahar5Model11TNaharModel11GetFindDataEN6System13UnicodeStringERKNS2_7VariantE
Nahar.Client.Users.TNaharUserManager.LocateUser(0x668800d8,'admin')
Nahar.Client.Users.TNaharUserManager.CheckLogin(0x668800d8,'admin', <Error reading address 0x0: No error>)
Nahar.Client.Loader.TNaharLoader.Login(0x6687da28,'admin', <Error reading address 0x0: No error>)
Nahar.Client.Loader.TNaharLoaderDesktop.Login(0x6687da28,'admin', <Error reading address 0x0: No error>)
Naharmain.TMainForm.btnLoginClick(0x61d77180,0x66c1be58)


More hours of testing, I got the following:

Test structure:

Server running on windows server 2008 r2 datacenter. There is nothing else on this server, only my remoteDB program and the ElevateDB server on port 12010.

URL reservation works. 2 URL exposed with 2 TRemoteDBModule added for ElevateDB. Each one for a different database on the SAME ElevateDB Server.

My software compiled for win32 running on windows 8. IT can connect directly to ElevateDB and works fine. It also can connect to the RemoteDB and start normally. (I have found one problem but I will see later)

This same software compiled for Android 4.2.2 (Samsung Tab 3). Tested with Release and Debug mode. At beginning I could not make debug mode works. I got Internal Errors. Now I could find a way to make it work (removing the option for DCUs and let the DCC as a separate process). 

On Android the application starts normally, and it contact the RemoteDB (I added some debug messages on MyRemoteDB)

However the program raises and exception. I could trace it to this point: (call stack is on the previous post)

Unit Aurelius.Drivers.RemoteDB

{ TXDatasetResultSetAdapter }

function TXDatasetResultSetAdapter.GetFieldValue(FieldIndex: Integer): Variant;
var
  S: string;
begin
  Result := inherited GetFieldValue(FieldIndex);
  case VarType(Result) of
    varUString, varOleStr:
      begin
        S := VarToStr(Result);    <=======  here there is a GUID inside the S
        Result := VarAsType(S, varString);  <============= here causes the exception
      end;
  end;
end;

The exception is:

could not convert variant of type (unicodestring) into type (string)

For unknown reason the same code works on Win32 and in Android is not working.

Same everthing, database, data, compiler. I am just trying to make the exact same code works on both platforms.

From this point I dont know what else I can do to continue and make the Android code works.

Please, I need advice.

Eduardo

Eduardo, please completely remove the TXDatasetResultSetAdapter.GetFieldValue method from that unit. It should work then. That's how it is now in our development version.