A androidappl Active Member Licensed User Longtime User Mar 14, 2017 #1 hello you can have an example of communication (server side) written in C # or vb.net? Thanks so much
hello you can have an example of communication (server side) written in C # or vb.net? Thanks so much
Erel B4X founder Staff member Licensed User Longtime User Mar 14, 2017 #2 The only reason to use .Net Framework is if you have an existing .Net server. It will be much easier to implement a server with B4J. Upvote 0
The only reason to use .Net Framework is if you have an existing .Net server. It will be much easier to implement a server with B4J.
A androidappl Active Member Licensed User Longtime User Mar 14, 2017 #3 Erel said: The only reason to use .Net Framework is if you have an existing .Net server. It will be much easier to implement a server with B4J. Click to expand... exact I dispose of an old server (vb) + a handler written in vb.net and I wish I could connect and especially communicate with B4A for example. I could use an example just stupid sending communication and receipt of a string. I would be most grateful. Thank you Upvote 0
Erel said: The only reason to use .Net Framework is if you have an existing .Net server. It will be much easier to implement a server with B4J. Click to expand... exact I dispose of an old server (vb) + a handler written in vb.net and I wish I could connect and especially communicate with B4A for example. I could use an example just stupid sending communication and receipt of a string. I would be most grateful. Thank you
KMatle Expert Licensed User Longtime User Mar 14, 2017 #4 You can use JSON lists/maps which is very simple, even in .net. There's a Json serializer in .net which maps the maps to a class. Easy to find via Google. Upvote 0
You can use JSON lists/maps which is very simple, even in .net. There's a Json serializer in .net which maps the maps to a class. Easy to find via Google.
A androidappl Active Member Licensed User Longtime User Mar 23, 2017 #5 good morning, I came to the point that side .net (c #) I receive the item you serialize: Code: Copy B4XSerializator ser = new B4XSerializator(); object m = ser.ConvertBytesToObject(StreamExtensions.ToByteArray(result)); Then how do I convert the object type "object" in a c # dictionary? Upvote 0
good morning, I came to the point that side .net (c #) I receive the item you serialize: Code: Copy B4XSerializator ser = new B4XSerializator(); object m = ser.ConvertBytesToObject(StreamExtensions.ToByteArray(result)); Then how do I convert the object type "object" in a c # dictionary?
tigrot Well-Known Member Licensed User Longtime User Mar 23, 2017 #6 try this(i used some times ago): http://stackoverflow.com/questions/11576886/how-to-convert-object-to-dictionarytkey-tvalue-in-c Upvote 0
try this(i used some times ago): http://stackoverflow.com/questions/11576886/how-to-convert-object-to-dictionarytkey-tvalue-in-c
A androidappl Active Member Licensed User Longtime User Mar 23, 2017 #7 tigrot said: try this(i used some times ago): http://stackoverflow.com/questions/11576886/how-to-convert-object-to-dictionarytkey-tvalue-in-c Click to expand... thank you, I'm trying but I'm in charge. I can not convert it. Upvote 0
tigrot said: try this(i used some times ago): http://stackoverflow.com/questions/11576886/how-to-convert-object-to-dictionarytkey-tvalue-in-c Click to expand... thank you, I'm trying but I'm in charge. I can not convert it.
tigrot Well-Known Member Licensed User Longtime User Mar 23, 2017 #8 Do not convert byte to object use: StringFromBytes (bytes() As Byte, encoding As String) As String then you can analyze and get dictionary, or better a MAP. Upvote 0
Do not convert byte to object use: StringFromBytes (bytes() As Byte, encoding As String) As String then you can analyze and get dictionary, or better a MAP.
A androidappl Active Member Licensed User Longtime User Mar 23, 2017 #9 I lightly raped the library Erel. I paid off. Will update... Upvote 0
A androidappl Active Member Licensed User Longtime User Mar 23, 2017 #10 Code: Copy byte[] databytes = ser.ConvertObjectToBytes(sql_risp["DATI"]); response = Request.CreateResponse(HttpStatusCode.OK, new { Message = "Hello", Value = databytes }); The answer is accepted by the Web server API (c #) B4A but when the client receives the reply, can not serilizate object .... Suggestions? Error this: Error reading response: (DataFormatException) java.util.zip.DataFormatException: incorrect header check Upvote 0
Code: Copy byte[] databytes = ser.ConvertObjectToBytes(sql_risp["DATI"]); response = Request.CreateResponse(HttpStatusCode.OK, new { Message = "Hello", Value = databytes }); The answer is accepted by the Web server API (c #) B4A but when the client receives the reply, can not serilizate object .... Suggestions? Error this: Error reading response: (DataFormatException) java.util.zip.DataFormatException: incorrect header check
Erel B4X founder Staff member Licensed User Longtime User Mar 24, 2017 #11 androidappl said: Then how do I convert the object type "object" in a c # dictionary? Click to expand... Code: Copy Dictionary<Object, Object> d = (Dictionary<Object, Object>) m; Upvote 0
androidappl said: Then how do I convert the object type "object" in a c # dictionary? Click to expand... Code: Copy Dictionary<Object, Object> d = (Dictionary<Object, Object>) m;
A androidappl Active Member Licensed User Longtime User Mar 24, 2017 #12 Erel said: Code: Copy Dictionary<Object, Object> d = (Dictionary<Object, Object>) m; Click to expand... solved for now the current status is as follows: (I'm okay) CLIENT (B4X) -> Send an object dbcomand (bytes) SERVER - WEB API (C #) -> It receives the call and the object. Read the object (b4xserializator). SERVER - WEB API (C #) -> makes the sql requests or other activities. SERVER - WEB API (C #) -> Send the answer to the client in JSON format. if sql with results. CLIENT (B4X) -> Receives the response and displays the results. Upvote 0
Erel said: Code: Copy Dictionary<Object, Object> d = (Dictionary<Object, Object>) m; Click to expand... solved for now the current status is as follows: (I'm okay) CLIENT (B4X) -> Send an object dbcomand (bytes) SERVER - WEB API (C #) -> It receives the call and the object. Read the object (b4xserializator). SERVER - WEB API (C #) -> makes the sql requests or other activities. SERVER - WEB API (C #) -> Send the answer to the client in JSON format. if sql with results. CLIENT (B4X) -> Receives the response and displays the results.