Detect when there is an Internet connection available on Android

In this method just current activity receive this event
Add to android Manifest

<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

In your activity, create a Broadcast Receiver:

private BroadcastReceiver networkStateReceiver=new BroadcastReceiver() {
    @Override
    public void onReceive(Context context, Intent intent) {
        ConnectivityManager manager = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
        NetworkInfo ni = manager.getActiveNetworkInfo();
        doSomethingOnNetworkChange(ni);
    }
};
@Override
public void onResume() {
    super.onResume();
    registerReceiver(networkStateReceiver, new IntentFilter(android.net.ConnectivityManager.CONNECTIVITY_ACTION));
}

@Override
public void onPause() {
    unregisterReceiver(networkStateReceiver);
    super.onPause();
}

References
https://stackoverflow.com/questions/6169059/android-event-for-internet-connectivity-state-change

How to root Android Huawei mate 7 gold ( MT7-TL10 )

download TWRP image then go to download folder

adb reboot bootloader

fastboot devices # just for check
fastboot flash recovery twrp_3.0.2_mate7_6.0.img
fastboot reboot

download zip file of SuperSu and put it on root folder of Phone SD card

adb reboot recovery

install zip

References
http://forum.supersu.com/topic/908/huawei-phone-general-guide-huawei-root
http://www.droidviews.com/how-to-boot-android-devices-in-fastboot-download-bootloader-or-recovery-mode/
https://android.gadgethacks.com/how-to/know-your-android-tools-what-is-fastboot-do-you-use-it-0155640/

Word wrap text with break word in Android EditText

class WordBreakTransformationMethod extends ReplacementTransformationMethod
{
    private static WordBreakTransformationMethod instance;

    private WordBreakTransformationMethod() {}

    public static WordBreakTransformationMethod getInstance()
    {
        if (instance == null)
        {
            instance = new WordBreakTransformationMethod();
        }

        return instance;
    }

    private static char[] dash = new char[] {'-', '\u2011'};
    private static char[] space = new char[] {' ', '\u00A0'};

    private static char[] original = new char[] {dash[0], space[0]};
    private static char[] replacement = new char[] {dash[1], space[1]};

    @Override
    protected char[] getOriginal()
    {
        return original;
    }

    @Override
    protected char[] getReplacement()
    {
        return replacement;
    }
}
myEditText.setTransformationMethod(WordBreakTransformationMethod.getInstance());

References
https://stackoverflow.com/questions/22289161/word-wrap-break-word-in-edittext

Remote Debug Java Spring Boot in Intellij IDEA

Create Deployment Profile


Create Debug Configuration

Connect to server via SSH and go to mapped folder and run Spring Boot with –debug-jvm

gradle bootRun --debug-jvm

On Intellij IDEA run remote debug configuration

References
https://stackoverflow.com/questions/39490624/how-to-debug-spring-application-with-gradle
https://stackoverflow.com/questions/975271/remote-debugging-a-java-application
https://jdpgrailsdev.github.io/blog/2014/07/15/spring_boot_remote_debug.html