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. Get Sender Id (And APIKeyFor ServerSide) From Google Console Project | |
| -------------------Using GCMRegistrar---------------------------------- | |
| 2. Add GCM.jar To Your Project | |
| 3. Add Required Permission Into Manifest | |
| <uses-permission android:name="android.permission.INTERNET" /> | |
| <uses-permission android:name="android.permission.WAKE_LOCK" /> | |
| <uses-permission android:name="android.permission.GET_ACCOUNTS" /> | |
| <permission | |
| android:name="(Your_Package).permission.C2D_MESSAGE" |
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
| Add GooglePlayService Library To Your Project | |
| Manifest:: | |
| <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/> | |
| <application ....> | |
| <meta-data | |
| android:name="com.google.android.gms.version" | |
| android:value="@integer/google_play_services_version"/> | |
| </application> |
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
| -------Write To File In Append Mode---------- | |
| String logDirPath = getApplicationContext().getFilesDir().getAbsolutePath() + File.separator + "Logs" | |
| + File.separator + "Log.txt"; | |
| private void writeToFile(String logFilePath, String whatToWrite) { | |
| try { | |
| if(logFilePath != null && logFilePath.trim().length() > 0) { | |
| SimpleDateFormat format = new SimpleDateFormat("EEE dd/MM/yyyy HH:mm:ss", Locale.US); | |
| String passing = format.format(new Date()) + " " + whatToWrite + "\n"; | |
| FileWriter writer = new FileWriter(logFilePath, true);//true FOR APPEND MODE | |
| writer.append(passing); |
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 |
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
| 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
| 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
| 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. 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
| 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 |