For my app, the client has a local KVS. I want to upload the KVS and store it on the server, so it looks like the proper way is to B4XSerializator the KVS and send it up.
The serialized KVS will be stored in a MySQL database (already set up and functioning properly).
I did a search for "b4j file client," which did not seem to have any relevant code, and B4XSerializator, which had a ton of results, none of which I could determine were relevant (but I'm sure there are some relevant hits there--I just don't know what to look for.)
(If anyone wants to suggest an alternate/better approach, I'm all ears!)
I might try to migrate to @aeric 's User Login + MySQL B4J API (API Key + Token), which looks amazing, but I'm on a roll right now with what I started with, and I'll have to make a few mods to get his system up and running locally. (No biggie. Just have momentum already...)
Ah. OK. So, on the client, I would need to ZIP the KVS to a separate file then upload it with a BinaryStream (?). Can you show me or point me to a sample B4J client upload binary code?
Thank you!
*You should have known this, @Erel . Why would I use anything else?!
I referenced that thread in my first post here. I don't have B4A. (I'll get it eventually, just not needed yet.) So, is there a B4J version of that client? I guess I can view the code in a text editor anyway... but it would be nice to have a B4J client.
I referenced that thread in my first post here. I don't have B4A. (I'll get it eventually, just not needed yet.) So, is there a B4J version of that client? I guess I can view the code in a text editor anyway... but it would be nice to have a B4J client.
B4A is free. Why not try and use it? If you have no Android device, you can try whether the emulator works for you. Btw, I am trying to port my B4A client to B4J and it seems not so straight forward for me especially the UI. Maybe I am more familiar with B4A.
B4A is free. Why not try and use it? If you have no Android device, you can try whether the emulator works for you. Btw, I am trying to port my B4A client to B4J and it seems not so straight forward for me especially the UI. Maybe I am more familiar with B4A.
Well, I'm actually trying to upload a KVS file. I'm probably going to take Erel's suggestion and Zip it up and upload it to the server. What's your thinking in that regard?
Well, I'm actually trying to upload a KVS file. I'm probably going to take Erel's suggestion and Zip it up and upload it to the server. What's your thinking in that regard?
@aericYou're right! I think I got confused as to which topic I was on... Sorry about that.
Your sample uploads a file, right? Once I have the file uploaded, I'll just dump it into my database. Are you saying I could skip the "save file" step and put the data directly into the database? That would probably be optimal.
I guess I could InputStream it to a Byte() and put that in the MySQL DB, right?
Yes, I guess you only want the values right? I don't get the point to store the KVS files into database. Unless it is image file.
If you only want to add new data to MySQL table then you can use SQL query to insert the data.
On the client, I'm using a KVS. That way they can work with it locally and offline. When it's time to save it, I will just upload that and store it in a MySQL database as a BLOB. I will probably convert everything to work directly to a MySQL database at some point, if it becomes necessary or desirable. For now, this seemed like a quick and easy solution.