This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | 1. Replace character(s) other than specified | |
| String name = "android"; | |
| name = name.replaceAll("[^an]", ""); | |
| Output:: "an" | |
| 2. Separate word with space from String | |
| String name = "AndroidIsOpenSource"; | |
| name = name.replaceAll("(.)([A-Z])", "$1 $2"); | |
| Output:: "Android Is Open Source" | |
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | 1. If you need to disable all transitive dependencies and apply by yourself | |
| configurations.all { | |
| transitive = false | |
| } | |
| 2. How check dependencies tree (Terminal in AndroidStudio) | |
| gradlew/gradlew.bat -q dependencies app:dependencies --configuration compile/testCompile/androidTestCompile | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | 1. Download Jenkins from https://jenkins.io/download/ | |
| 2. Using CMD, run this command "java -jar jenkins.war". This will create .jenkins folder in C:\Users\(USER_NAME)\.jenkins | |
| - Make sure you have installed JDK and set path | |
| 3. Open Jenkins using http://localhost:8080/ | |
| 4. Go to "Manage Jenkins" | |
| 5. Go to "Configure Global Security" | |
| - Enable security | |
| - Security Realm -> Jenkins’ own user database (+ Allow users to sign up) | |
| - Authorization -> Matrix-based security | |
| - Add new User and check all checkboxes | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | 1. Build your project | |
| 2. Check "Run" console to see Methods count | |
| Total methods in app-debug.apk: 23265 (35.50% used) | |
| Total fields in app-debug.apk: 11160 (17.03% used) | |
| Methods remaining in app-debug.apk: 42270 | |
| Fields remaining in app-debug.apk: 54375 | |
| 3. To see graph | |
| app/build/outputs/dexcount | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | 1. Add classpath 'com.squareup.wire:wire-compiler:2.2.0' in project (build.gradle) | |
| 2. Add dependency compile 'com.squareup.wire:wire-runtime:2.2.0' in app (build.gradle) | |
| 3. Sync project | |
| 4. Add "wire-compiler-2.2.0-jar-with-dependencies.jar" to your app folder | |
| 5. Create src\main\proto\nahba folder | |
| 6. Create .proto files as dinosaur.proto and period.proto | |
| 7. In Terminal, from app folder run below command | |
| java -jar wire-compiler-2.2.0-jar-with-dependencies.jar --proto_path=src/main/proto --java_out=src/main/java | |
| 8. This will create all required Java Classes | |
| 9. Access in your activity/fragment as below | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | Build Project Using API 23 | |
| Manifest Permission: | |
| <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/> | |
| WindowManager windowManager = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE); | |
| WindowManager.LayoutParams windowParams = new WindowManager.LayoutParams(YOUR_DESIRED_WIDTH, YOUR_DESIRED_HEIGHT, | |
| WindowManager.LayoutParams.TYPE_SYSTEM_ALERT, | |
| WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE | WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL, | |
| PixelFormat.TRANSLUCENT); | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | 1. Disable components update on first start | |
| disable.android.first.run=true -> bin/idea.properties | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | Put this gradle.properties in your /users/.gradle folder | |
| /home/<username>/.gradle/ (Linux) | |
| /Users/<username>/.gradle/ (Mac) | |
| C:\Users\<username>\.gradle (Windows) | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | $adb tcpip 5555 | |
| $adb shell netcfg | |
| $adb connect <DEVICE_IP_ADDRESS>:5555 | |
| $adb -s <DEVICE_IP_ADDRESS>:5555 install (ApplicationName).apk | |
| $adb -s <DEVICE_IP_ADDRESS>:5555 usb (Back To USB Debugging) !important | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | Only commit following folders/files when commiting Gradle based project. | |
| Folders: | |
| ======= | |
| 1) app -> src, build.gradle, proguard-rules.pro | |
| 2) gradle -> wrapper -> gradle-wrapper (both) | |
| Files: | |
| ===== | |
| 1) build.gradle | 
NewerOlder