Android Question Ami DuOS and B4A debugging

Discussion in 'Android Questions' started by Robert Valentino, Jun 17, 2015.

  1. Robert Valentino

    Robert Valentino Well-Known Member Licensed User

    I installed Ami DuOS on my PC and am running my App under it just fine (it has shown me some bugs in my code that do not appear when using my App on my Samsung S3 or Tab 3)

    A couple of places I forgot to use dip after a number and the screens looked fine on the S3 but on in the DuOS I saw that something was wrong and fixed it.

    OK now on to my question. Is it possible (has anyone tried it or is doing it) to debug using the DuOS environment?

    My PC only has a hardwired internet connection so I cannot us the bridge wireless

    Any help would be appreciated

    Bob
     
  2. Erel

    Erel Administrator Staff Member Licensed User

  3. Robert Valentino

    Robert Valentino Well-Known Member Licensed User

    DuOS is using a NAT address of 192.168.153.1 but for some reason B4A-Bridge is showing 10.0.3.15

    I cannot figure a way to connect.

    Has anyone got this working?

    I have tried both their Jellybean version and Lollipop version of DuOS

    I have also tried VMPlayer and installed android-x86-4.3-20130725.iso but when I run B4A-Bridge I get not connected to wireless network in My IP


    BobVal
     
  4. Erel

    Erel Administrator Staff Member Licensed User

    Ignore the ip address that B4A-Bridge displays and set the correct ip address in the IDE.
     
  5. Robert Valentino

    Robert Valentino Well-Known Member Licensed User

    I set the ip address to 192.168.153.1 in the IDE (using 4.3x)

    And I get failed to connect make sure the bridge program is listening and in wireless mode (which it is)

    Using bridge version 2.09
     
  6. Erel

    Erel Administrator Staff Member Licensed User

    Can you ping this ip from the command line?
     
  7. Robert Valentino

    Robert Valentino Well-Known Member Licensed User

    Didn't think I could but, Yes I can ping 192.168.153.1 and get the proper "reply from"
     
  8. Derek Johnson

    Derek Johnson Active Member Licensed User

    I've just started using DuOS and I encountered the same problem as yourself with regard to using Debug mode, however I'm glad to report that I have found a solution!

    In my case I've got DuOS installed on the same PC (A Lenova 23" AIO Touchscreen) as B4A. I can now use Debug Mode and the WYSIWIG Designer with DuOS!

    (The problem with trying to use a Wireless connection is that DuOS is using Network Address Translation, and that it doesn't seem to have any way of letting something on the network connect to an application that acts as a network server. This is a bit of drawback, perhaps they will fix it at some point, as it prevents a number of device to device apps from working. They could allow specific ports to connect for instance, just like home routers do. Just discovered that it does have such a facility, see here http://amiduos.com/support/knowledge-base/article/network-ports-forwarding-in-amiduos Now investigating B4A Bridge could be made to work via this method.)

    Anyway, for debugging the solution turns out to be the use of the ADB server, so when you get it working, it thinks that you have connected via a USB link back to your PC. This is even better than using a Wireless connection as the compile/install process is much quicker. (You can also see the App logs in Release Mode, I think).

    So how do you make this work? These are the basic steps:

    1. Enable root mode in AMIDuOS

    See here for how to do that:

    http://amiduos.com/support/knowledge-base/article/enabling-adb-connection_2

    This worked for me up to the last 2 step which are:

    In my case the command "adb devices" listed 2 devices, and the adb shell command gave an error

    A bit of research showed that there was a solution, using a slightly different shell command

    My efforts and the solution are shown below:



    2. Connect using the Connect button in B4A


    Once I had done this, I was able to connect to AMIDUOS with the connect button. I suspect that you may need to re-run the adb commands each time you start B4A.

    I could also use the WISYWIG designer too!
     
    Last edited: May 9, 2016
  9. peggjones

    peggjones Active Member Licensed User

    Could you tell me what you actually key into the IP address field on the connect button? I've tried 127.0.0.1 and 127.0.0.1:5565 and neither of them will connect.

    Thanks
     
  10. Derek Johnson

    Derek Johnson Active Member Licensed User

    With a real device, there are 2 ways of getting debug info:

    1. Connect to the device via TCPIP with B4ABridge installed on the device

    2. Connect to the device via the USB port with a lead back to the PC.​

    I have not succeeded in getting the first method to work with AMIDUOS, I can't get the debug information to display in B4A. I did make some progress in this area but not sufficient to make to make it work fully, and I do not recommend going down this route.

    The method I documented previously was a virtual method of using option 2. With this method you disconnect the B4A bridge, and use the ADB server. It works very well and seems 100% reliable.

    Derek
     
  11. peggjones

    peggjones Active Member Licensed User

    Thanks for your help. I'm afraid I can't get it to work though! Think I'll just buy a cheap Android stick and do things that way!
     
Loading...