I am looking to create a library passing to b4a a table like this:
Id Title Type Editor
1 ABC Romance xxxxx
2 DEF Historical yyyyy
3 GHI Romance zzzzz
With java I begin with
public Map MyMap(String Param)
........
........
Map1 Map = new Map();
Map1.initialize;
List1 List = new List();
List1.initialize;
.......
List1.Add("ABC");
List1.Add("Romance");
List1.Add("xxxxx");
and so on....
.......
.......
Map1.put(1,List1);
and so on.....
.......
return Map1;
........
B4a program:
Dim Map1 as Map
Map1.Initialize
Map1=Library.MyMap("1952")
I have the result, but I think that this code isn't probably a good code:
1 Is 'Map' + 'List' the best solution to pass the table ?
2 How can I use Type Book(B_Id as int, B_Title as String,....) to semplify the code? For example the phone library has a Contacts2 class and also a Contact Type.
Thanks
Id Title Type Editor
1 ABC Romance xxxxx
2 DEF Historical yyyyy
3 GHI Romance zzzzz
With java I begin with
public Map MyMap(String Param)
........
........
Map1 Map = new Map();
Map1.initialize;
List1 List = new List();
List1.initialize;
.......
List1.Add("ABC");
List1.Add("Romance");
List1.Add("xxxxx");
and so on....
.......
.......
Map1.put(1,List1);
and so on.....
.......
return Map1;
........
B4a program:
Dim Map1 as Map
Map1.Initialize
Map1=Library.MyMap("1952")
I have the result, but I think that this code isn't probably a good code:
1 Is 'Map' + 'List' the best solution to pass the table ?
2 How can I use Type Book(B_Id as int, B_Title as String,....) to semplify the code? For example the phone library has a Contacts2 class and also a Contact Type.
Thanks