Tinywebdb on local server (app inventor 2 and tinywebdb)

388 views
Skip to first unread message

Hans Visser

unread,
Dec 12, 2016, 8:31:49 AM12/12/16
to MIT App Inventor Forum
Hello,

I am using app inventor 2 now for 2 months and i can work with lists and the tinydb.
But with the Tinywebdb i cant get it working.

I have installed pyton, i have installed google app engine launger and i have a working tinywebdb on http://127.0.0.1:8080
I can put tings in the data base enad i can read from data base.

But i like to use the local database in a local app.

Local app inventor server http://127.0.0.1:8888

customtinywebdb27  runing on local server http://127.0.0.1:8080


I keep it simple and  only ask wen click on button get tag test


in the servsice url is now: http://appinvtinywebdb.appspot.com

I have tried http://127.0.0.1:8080 but also not working.


What must i use in service url to get it work (if possibble)



Taifun

unread,
Dec 12, 2016, 6:39:47 PM12/12/16
to MIT App Inventor Forum
127.0.0.1 is another name for localhost... and the database is on your computer, but not on your device, correct? So I would try the ip address of your computer instead, which usually is something like 192.168.0.x...

Taifun

Trying to push the limits of App Inventor! Snippets, Tutorials and Extensions from Pura Vida Apps by Taifun. 

Hans Visser

unread,
Dec 13, 2016, 5:07:33 AM12/13/16
to MIT App Inventor Forum
I know that 127.0.0.1 is a other name for local host.
But i use that because i try it wit a simulator on the same machine.

So at one Computer i have App inventor 2 (offline version) at port 8888, i have the pyton webserver at port 8000 and the tinywebdb database at 8080
So i have to use 127.0.0.1 or local host.

but in the url "http://appinvtinywebdb.appspot.com" is "appinvtinywebdb" only a subdomein from "appspot.com" so there is no reference to a speciale database.

I hope its no clear what i want and wat i mean because DUTCH is my mother language.

Thankyou for respondig,

Hans

Ghica

unread,
Dec 13, 2016, 6:50:48 AM12/13/16
to MIT App Inventor Forum
But for your phone (assuming your app runs on your phone) you cannot use 127.0.0.1 because your PC is not localhost for your phone.
Try what Taifun suggested to you. (Dutch is my mother language too, but I think your English should be good enough).
Cheers, Ghica.

Hans Visser

unread,
Dec 13, 2016, 12:03:31 PM12/13/16
to MIT App Inventor Forum
I can try it but a run the emulator on my pc.
So if its not working on my pc then i'm doing somthing wrong.

If i use the standard http://appinvtinywebdb.appspot.com then its working fine.
But i want that my users only can use the app/data when the are in MY network.

I know that when its working on my local emulator that i must change it to my pc ipadres
or local domain name when using it on a phone or tablet.

But i wil try.
I wil post my findings here.

Thanks



Hans Visser

unread,
Dec 13, 2016, 1:12:17 PM12/13/16
to MIT App Inventor Forum
I have tried http://192.168.1.xx (ip of my pc.
I have tried http://locathost:8080
i have tried http://127.0.0.1:8080

but i still get the message:
commenucation with the webserver time out.


Taifun

unread,
Dec 13, 2016, 5:55:53 PM12/13/16
to MIT App Inventor Forum
what about trying http://192.168.0.105:8080
assuming, that 192.168.0.105 is the ip address of your computer...

Taifun

PS read here https://en.wikipedia.org/wiki/Localhost why localhost will not work to access your computer from somewhere else

In computer networking, localhost is a hostname that means this computer

Hans Visser

unread,
Dec 14, 2016, 12:04:20 PM12/14/16
to MIT App Inventor Forum
I have tried http://192.168.1.16:8080 but it also not working.

I read the story over local host and i think i understand it, BUT
Local host is THE LOCAL PC/COMPUTER.

So i have on 1 PC the app adventor server, the emulator,and the database.
its all on local host and then the port number (http://localhost:portnr or http://127.0.0.1:portnr)

I hope that you or a other person has a solution.

 

Ghica

unread,
Dec 14, 2016, 1:43:47 PM12/14/16
to MIT App Inventor Forum
I think you still do not understand it. For example, if you have two PC's on the same network, you also have two localhosts. For the programs on PC1, localhost will be the webserver on PC1, for the programs on PC2, the webserver on PC2 will be localhost.
Now, if you would like to use a program on PC2 that is accessing a webserver on PC1, you cannot use localhost (and your phone is really like a second PC), but you can use the IP address of PC1. But depending on your router and on the webserver, it may or may not be possible to access other internal webservers. Databases usually do not allow that. This may be your problem. How to configure routers the right way is a magicians art, that depends on the moon and the sun being in the right position. Anyway, I am suspecting that this has nothing to do with App Inventor. Maybe there are appspot forums that have an answer.
And, you could have an appspot in a public space, to which you control access, in this way having the effect you desire.
Cheers, Ghica.

Taifun

unread,
Dec 14, 2016, 4:57:33 PM12/14/16
to MIT App Inventor Forum
my guess is, the emulator gets its own ip address, which means, it's not  localhost anymore...
I would use a device for your tests to eliminate emulator issues together with this ip address http://192.168.1.16:8080

Taifun
Reply all
Reply to author
Forward
0 new messages