Results 1 to 6 of 6
  1. #1

    network on Android emulator?

    Lately I installed Android Linux's emulator on Slackware GNU/Linux. I am trying to set up the emulator to be able to access the 'net, but the emulator seems to only have an option for wi-fi (which my PC does not have), and no option for ethernet. How would one set that up? Maybe one day I will run Android on a device if a touchscreen-enabled GNU/Linux does not work on it, but for now there are some things I want to try on the emulator, since unfortunately many programs are now only for OSes such as Android rather than ones for standard desktops and laptops.

  2. #2
    Hi dchmelik!

    Just to be absolutely sure we're speaking of the same thing, when you say the 'net, you mean the Internet, yes?

    If so then, what issues/errors are you seeing when you try to access the Internet from within the emulator?

    I am using the emulator on openSUSE Linux.

    I downloaded the most complete ADT ( Android Developer Tools) Bundle ZIP file. At the moment I believe what I'm running was contained in the file named: ADT-22.0.5.zip

    After downloading the ZIP file, I did this:

    1) created a directory for Android development.
    2) made sure the zip file integrity verified.
    3) unloaded the zip file into the directory.
    4) added the tools and platform-tools directories to my PATH variable, with the new PATH value exported.
    5) made sure the ADT had access to JDK 6.
    6) ran Eclipse
    7) created an Android Virtual Device from within Eclipse.
    8) ran the emulator from the command line specifying the device I created.
    9) from within the virtual device, I used the default browser to access the Internet.

    I am using the emulator on a Linux system which already has access to the Internet.
    I did nothing special/specific to set up Internet access for the emulator itself; it simply worked using the standard Internet access the Linux system already has.
    The Linux system I am using accesses the Internet via Ethernet.
    Has someone told you of some issues specific to Slackware?

    Please contrast my experience using openSUSE Linux, with yours under Slackware Linux.

    HTH,

    rigor


    Last edited by rigor; 09-19-2013 at 08:29 PM.

  3. #3
    Quote Originally Posted by rigor View Post
    Hi dchmelik!

    Just to be absolutely sure we're speaking of the same thing, when you say the 'net, you mean the Internet, yes?
    Yes; that is what the abbreviation stands for.

    If so then, what issues/errors are you seeing when you try to access the Internet from within the emulator?
    I said I am trying to set up the emulator to access the 'net, sort of like if I was trying to set up a bicycle kit to access roads. I did not say I already tried to use such a thing in such a way, which would not be possible unless it was already set up.

    [...] I am using the emulator on a Linux system which already has access to the Internet.
    I did nothing special/specific to set up Internet access for the emulator itself; it simply worked using the standard Internet access the Linux system already has.
    The Linux system I am using accesses the Internet via Ethernet.
    Has someone told you of some issues specific to Slackware?

    Please contrast my experience using openSUSE Linux, with yours under Slackware Linux.
    No one told me of Slackware-specific issues. The reason it works for you may actually be openSUSE-specific issues--IMO. I did more reading after posting, and apparently setting up network access for an emulator requires a virtual network device. OpenSUSE probably makes one automatically, but it should not necessarily do so: a virtual network device is not standard and is not really something most users need, and when an OS automatically sets one up, people assume that is normal and that otherwise there is an issue, but the truth is OSes that do extra things for users prevent them from learning how to set things up (which are about the same across decent OSes, even if they do more but can also be set up manually). I am sure it could be set up properly on Slackware; I just do not know how. I thought the emulator would need a wireless device, but according to your description, it uses whatever virtual one as if it is wireless anyway.

    Some Android documentation or articles describe some of the process of setting up a virtual network device, but it is very complicated, and none of the descriptions I have found are very good or complete, seeming to assume the reader has a Computer Science degree specializing in networking.


    Last edited by dchmelik; 09-20-2013 at 09:22 PM. Reason: typo

  4. #4
    Quote Originally Posted by dchmelik View Post
    ... I did smore reading after posting, and apparently setting up network access for an emulator requires a virtual network device. OpenSUSE probably makes one automatically, but it should not necessarily do so: a virtual network device is not standard and is not really something most users need, and when an OS automatically sets one up, people assume that is normal and that otherwise there is an issue, but the truth is OSes that do extra things for users prevent them from learning how to set things up (which are about the same across decent OSes, even if they do more but can also be set up manually). I am sure it could be set up properly on Slackware; I just do not know how. I thought the emulator would need a wireless device, but according to your description, it uses whatever virtual one as if it is wireless anyway.

    Some Android documentation or articles describe some of the process of setting up a virtual network device, but it is very complicated, and none of the descriptions I have found are very good or complete, seeming to assume the reader has a Computer Science degree specializing in networking.
    I feel your description about OS's doing extra things for User's is a fairly good point. I feel somewhat that way about Microsoft Windows, which is why I try to avoid using it. I suppose some of those things it does automatically might be appropriate for people that aren't aware of what sorts of things take place inside the computer. But for someone who is aware of what goes on inside the computer, I feel it can sometimes make troubleshooting a problem, more difficult, as in some cases the automatic response to problems, may obscure some of the details of the problem.

    However, since I have done a fair amount of Systems Programming, including work as a Unix Kernel Engineer, I'm really not in the habit of letting an OS do whatever it wants, automatically for me.

    As to assumptions, I try to avoid making assumptions, just as intensely as I would avoid contact with the Ebola virus!

    It has been claimed that the first Android phone was sold around October 2008. I am using a version of openSUSE that is several years old, because I have some concerns about the newer versions. If the claim about the advent of the first Android phone is even very roughly close to the actual time frame when Android phones appeared, on general principle, it would be incredibly unlikely that a Linux distro. several years old, would even have the ability to magically create a virtual networking device, for an Android emulator.

    More specifically, I pay very close attention to all networking on my system, just in case on general principle, some change, might in some way invalidate carefully crafted Firewall rules.

    But we seem to be trying to discuss things in the abstract, without entirely specific details. Perhaps you could post the URL for the document that you are using to set up the Emulator, so people can see the details you're using.

    I'm using a machine with a multi-boot environment, set up to boot a variety of different OS's. I've got plenty of extra space. If you'll indicate which Slack version you're using, I'll install it, and load the ADT onto it, so I can try to overcome the problem. I'll have to move some things around, but I've been meaning to do that anyway.



  5. #5
    Maybe there is some other reason it works on openSUSE but not Slackware, but I think there are other reasons an OS may make a virtual network device--such as for older emulators (even the Android one is based on QEMU). I am using Slackware64 14.0, with all stable updates except the kernel and compiler tools, because the updated kernel made my system not boot, and I am using alienBOB's (a Slackware team member) 32-bit compatible compilers that would be overwritten with official compiler updates.

    I was not really using a very detailed URL... it was just the documentation on the Android site about the SDK and/or emulator. It said you can run 'emulator' (in sdk/tools) with examples of parameters for specific virtual machines, but I think somewhere it said you can run 'android' (in sdk/tools), or I just did that. Maybe there is more I could do, such as the steps you did, but either the URL I read, which I think I cannot find now, or someone on Freenode IRC #android-dev (I think), maybe said just run it how I have been doing. I am pretty sure one does not have to run Eclipse just to run the emulator; I am not sure I even have Eclipse installed.

    When running that 'android', I made a virtual Android machine with the screen how I wanted it, and it did not have me choose anything about networking. The virtual machine ran, showed me a bunch of applications (the web browser just could not access anything) and I just looked at its options and only saw the wi-fi network setup, not a wired one.

    I have JDK installed and its path set, but I did not add the emulator paths like in your example yet; I am just running the emulator from where I put it on my system. Maybe that is the problem; maybe Slackware actually does make a virtual network device that would be accessed if I set the paths. It just seemed like something unnecessary to me, but I may be wrong--there is a lot I still do not know about POSIX-based OSes, though I have a BS CS--just had not taken networking classes.

    I should probably follow your step of setting the paths before you try anything inconvenient.



  6. #6
    Quote Originally Posted by dchmelik View Post
    ...I was not really using a very detailed URL... it was just the documentation on the Android site about the SDK and/or emulator. It said you can run 'emulator' (in sdk/tools) with examples of parameters for specific virtual machines, but I think somewhere it said you can run 'android' (in sdk/tools), or I just did that. Maybe there is more I could do, such as the steps you did, but either the URL I read, which I think I cannot find now, or someone on Freenode IRC #android-dev (I think), maybe said just run it how I have been doing. I am pretty sure one does not have to run Eclipse just to run the emulator; I am not sure I even have Eclipse installed.

    When running that 'android', I made a virtual Android machine with the screen how I wanted it, and it did not have me choose anything about networking. The virtual machine ran, showed me a bunch of applications (the web browser just could not access anything) and I just looked at its options and only saw the wi-fi network setup, not a wired one.

    I have JDK installed and its path set, but I did not add the emulator paths like in your example yet; I am just running the emulator from where I put it on my system. Maybe that is the problem; maybe Slackware actually does make a virtual network device that would be accessed if I set the paths. It just seemed like something unnecessary to me, but I may be wrong--there is a lot I still do not know about POSIX-based OSes, though I have a BS CS--just had not taken networking classes.

    I should probably follow your step of setting the paths before you try anything inconvenient.
    I merely described the steps I followed to install the entire bundled ADT. I make no assumptions one way or the other about dependencies between things within the ADT. I don't know if eclipse is required to run the emulator. Eclipse is part of the ADT bundle. If you install the whole bundle, you install eclipse. I created the AVD ( Android Virtual Device ) I wished to use, from within eclipse. As I mentioned in step # 8 of my first message in this thread, I run the emulator from the command line. I basically just followed the instructions.

    In general, if one program needs to run other programs, when the first program is run, it can determine the directory from which it was run, and try to find the other programs it needs to run in the directory from which it was run, or in associated directories ( if any ) , or by looking at any directories listed in the PATH environment variable. Since I don't know whether or not the Android emulator has to run other programs, and if it does, I don't know how it finds them, I honored the tip near the end of this page:

    Creating an Android Project

    which suggests that the platform-tools/ and tools/ directories from the ADT, should be added to the PATH variable. I did that by placing this command in my .profile file:

    Code:
    export PATH=$HOME/extern/android/adt-bundle-linux-x86_64-20130219/sdk/platform-tools:$HOME/extern/android/adt-bundle-linux-x86_64-20130219/sdk/tools:$PATH
    In case it helps, I am running on a 64-bit machine, I chose to create a 10.1" Tablet as the AVD, of the ARM type, and I run the Android emulator with this command:

    Code:
    emulator  -avd "10.1_Tablet" -gpu on  -no-boot-anim
    I got most of the information about the emulator from these pages:

    Using the Emulator

    Android Emulator

    Although it is mentioned within those pages that the emulator has versatile networking capabilities which can be used for complex modeling, I am aware of no stated requirement on those pages for any complicated set up of any virtual network device. In fact it is explicitly said that the emulator acts like a normal application on the system. A normal application on the system needs no virtual network device. There is a mention of possible firewall related conflicts.

    There is a mention in some contexts, of possible conflict with other virtual environments. For collaboration, I sometimes use a remote screen sharing program which runs in a virtual environment, and that does seem to conflict with the emulator. For me, strange things happen when I try to use the two together. Sometimes what happens is simple, like an outright crash of both. Other times it's more subtle, something works oddly/unpredictably. So naturally you might want to make sure any other virtual environments are not being used at the same time.

    HTH.


    Last edited by rigor; 09-21-2013 at 10:39 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •