Reflection for Type structure

pbmi

Member
Licensed User
Longtime User
Hi

I would like to get the metadata for a Type() structure, eg Field Count, FieldNames, FieldTypes, etc.

Is this possible with the Reflection library? Or is there another solutions.

Thanks
 

pbmi

Member
Licensed User
Longtime User
I want to build an abstract user input panel routine to use with many different user Types.

For example:

' get fieldcount, fieldnames from reflection on Type xxxz

Dim sv as scrollview

for I=0 to fieldcount

Dim line as horizontalscrollview
..

Dim lbl as label
..
lbl.text9=fieldnames(i)

line.panel.addview(label,..

Dim txt as edittext
..

line.panel.addview(txt,..

sv.panel.addview(line,..

next



Sent from my GT-I9100 using Tapatalk 2
 
Last edited:
Upvote 0

AntoDroid

Member
Licensed User
Longtime User
Using Reflection for custom type

Type structures are regular Java classes. However Reflection library doesn't include methods to find this data.

Why do you need to find these values?

It will be extremely usefull in order to serialize/deserialize json object retrieved or sended to WService into/from a custom type ( waiting for user classes in next releases )
 
Upvote 0

pbmi

Member
Licensed User
Longtime User
Great!

Many thanks for this. Will test this out asap...

Sent from my GT-I9100 using Tapatalk 2
 
Upvote 0

AntoDroid

Member
Licensed User
Longtime User
json to type, type to json

Note that you can already serialize types with RandomAccessFile.WriteObject.
Thank for your replay Erel. But what is the best way to convert a json from an httpresult into a custom type object?
 
Upvote 0
Top