Header Ads

Debugging locally with App Engine and Android

Senario
AppEngine is free, Android is free thus you think that developing for both of them is cheap and thus you start working on your backend and found out that you have to connect the AppEngine to Android, how could you enable this?

Introduction
If you're in mac, there is the AppEngine software but what it does is bind your AppEngine application to localhost thus you cant access localhost in Android coz Android has its own localhost, and if you access via your ip and port on Android it might not work.

What Do I Need
Terminal
Mac or Linux (If you guys can port this in Windows or it works in Windows, kindly drop a comment below)

On App Engine
On your terminal, get your IP
ifconfig | grep 192
If you're under the 192.168 IP then you can see your IP, copy this. In mac its the first 192.168.x.x. For our example we would use 192.168.1.101 and bind it to 8082
cd <your AppEngine Folder
dev_appserver.py -a 192.168.1.101 -p 8082 .


On Android
In you App you can now access 192.168.1.101:8082 and it shall return it from values from your AppEngine. This method works as long as your in the same network thus if there are more than one programmer both could access it.

You could use Open URL Tutorial to try it out :)

No comments:

Powered by Blogger.