Skip to content

Instantly share code, notes, and snippets.

@dineshmm23
dineshmm23 / getPackageName.sh
Created January 7, 2021 10:00 — forked from benvium/getPackageName.sh
Script to extract the android package id (app id) from an android apk file, and another to uninstall an app when you have the apk handy.
# extract the android package id from a built apk file
# usage ./getPackageName.sh <path-to-apk>
line=`aapt dump badging "$1" | grep package:\ name`
# above returns:
# package: name='com.calvium.myapp' versionCode='1' versionName='1.0'
if [[ $line =~ name=\'(.+)\'\ versionCode ]]; then
echo ${BASH_REMATCH[1]}
else
echo "Failed to find package name"
@dineshmm23
dineshmm23 / readme-template.md
Created December 10, 2020 08:02 — forked from martensonbj/readme-template.md
Personal project README template

Project Name & Pitch

Example:

TweetWorld

An application used to filter data form Twitter based on user preference, built with React, Redux, JavaScript, and CSS.

Project Status

(only necessary if incomplete)

@dineshmm23
dineshmm23 / android-select-device
Created July 6, 2020 10:46 — forked from dtmilano/android-select-device
Script to select one connected device or emulator when running adb
#! /bin/bash
#=====================================================================
# Selects an android device
# Copyright (C) 2012-2013 Diego Torres Milano. All rights reserved.
#
# See:
# - http://dtmilano.blogspot.ca/2013/01/android-select-device.html
# - http://dtmilano.blogspot.ca/2012/03/selecting-adb-device.html
# for details on usage.
#=====================================================================
@dineshmm23
dineshmm23 / get_html_file.js
Created May 26, 2020 16:52 — forked from gengns/get_html_file.js
Get a local html file to insert into your Cordova Single Page Application
/**
Get local html files (views/widgets) to insert into your SPA
@param path ex:
path = 'file:///android_asset/www/view/page.html'
@param success
@param failure
*/
function get_html_file(path, success, failure) {
const xhr = new XMLHttpRequest()
@dineshmm23
dineshmm23 / DashedLine.java
Created August 23, 2019 12:09
Dashed and Dotted Line XML class
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.DashPathEffect;
import android.graphics.Paint;
import android.graphics.Path;
import android.util.AttributeSet;
import android.util.DisplayMetrics;
import android.util.TypedValue;
@dineshmm23
dineshmm23 / DatabaseService.txt
Created August 12, 2019 06:43
FlexibleAdapter
public void createExpandableSectionsDatabaseTest(int size) {
databaseType = DatabaseType.EXPANDABLE_SECTIONS;
mItems.clear();
for (int i = 0; i < size; i++) {
mItems.add(newExpandableSectionItemTest(i + 1));//With expansion level 0
}
}
public static ExpandableHeaderItemTest newExpandableSectionItemTest(int i) {
@dineshmm23
dineshmm23 / adb-wifi-connect.bat
Created June 11, 2019 08:59
Initilisation of Variables. Put your defualts in here. Change enableSetVariablesWarning to anything else to disable warning
@echo off
:: Initilisation of Variables.. Put your defualts in here
:: Change enableSetVariablesWarning to anything else to
:: disable warning
set defaultIp="192.168.10.104"
set adbLoc="D:\Android_sdk\sdk\platform-tools"
set enableSetVariablesWarning="true"
set askForIP="false"
@dineshmm23
dineshmm23 / React native Clear Cache
Created May 28, 2019 11:01
Clearing the cache for each os
</b>mac-android && ios</b>
watchman watch-del-all && rm yarn.lock && rm -rf node_modules && rm -rf $TMPDIR/metro-* && rm -rf $TMPDIR/haste-map-* && yarn
class LongToastMessageShower implements MessageShower{
private Toast toast;
public LongToastMessageShower(Context appContext){
this.toast = Toast.makeText(appContext,"",Toast.LENGTH_LONG);
}
@Override
public void showMessage(String message){
toast.cancel();
@dineshmm23
dineshmm23 / RoundedCornersBackgroundSpan.java
Created September 3, 2018 10:44
Alternative version spannable
package com.entriver.fieldpro.utils;
/**
* Created by fieldPro on 9/3/2018.
*/
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.RectF;
import android.os.Build;