The question is how you can bypass your phone’s WiFi and connect your phone to the Internet via your PC, that is using the USB cable.

It is possible, and it is called reverse Tethering, as opposed to using your phone’s WiFi internet to obtain internet connection for you PC (which is then called normal tethering).

This instruction should work for any phone with Android operating system, but specifically I managed to do it for my Xiaomi Redmi 4X phone.

The reason why this was important in my case is the fact that their official MiPCSuite, which should be used for connecting to the Internet among other things, wouldn’t work with their new Redmi Phones and with my Redmi 4X as well. Their last update is dated 03.07.2015. That means that all newer phones with newer operating systems won’t be able to use Mi PC Suite.

So here we go:

  1. If you haven’t done so, you have to switch on USB debugging. Navigate to Settings —> About Home. Find MIUI version field. Touch it 7 times in a row. This will enable Developer Options.
  2. Go to Settings —> Additional Settings —> Developer Options —> USB debugging and enable it.
  3. Install Reverse Tethering Server from this page by downloading the Windows Zip file. (Note that your computer should have at least Java Runtime Environment 1.7 installed, which on my Windows 7 was already there.) In fact, when you download the Server, there is nothing to install, just unzip the file and start the exe file called in the current version ReverseTetheringServer_1.1.2.exe. When you start the server nothing will happen, no visual confirmation, except the fact that the server is active and will accept connections from your phone.
  4. On your phone, install the ReverseTethering NoRoot app. One usually uses Google Play to do that.
  5. Plug your phone with the USB cable. Start the app and connect to the server.
  6. That’s it. You can now use the newly established internet connection.

If you want to change the color of a Drawable Shape in Android Studio Dynamically, this is a short tutorial that will help you do that.

  1. Create a New Project
  2. Name it however you want and choose an appropriate directory:
  3. Chose the target Android Device. I chose Android 4.03, IceCreamSandwich:
  4. Let it be an Empty Activity Based Project
  5. First we will create the shape. In order to do that, expand the “app” folder, then go to the “res”  and right click on the “drawable”. Select New->Drawable resource file, like in the screen capture bellow.
  6. Name the resource file. I choose “myshape” and click OK.
  7. Go to the newly created myshape.xml file. We are going to edit it because we want to make a new shape we will be using in our project. The file looks like this:Modify the code of this file like this:
    <?xml version="1.0" encoding="utf-8"?>
    <shape android:shape="rectangle" xmlns:android="">
        <stroke android:width="5pt" android:color="@android:color/holo_blue_dark" />
        <solid android:color="#333" />

    What this code does is effectively creates a rectangle with a solid color having a stroke of 5pt of holo blue color.

  8. Once we have our myshape.xml code in place, it’s time to work on the activity_main.xml. By default, if you are using the latest Android Studio version, which is 2.3 as of writing this post, you will have the Constraint Layout already set up for you.
    What we want to do for this example is add one EditText field, and 2 Buttons. With the EditText we are going to set its background  as our shape – myshape. The 2 buttons are going to serve to change the color of the background at runtime. Here’s the code of activity_main.xml.:

    <?xml version="1.0" encoding="utf-8"?>
    < xmlns:android=""
            android:text="Hello World!"
            app:layout_constraintTop_toTopOf="parent" />
            tools:layout_editor_absoluteX="8dp" />
            tools:layout_editor_absoluteX="0dp" />
            tools:layout_editor_absoluteX="0dp" />
  9. Next we go to the third file we have to change: Here’s the entire code:
    package me.butka.but.drawablecolor;
    import android.os.Bundle;
    import android.view.View;
    import android.widget.Button;
    import android.widget.EditText;
    public class MainActivity extends AppCompatActivity {
        private EditText edit;
        private Button blue_button;
        private Button red_button;
        protected void onCreate(Bundle savedInstanceState) {
            edit = (EditText) findViewById(;
            blue_button  = (Button) findViewById(;
            red_button  = (Button) findViewById(;
            blue_button.setOnClickListener(new View.OnClickListener() {
                public void onClick(View v) {
                    GradientDrawable gradientDrawable = (GradientDrawable) edit.getBackground().mutate();
            red_button.setOnClickListener(new View.OnClickListener() {
                public void onClick(View v) {
                    GradientDrawable gradientDrawable = (GradientDrawable) edit.getBackground().mutate();

    What we have here is we have defined 2 OnClickListeners for the 2 buttons we defined earlier that set the color of the EditText field to Blue or Red.

  10. That’s it. Now we can hit “Run” and test the code in some of the available Virtual Devices, like this.
  11. It should look something like this, depending on your Virtual Device:

Hope you like this, and thanks for following.

References: Based on this video tutorial.