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 / 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 / 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.
push the code
git branch
git checkout branchname
git status
git log -n1
git add class name
git commit
git push origin HEAD:refs/for/q-common
@iniyan455
iniyan455 / deeplink adb
Created May 12, 2021 11:16
Deeplink Trigger from adb command
@iniyan455
iniyan455 / git tag
Created May 12, 2021 11:15
Git Tag
Git Tag
There are two tag
1.Lightweight Tag
2.Annotated Tag
Lightweight Tag is used for requires only a quick and easy tag command
git tag v1.o
@iniyan455
iniyan455 / Ssh
Created May 12, 2021 11:14
SSH integration in Android
How to add ssh in system and add in github
1. ssh-add -l
2.ssh-keygen -t rsa -b 4096 -C "joe@example.com"
3.Press Enter to accept the default file location
4.Enter a secure passphrase
5.cat .ssh/id_rsa.pub
Github
Settings -Select SSH and GPG keys - Click New SSH key -Enter a title in the field -Paste your public key into the Key field -Click Add SSH key
@iniyan455
iniyan455 / git crlf
Last active January 22, 2021 11:03
warning: CRLF will be replaced by LF in gradlew.bat
In Unix systems the end of a line is represented with a line feed (LF). In windows a line is represented with a carriage return (CR) and a line feed (LF) thus (CRLF). when you get code from git that was uploaded from a unix system they will only have an LF.
If you are a single developer working on a windows machine, and you don't care that git automatically replaces LFs to CRLFs, you can turn this warning off by typing the following in the git command line
git config core.autocrlf true
rm -f ./.git/index.lock
@iniyan455
iniyan455 / gist:2be6c17292be31a337fed071a6419c0c
Created December 12, 2020 12:54
About Proguard Mapping File upload to particular version while releasing apk in playstore
PROGUARD
Generally ProGuard is a tool to help minify, obfuscate, and optimize your code.
It is not only especially useful for reducing the overall size of your Android application as well as removing unused classes and methods that contribute towards the intrinsic 64k method limit of Android applications. Because of the latter issue, ProGuard is often recommended to be used both in development and production especially for larger applications.
ProGuard can be enabled by using the minifyEnabled option for any build type.
If you intend to use it for production, it is highly recommended you also enable it on your development.
https://miro.medium.com/max/2640/1*J-9cAvm8kSn001rXGDtwxg.png
Generally retracing this kind of error log have two ways.Lets discuss one by one
Get the mapping.txt file and retrace the logs using proguardgui
@iniyan455
iniyan455 / gist:92a04a87caf09ffc18f4eb53ccacf4a1
Created October 15, 2020 05:02
Context instead of Activity
public Activity getActivity(Context context)
{
if (context == null)
{
return null;
}
else if (context instanceof ContextWrapper)
{
if (context instanceof Activity)
{
@iniyan455
iniyan455 / DeadSystemException throws from os
Last active September 17, 2020 16:42
deadsystemexception-start-service-android
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.