Skip to content

Instantly share code, notes, and snippets.

View nasrabadiAM's full-sized avatar

Ali Nasrabadi nasrabadiAM

View GitHub Profile
//add (( android:autoLink="web" )) to your textView attrs and it's automatically clickable all your links
<TextView
android:id="@+id/textView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:autoLink="all"
android:text="@string/text_with_link"
/>
@nasrabadiAM
nasrabadiAM / permissions.txt
Created November 22, 2017 09:44 — forked from Arinerron/permissions.txt
A list of all Android permissions...
android.permission.ACCESS_ALL_DOWNLOADS
android.permission.ACCESS_BLUETOOTH_SHARE
android.permission.ACCESS_CACHE_FILESYSTEM
android.permission.ACCESS_CHECKIN_PROPERTIES
android.permission.ACCESS_CONTENT_PROVIDERS_EXTERNALLY
android.permission.ACCESS_DOWNLOAD_MANAGER
android.permission.ACCESS_DOWNLOAD_MANAGER_ADVANCED
android.permission.ACCESS_DRM_CERTIFICATES
android.permission.ACCESS_EPHEMERAL_APPS
android.permission.ACCESS_FM_RADIO
org.gradle.jvmargs=-Xmx8192M
org.gradle.daemon=true
org.gradle.parallel=true
org.gradle.configureondemand=true
org.gradle.caching=true

Set Global PATH variable in Mac OS X


With following steps we can add a variable directory to Mac Os X PATH permanently, so it will be there for always.

Instructions to add PATH Variable Globally


First, Lets find out your current PATH value.

To do that, Within the terminal, Fire this command:

@nasrabadiAM
nasrabadiAM / MultipleDevicesOverTCP.md
Last active April 21, 2018 05:47 — forked from teocci/MultipleDevicesOverTCP.md
How to connect multiple Android devices with ADB over TCP

How to connect multiple Android devices with ADB over TCP

From your device, if it is rooted

you can enable ADB over Wi-Fi from the device with the commands:

su
setprop service.adb.tcp.port 5555
stop adbd
start adbd

replace enums with StringDef

Enum Sample:

   public enum WeekDays {
        SUNDAY, MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY
    }
@nasrabadiAM
nasrabadiAM / final in java.md
Created February 13, 2018 16:12
what final keyword do in java

what final keyword do in java and how to use it

final classes

any class that defines final will not be subclassed.

you can not extends any class from a final class.

final methods

what static keyword do in java and how to use it

static classes

you can not define static classes as general but subclasses can be static as a class member.

static methods

@nasrabadiAM
nasrabadiAM / close software keyboard - android.java
Created February 18, 2018 16:40
close software keyboard - android
View view = activity.getCurrentFocus();
if (view != null) {
InputMethodManager inputMethodManager = (InputMethodManager) activity.getSystemService(Context.INPUT_METHOD_SERVICE);
inputMethodManager.hideSoftInputFromWindow(view.getWindowToken(), 0);
}
@nasrabadiAM
nasrabadiAM / connect device over tcp.md
Created March 14, 2018 07:18
connect android device to adb over tcp wifi

connect to my device over tcp .bat file

first of all connect to the same local network that your pc is connected. then get your phone ip in your local network and create a .bat file with the following commands. start that bat file to connect to your phonr over tcp with wifi. now you can unplug your device cable. no cable needed any more.