105

I'd like to add new bearer(s) to Android (rooted/custom build), to be a peer with Wifi and GPRS.

I have done some Android development and I am aware that (in Android 2.2) there are constants for WIFI and GPRS. Does this mean that I will need to be adding constants in all over the place, as well as providing the network stack?

The first bearer I want to add is USBNet (for Androids with USB host).

Another will be a 3G USB dongle as a second GPRS bearer.

I have started by downloading the source.

alternative
  • 12,703
  • 5
  • 41
  • 41
fadedbee
  • 42,671
  • 44
  • 178
  • 308
  • 2
    My understanding is that Android already supports some form of USB networking, as this is used for USB tethering with a computer. Perhaps this also works in reverse when the Android device is "hosting". – Neil Alexander May 27 '12 at 11:38
  • 1
    @Neil yes, this is USBNet. What would be the advantage of running it with the Android as USB Host? – fadedbee Jun 06 '12 at 12:18
  • Does your hardware support USB Host mode? A lot of phones do not support this. You will need this to have a USB dongle. USBNet. (Ensure that your kernel is compiled with support for this) Does the dongle have Linux kernel support? – ajpyles Jun 11 '12 at 01:00
  • Do you plan to have your edits merged into mainline? Into CM? Or is it something you do just for you? – miniBill Jun 11 '12 at 10:56
  • @ajpyles Yes, most of the candidate tablets support USB Host (we are still choosing). The dongle is hardware we are manufacturing in-house, so we will have drivers, though they may not be in the kernel yet. – fadedbee Jun 11 '12 at 15:32
  • @miniBill No, this is just for us. But I'll write-up whatever I find over the next few months. – fadedbee Jun 11 '12 at 15:33
  • @chrisdew so is this a question about what things need to be done in Android VM to support these things or at the kernel level? – ajpyles Jun 11 '12 at 15:48
  • Android VM, or hopefully just altering a system library will do it, rather than messing with Dalvik. Kernel stuff already works, I just need to communicate bearer up/down events to Android/apps and let Android tell me when it needs to bring the new bearer(s) up/down. – fadedbee Jun 14 '12 at 10:50
  • 2
    probably, you could check this android-x86 Ethernet patch https://groups.google.com/forum/?fromgroups#!topic/android-x86/MPoj2Bzd-rE which has example of adding ethernet support. – sandrstar Jun 30 '12 at 06:51
  • 2
    @chrisdew is this now closed? Did you find a good solution, can you write it up as an answer? – Moog Jul 06 '12 at 11:09
  • @Merlin, I'll close the question when I've had a chance to read the android-x86 Ethernet patch, as this looks like the most promising path. (Hopefully next week.) – fadedbee Jul 08 '12 at 16:09

1 Answers1

1

WIFI add network will be you can take hints from this code..

how do we get the access point name from an Android Phone.

WifiManager mWiFiManager = (WifiManager) getSystemService(Context.WIFI_SERVICE);
WifiInfo w = mWiFiManager.getConnectionInfo();
Toast.makeText(this, "APN Name = "+w.getSSID(), Toast.LENGTH_SHORT).show();

The above code snippet is for current active APN name.

Chaitanya K
  • 1,827
  • 4
  • 32
  • 67