H
H
heavyrail2015-08-29 13:12:06
Android
heavyrail, 2015-08-29 13:12:06

How to programmatically organize automatic distribution of the Internet from an Android phone via USB (USB Tethering)?

I'm testing various Android devices for distributing the Internet via USB.
For some reason, some of these devices do not have the "USB modem" option in the settings, there is only the opposite - "USB Internet" (the computer distributes the Internet via USB, and Android receives it - but I need it the other way around).
Problematic devices have different brands and models, as well as Android versions, that is, it is impossible to establish a clear connection between the brand, model, OS version and the ability to work. If I install the USB Tethering program from the Market on such a device, then the possibility of distributing the Internet appears: the program starts automatically when connected to a PC, and prompts you to press the magic button "Start Tethering", which, in turn, calls the "Mode" submenu hidden in these models modem".
I would like to be able to start the distribution of the Internet via USB in automatic mode, i.e. so that it was not necessary to press any buttons, I connected it via USB - it all worked. Since I want to embed this function in my own program, I would like to look at some source codes on this topic. Tell me, where can I see these?
PS Well, for the initial tests, an already compiled application without source codes is useful.
PPS All this should work without root.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
R
roodz, 2020-05-29
@roodz

The choice of the USB operating mode is in developer mode
- Go to the phone settings, in the "About phone" section
- Then press 7 (or 10) times in a row on the shell version
- Go to "Settings" - "System" - "Advanced" - " For developers"
- Select "Default USB configuration" - "USB modem"
After that, distribution from the phone via USB will be turned on automatically when the cable is connected from the PC to the USB phone.

A
Alexander Ivanov, 2015-08-30
@Lazoreth

You need EasyTeether. He just lets you do it all.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question