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
| This crash is present on: | |
| all Samsung devices 7.0 | |
| all Nexus devices on 7.1.2 | |
| When the device is being restarted, you cannot run an app. Any app, not just yours but any given app cannot run when the device is restarting. AFAIK it occurs when you try to do something when the system crashes. | |
| Meaning if the system crashes and as it restarts your app starts a service or does something you get that error. |
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
| And now you just need to call the method isHacked from your onCreate method in your initial Activity to check that your application was renamed or relocated. | |
| public boolean isHacked(Context context, String myPackageName, String google, String amazon) | |
| { | |
| //Renamed? | |
| if (context.getPackageName().compareTo(myPackageName) != 0) { | |
| return true; // BOOM! | |
| } | |
| //Relocated? |
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
| File and code templates option in android studio to automate creation of recyclerview adapter. | |
| AndroidStudio -> Preference->Editor->File and Code Template | |
| Click plus icon at the top then you will see a panel with name, extension and code template editor. All you need to do is enter the template name, mention the extension(kt, java or xml) and paste the above template here and click OK. It’s done, all you need to do is just navigate to the package where you want to create the adapter and right click on it and select then you should see a file with name you mentioned while creating file template. | |
| Feel free to comment if there any suggestions or improvements | |
| #if (${PACKAGE_NAME} && ${PACKAGE_NAME} != "")package ${PACKAGE_NAME}#end |
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
| #About Security | |
| Absolute security does not exist. Security is a set of measures, being piled up and combined, trying to slow down the inevitable. | |
| https://medium.com/google-developer-experts/a-follow-up-on-how-to-store-tokens-securely-in-android-e84ac5f15f17 | |
| NDK Decode :- | |
| String key1 = new String(Base64.decode(getNativeKey1(),Base64.DEFAULT)); | |
| String key2 = new String(Base64.decode(getNativeKey2(),Base64.DEFAULT)); | |
| https://medium.com/@abhi007tyagi/storing-api-keys-using-android-ndk-6abb0adcadad | |
| https://medium.com/@himanshusoni501/safest-way-to-secure-your-app-server-credentials-7894fb4f4fe4 |
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
| If you have this in your gradle : | |
| compileOptions { | |
| sourceCompatibility JavaVersion.VERSION_1_8 | |
| targetCompatibility JavaVersion.VERSION_1_8 | |
| } | |
| then you are telling android to use java 8. |
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
| Methods to store in Internal Storage(GT): | |
| Both these methods are present in Context class | |
| File getDir (String name, int mode) | |
| File getFilesDir () | |
| Methods to store in Primary External Storage i.e. Internal Storage(UT): |
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
| https://console.developers.google.com/apis/credentials?project=api-5298280870467023733-962021 | |
| https://proandroiddev.com/how-to-automate-google-play-store-releases-c4c2a4b19435 | |
| https://unicorn-utterances.com/posts/travis-ci-for-android/#Part-B-Dummy-files | |
| https://proandroiddev.com/change-language-programmatically-at-runtime-on-android-5e6bc15c758 | |
| $ git tag -a v1.4 -m "my version 1.4" | |
| $ git tag | |
| Useful Links | |
| ./gradlew publishApkRelease |
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
| Work Manager | |
| WorkManager is an API that makes it easy to schedule deferrable, asynchronous tasks that are expected to run even if the app exits or the device restarts. The WorkManager API is a suitable and recommended replacement for all previous Android background scheduling APIs | |
| Device support from 14 -22 it will work on alarm manager with broadcast to process scheduling and GCM NetworkManager | |
| Device above 23 + all uses JobSchedular | |
| usecases : | |
| Dynamic Feature modules and clean architecture | |
| Backup chat like whatsapp after a hours or 1 in a day | |
| update news in any news app - phone in charge or connect with constraint and executes the task and impl |
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
| https://blog.mindorks.com/understanding-livedata-in-android | |
| LiveData considers an observer, which is represented by the Observer class, to be in an active state if its lifecycle is in the STARTED or RESUMED state. LiveData only notifies active observers about updates. Inactive observers registered to watch LiveData objects aren't notified about changes. | |
| Features | |
| Ensures your UI matches your data state | |
| No memory leaks | |
| No crashes due to stopped activities | |
| No more manual lifecycle handling |
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
| ProGuard is a generic optimizer for Java bytecode. | |
| DexGuard is a specialized tool for the protection of Android applications. | |
| ProGuard is a versatile optimizer for Java bytecode. It enables you to shrink, optimize and obfuscate desktop applications, embedded applications and mobile applications (Android) | |
| DexGuard, on the other hand, is specifically designed to protect and optimize Android applications. The multilayered protection DexGuard provides is adapted to the distributed and quickly evolving environment in which mobile applications are used. In addition, DexGuard offers functionality that helps you to make optimal use of the Android platform. It comes with a tuned configuration for the Android runtime and for common libraries (Google Play Services, Dagger, Realm, SQLCipher etc.) and automatically splits DEX files that exceed the size limits imposed by the format (MultiDex). | |