// Create a hashMap to add additional information to the transaction
HashMap<String,String> additionalInfo = new HashMap<String, String>(3);
additionalInfo.put("MyAppUser","John.Smith@email.com");
additionalInfo.put("InternalUserID","334253");
additionalInfo.put("Color","red");
Is this in b4a possiple?
Is this the right structure for a hashmap in b4a?
B4X:
Dim addi as String
addi = "{MyAppUser=,John.Smith@email.com=};{InternalUserID=,334253=};{Color=,red=}"
SU.additionalInfo1 = addi
for example, you can do something like this, adapted to your needs :
in B4A :
B4X:
Dim info As Map
info.Initialize
info.Put("MyAppUser","John.Smith@email.com")
info.Put("InternalUserID","334253")
info.Put("Color","red")
myLibOject.someFunc(info, other Lib parameters)
In the java Lib :
B4X:
public void someFunc(Map<String, String> baMap, other parameters) {
HashMap<String,String> additionalInfo = new HashMap<String, String>();
for (Entry<?, ?> e : baMap.entrySet()) {
additionalInfo.put((String)e.getKey(), (String)e.getValue());
}
// .....use additionalInfo as needed, it's now a java.util.HashMap
// rest of the code
}