Skip to content

Instantly share code, notes, and snippets.

View iniyan455's full-sized avatar
🎯
Focusing

Iniyan Murugavel iniyan455

🎯
Focusing
View GitHub Profile
@iniyan455
iniyan455 / Androidx migration
Created June 29, 2020 08:09
Androidx migration issues and Gson vs Moshi upgrade
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.
@iniyan455
iniyan455 / File methods
Created June 29, 2020 08:08
About FileStorage in android
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):
@iniyan455
iniyan455 / publish apk
Created June 29, 2020 08:06
Apk publish automation useful links
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
@iniyan455
iniyan455 / work manager
Last active April 19, 2024 12:15
Work Manager Understanding
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
@iniyan455
iniyan455 / gist:8e90b654391d30e463ca0a9915e950fb
Created June 29, 2020 08:05
LiveData Useful for Understanding
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
@iniyan455
iniyan455 / proguard
Created June 29, 2020 08:04
DEXGUARD VS Proguard
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).
@iniyan455
iniyan455 / ABI
Created June 29, 2020 08:04
Android ABI Understanding
MIPS uses a single syscall instruction for all access to operating system services. The setup for a syscall instruction puts a syscall code into a register. ... They allocate and keep track of the addresses and allow a programmer to use labels instead of addresses in assembly language code.
MIPS (Microprocessor without Interlocked Pipelined Stages) is a reduced instruction set computer (RISC) instruction set architecture (ISA)
A reduced instruction set computer, or RISC (/rɪsk/),
For example, if we are having mips, x86, armeabi, armeabi-v7a, armeabi-v8a, then the .so file will be generated for all the five architectures. So, if the size of one .so file is 5MB then the application size should be 5MB but in reality, it will be of 5*5 = 25MB.
Arm, previously Advanced RISC Machine, originally Acorn RISC Machine, is a family of reduced instruction set computing (RISC) architectures for computer processors, configured for various environments.
@iniyan455
iniyan455 / Android Debug Bridge (adb)
Created June 29, 2020 08:03
Android Debug Bridge (adb) Useful things
Android Debug Bridge (adb) is a versatile command-line tool that lets you communicate with a device. The adb command facilitates a variety of device actions, such as installing and debugging apps, and it provides access to a Unix shell that you can use to run a variety of commands on a device. It is a client-server program that includes three components:
adb is included in the Android SDK Platform-Tools package. You can download this package with the SDK Manager, which installs it at android_sdk/platform-tools/
apkanalyzer -h apk file-size myapk.apk --human-readable
apkanalyzer is included in the Android SDK Tools package and located at android_sdk/tools/bin/apkanalyzer.
dmtracedump
@iniyan455
iniyan455 / wifi device connect
Created June 29, 2020 08:01
Connect wifi device for debugging
https://android.jlelse.eu/wireless-debugging-through-adb-in-android-using-wifi-965f7edd163a
platform tools connect
adb kill-server
adb tcpip 5555
adb devices
adb connect 100.68.163.246:5555
@iniyan455
iniyan455 / redirect intent
Created June 25, 2020 05:00
Intent playstore redirect
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setData(Uri.parse("https://play.google.com/store/apps/details?id=com.example.android"));
intent.setPackage("com.android.vending");
startActivity(intent);