Adding a new network bearer to Android
Asked Answered
B

1

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.

Byproduct answered 15/5, 2012 at 7:59 Comment(11)
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".Letitialetizia
@Neil yes, this is USBNet. What would be the advantage of running it with the Android as USB Host?Byproduct
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?Elwina
Do you plan to have your edits merged into mainline? Into CM? Or is it something you do just for you?Vignola
@Elwina 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.Byproduct
@Vignola No, this is just for us. But I'll write-up whatever I find over the next few months.Byproduct
@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?Elwina
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.Byproduct
probably, you could check this android-x86 Ethernet patch groups.google.com/forum/?fromgroups#!topic/android-x86/… which has example of adding ethernet support.Ribosome
@chrisdew is this now closed? Did you find a good solution, can you write it up as an answer?Scarify
@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.)Byproduct
G
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.

Genera answered 18/7, 2012 at 6:42 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.