Rafi Fahreza Member Feb 17, 2020 #1 HI guys i am working on some project that using json, first i try the online json and its perfectly work. but right now iam developing json that built in flask python, still offline, how can i use my offline json (localhost) json? please, i need it seriously ?
HI guys i am working on some project that using json, first i try the online json and its perfectly work. but right now iam developing json that built in flask python, still offline, how can i use my offline json (localhost) json? please, i need it seriously ?
Erel B4X founder Staff member Licensed User Longtime User Feb 17, 2020 #2 What do you mean with offline json? How will it reach your app? Upvote 0
Rafi Fahreza Member Feb 17, 2020 #3 i mean, the json that still under development. can i test my json with my app? Upvote 0
Peter Simpson Expert Licensed User Longtime User Feb 17, 2020 #4 Rafi Fahreza said: but right now iam developing json that built in flask python, still offline, how can i use my offline json (localhost) json? ? Click to expand... You can use the following software offline on your development pc or any internal computer to emulate any online server for JSON responses. API engineering for your agents Go faster from development to production with higher accuracy and fewer tokens. www.postman.com Enjoy... Upvote 0
Rafi Fahreza said: but right now iam developing json that built in flask python, still offline, how can i use my offline json (localhost) json? ? Click to expand... You can use the following software offline on your development pc or any internal computer to emulate any online server for JSON responses. API engineering for your agents Go faster from development to production with higher accuracy and fewer tokens. www.postman.com Enjoy...
Rafi Fahreza Member Feb 17, 2020 #5 Code: Copy dim j as HTTPJob j.initialize("",Me) j.download("http://127.0.0.1:5000/myapi") that means i cant use a code like that, isnt it? with localhost? Upvote 0
Code: Copy dim j as HTTPJob j.initialize("",Me) j.download("http://127.0.0.1:5000/myapi") that means i cant use a code like that, isnt it? with localhost?
Peter Simpson Expert Licensed User Longtime User Feb 17, 2020 #6 Something like that, more or less yes @Rafi Fahreza... Upvote 0
Rafi Fahreza Member Feb 17, 2020 #7 umm unfortunately, bcs i really need to develop my json with my real app thx u all! Upvote 0
Peter Simpson Expert Licensed User Longtime User Feb 17, 2020 #8 Rafi Fahreza said: umm unfortunately, bcs i really need to develop my json with my real app thx u all! Click to expand... Okey then, have you looked at JSONGenerator using the JSON library??? Upvote 0
Rafi Fahreza said: umm unfortunately, bcs i really need to develop my json with my real app thx u all! Click to expand... Okey then, have you looked at JSONGenerator using the JSON library???
Rafi Fahreza Member Feb 17, 2020 #9 B4X: Copy dim j as HTTPJob j.initialize("",Me) j.download("http://127.0.0.1:5000/myapi") Peter Simpson said: Okey then, have you looked at JSONGenerator using the JSON library??? Click to expand... yes i have, but i just confused, can i fill the ip address like that? but i tried once, it shows JavaConnectionError Upvote 0
B4X: Copy dim j as HTTPJob j.initialize("",Me) j.download("http://127.0.0.1:5000/myapi") Peter Simpson said: Okey then, have you looked at JSONGenerator using the JSON library??? Click to expand... yes i have, but i just confused, can i fill the ip address like that? but i tried once, it shows JavaConnectionError
DonManfred Expert Licensed User Longtime User Feb 17, 2020 #10 I guess you should describe it MORE CLEARLY what exactly the goal is. As of now it is not clear to me. Upvote 0
I guess you should describe it MORE CLEARLY what exactly the goal is. As of now it is not clear to me.
Peter Simpson Expert Licensed User Longtime User Feb 17, 2020 #11 Have you done a proper search @Rafi Fahreza? Search Results www.b4x.com Upvote 0
Rafi Fahreza Member Feb 17, 2020 #12 i have my own api built in flask, when i run my api, it shows like this. when i try the api in postman, it works like this. but when i try from my app (heres my app code) but it show error like this . i hope you understand guys, sorry for my bad english Upvote 0
i have my own api built in flask, when i run my api, it shows like this. when i try the api in postman, it works like this. but when i try from my app (heres my app code) but it show error like this . i hope you understand guys, sorry for my bad english
Peter Simpson Expert Licensed User Longtime User Feb 17, 2020 #13 Have you not spotted this??? JSonGenerator Hi, I need the JSonGenerator to produce JSon like shown below. How can I achieve these examples with list/map/type? I sometimes need 5 or 6 variables within a record, so I though a type would be perfect for this. It would be nice to have a JSonBuilder object :). 1st example... www.b4x.com The example in the linked will give you this JSON output. Code: Copy { "Key2": "Value2", "Key": "Value" } [ { "Record": "1", "Key": "Value1" }, { "Record": "2", "Key": "Value2" } ] [ { "ResponseTime": "\/Date(123)\/", "Records": [ { "Record": "1", "Key": "Value1" }, { "Record": "2", "Key": "Value2" } ] } ] And you can parse the JSON data back with this code Code: Copy Dim parser As JSONParser parser.Initialize(<text>) Dim root As Map = parser.NextObject Dim Key2 As String = root.Get("Key2") Dim Key As String = root.Get("Key") Upvote 0
Have you not spotted this??? JSonGenerator Hi, I need the JSonGenerator to produce JSon like shown below. How can I achieve these examples with list/map/type? I sometimes need 5 or 6 variables within a record, so I though a type would be perfect for this. It would be nice to have a JSonBuilder object :). 1st example... www.b4x.com The example in the linked will give you this JSON output. Code: Copy { "Key2": "Value2", "Key": "Value" } [ { "Record": "1", "Key": "Value1" }, { "Record": "2", "Key": "Value2" } ] [ { "ResponseTime": "\/Date(123)\/", "Records": [ { "Record": "1", "Key": "Value1" }, { "Record": "2", "Key": "Value2" } ] } ] And you can parse the JSON data back with this code Code: Copy Dim parser As JSONParser parser.Initialize(<text>) Dim root As Map = parser.NextObject Dim Key2 As String = root.Get("Key2") Dim Key As String = root.Get("Key")
Rafi Fahreza Member Feb 17, 2020 #14 but i cant access the link of my own json, see the attachments above i got some error Upvote 0
Rafi Fahreza Member Feb 17, 2020 #15 it show failed to connect @Peter Simpson im sorry for my bad english Upvote 0
Peter Simpson Expert Licensed User Longtime User Feb 17, 2020 #16 The search engine on this absolutely fabulous forum does in fact work you know @Rafi Fahreza, just search for it. There is probably more up to date links and information, but I've got other things that I have to start doing now, like starting to cook the dinner.. Embed an Http Server in your Android Application The HttpServer library is a new library, based on an open source project named Jetty. This library allows you to easily embed an Http server in your application. Http server means that you can point a browser to the device IP address (and relevant port) and communicate with your app. It can be... www.b4x.com Upvote 0
The search engine on this absolutely fabulous forum does in fact work you know @Rafi Fahreza, just search for it. There is probably more up to date links and information, but I've got other things that I have to start doing now, like starting to cook the dinner.. Embed an Http Server in your Android Application The HttpServer library is a new library, based on an open source project named Jetty. This library allows you to easily embed an Http server in your application. Http server means that you can point a browser to the device IP address (and relevant port) and communicate with your app. It can be... www.b4x.com
Erel B4X founder Staff member Licensed User Longtime User Feb 17, 2020 #17 127.0.0.1 will not work. This points to the device itself, even if you are running it on the emulator. Start with a real device and put the PC ip address. You will need to first open the relevant port in Windows firewall. Upvote 0
127.0.0.1 will not work. This points to the device itself, even if you are running it on the emulator. Start with a real device and put the PC ip address. You will need to first open the relevant port in Windows firewall.
Rafi Fahreza Member Feb 17, 2020 #18 Erel said: 127.0.0.1 will not work. This points to the device itself, even if you are running it on the emulator. Start with a real device and put the PC ip address. You will need to first open the relevant port in Windows firewall. Click to expand... okayy, i checke my computer address via cmd "ipconfig" and it show 192.168.100.9 so should i change the 127.0.0.1 with that address? Upvote 0
Erel said: 127.0.0.1 will not work. This points to the device itself, even if you are running it on the emulator. Start with a real device and put the PC ip address. You will need to first open the relevant port in Windows firewall. Click to expand... okayy, i checke my computer address via cmd "ipconfig" and it show 192.168.100.9 so should i change the 127.0.0.1 with that address?
Erel B4X founder Staff member Licensed User Longtime User Feb 17, 2020 #19 Rafi Fahreza said: so should i change the 127.0.0.1 with that address? Click to expand... Start with a real device and put the PC ip address. You will need to first open the relevant port in Windows firewall. Upvote 0
Rafi Fahreza said: so should i change the 127.0.0.1 with that address? Click to expand... Start with a real device and put the PC ip address. You will need to first open the relevant port in Windows firewall.