Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing on the custom tooltip library for android

Ramaraj T jsramraj

🎯
Focusing on the custom tooltip library for android
View GitHub Profile
@jsramraj
jsramraj / git.md
Created Aug 25, 2020
Git CheatSheet
View git.md

List all the tags git tag -l

Delete a tag from the remote git push -d origin 1.0

Delete a tag locally git tag -d 1.0

@jsramraj
jsramraj / adb.md
Last active Apr 26, 2021
ADB Commands
View adb.md

Process Id by app name

adb shell ps | grep appName adb shell pidof com.myCompany.myApp

Logcat by packagename

adb logcat --pid=14029

Tell the adb daemon to use TCP rather than USB

@jsramraj
jsramraj / SQLHelper
Last active Jul 23, 2020
Get Printable sql query from the SQLiteCommand in C#
View SQLHelper
private string ExtractSqlCommandFromCommand(SQLiteCommand cmd)
{
string sql = cmd.CommandText;
bool first = true;
foreach (SQLiteParameter p in cmd.Parameters)
{
string value = ((p.Value == DBNull.Value) ? "null"
: (p.Value is string) ? "'" + p.Value + "'"
: (p.Value is DateTime) ? "'" + ((DateTime)p.Value).ToString("yyyy-MM-dd HH:mm:ss") + "'"
: p.Value.ToString());
@jsramraj
jsramraj / clear_bin.md
Last active Jul 23, 2020
Delete bin and obj folders
View clear_bin.md

Quite often you may need to clear the obj and bin folders in the Mac when you work on a xamarin project.

The following command will do that for you.

It will search for all the folders named obj and bin and delete them.

find . -type d \( -name "obj" -o -name "bin" \) -exec rm -rf {} \;

@jsramraj
jsramraj / intent-command
Created Jul 17, 2020
Send abd broadcast intent from command line
View intent-command
adb shell "am broadcast 'intent:#Intent;action=com.myCompany.myApp.myAction;d.integerParam=1610;S.stringParam=2020-07-16T08:55:54Z;end'"
View Debug android over Wi-Fi
- Connect the device via USB and make sure debugging is working
- Run `adb tcpip 5555` in the terminal. This makes the device to start listening for connections on port 5555
- Look up the device IP address with `adb shell netcfg` or `adb shell ifconfig` with 6.0 and higher
- You can disconnect the USB now
- Type `adb connect <DEVICE_IP_ADDRESS>:5555` in the terminal. This connects to the server we set up on the device on step 2
- Now you have a device over the network with which you can debug as usual.
View self-signed-certificate-with-custom-ca.md

Create Root CA (Done once)

Create Root Key

Attention: this is the key used to sign the certificate requests, anyone holding this can sign certificates on your behalf. So keep it in a safe place!

openssl genrsa -des3 -out rootCA.key 4096
View Android One Plus two crash log
12-23 19:14:35.235: E/SQLiteLog(3133): (11) database corruption at line 53216 of [9491ba7d73]
12-23 19:14:35.235: E/SQLiteLog(3133): (11) statement aborts at 7: [SELECT locale FROM android_metadata UNION SELECT NULL ORDER BY locale DESC LIMIT 1]
12-23 19:14:35.237: E/SQLiteDatabase(3133): Failed to open database '/data/data/com.zanec.dryjanuary/databases/alcochange.sqlite'.
12-23 19:14:35.237: E/SQLiteDatabase(3133): android.database.sqlite.SQLiteException: Failed to change locale for db '/data/data/com.zanec.dryjanuary/databases/alcochange.sqlite' to 'en_US'.
12-23 19:14:35.237: E/SQLiteDatabase(3133): at android.database.sqlite.SQLiteConnection.setLocaleFromConfiguration(SQLiteConnection.java:459)
12-23 19:14:35.237: E/SQLiteDatabase(3133): at android.database.sqlite.SQLiteConnection.open(SQLiteConnection.java:250)
12-23 19:14:35.237: E/SQLiteDatabase(3133): at android.database.sqlite.SQLiteConnection.open(SQLiteConnection.java:203)
12-23 19:14:35.237: E/SQLiteDatabase(3133): at android.database.sqlite
@jsramraj
jsramraj / MyConnection.swift
Last active Oct 22, 2015
Protocols/Delegates in Swift - Sample
View MyConnection.swift
import Foundation
@objc public protocol MyConnectionDelegate {
optional func didStartService(object: String)
optional func didFinishDownload(jsonData: NSData)
optional func didFailedDownload()
}
public class MyConnection {
weak public var delegate: MyConnectionDelegate?
@jsramraj
jsramraj / android_gitignore
Last active May 8, 2020
Gitignore file for Android project that runs in Eclipse
View android_gitignore
#Mac OS files
.DS_Store
*.iml
.gradle
/local.properties
/.idea/caches
/.idea/libraries
/.idea/modules.xml
/.idea/workspace.xml