Issue
I have the following setup. I have Android Studio configured to run with Genymotion VM.
Also, I have a Ubuntu 14.04 VM in VirtualBox-4.3 with elgg running as a PHP application on Apache web server. The Elgg is an open source social network PHP application.
I have added a test plugin in Elgg. The plugin opens a RESTful API that echoes back a string. So I can go to the browser in the Ubuntu VM and type
localhost/<some-url>?string=hello+world
and the page returns a json
{"status":0,"result":"hello world"}
Now I need to write a Android app that can send the same request. The Android app needs to be running in the Genymotion VM and needs to talk to the Apache Web Server running in the VirtualBox Ubuntu VM. It needs to send a request to the same URL (using IP address probably) and get back the json and display it.
I have a hint that it will involve port forwarding kind of thing.
Can anyone suggest how exactly should I set this up ?
Solution
The way I made this work was to put the Ubuntu VM in Host-only networking mode in VirtualBox. The two VMs can talk to each other. The Android app in the Genymotion VM can then access the Elgg PHP application running in the Ubuntu VM using the right IP address and port number for Apache.
Answered By - Jake
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.