Archive for the ‘Android’ Category

Gradle: resolving dependencies :app:_debugCompile too long.

July 20th, 2016 No comments

It’s really a long day because this problem make me mad with my computer.

Holyshit! why i have to wait too long with this message below?


After browsing somewhere at StackOverFlow, I finally found a solution here:


Categories: Android Tags:

TextView: How to make it scrollable without using ScrollView?

July 18th, 2016 No comments

You don’t need to use ScrollView. How to do that?

Step 1. From XML, add some properties for TextView, like this:

Step 2. In your code: yourTextView.setMovementMethod(new ScrollingMovementMethod());


Categories: Android Tags:

For TextView android

July 11th, 2016 No comments


Categories: Android, Java Tags: ,

Debugging Android application via a wireless connection?

June 21st, 2016 5 comments

Sometime you don’t want to use USB cable (directly connect your device to computer) or you have problems with USB ports on your computer or something else.

Today, i finally found a really good solution to do this, it’s very simple. Read carefully all following steps below:

Step 1: Connect your device to computer via USB cable, make sure that “debugging mode” is activated. android device and computer must be connected to the same WIFI network (if you don’t know how to enable debugging mode,please search by google with keyword: “enable debugging mode in android”).
Step 2: Open CMD and run this command: adb tcpip 5555
Step 3: Run this command: adb shell netcfg to get your android device’s IP address.
Step 4: Continue to run command adb connect <IP_ADDRESS>:5555 and wait for a couple of seconds and then disconnect USB connection. Now you can properly run application in Android studio/eclipse, your device’s name still listed on the device choosing dialog, that really amazing!
When done, run this command: adb -s <IP_ADDRESS>:5555 usb to rollback to the previous setting (debugging via USB directly option).


Huy N

Categories: Android Tags: ,

How to change screen orientation programmatically?

June 20th, 2016 No comments

[code lang=”java”]
&lt;br /&gt;Configuration config = getResources().getConfiguration(); fragmentTransaction = getFragmentManager().beginTransaction();

switch(config.orientation) {
// Device is now in landscape mode.
MyLandscapeFragment fragment = new MyLandscapeFragment();
fragmentTransaction.replace(, fragment);
// Device is now in portrait mode.
MyPortraitFragment fragment = new MyPortraitFragment();
fragmentTransaction.replace(, fragment);


finally go to android manifest and make some changes for specified activity:


Categories: Android Tags: