Skip to content

Instantly share code, notes, and snippets.

View mustafa01ali's full-sized avatar

Mustafa Ali mustafa01ali

View GitHub Profile
@chrisbanes
chrisbanes / CollapsingTitleLayout.java
Last active March 26, 2023 11:58
CollapsingTitleLayout
/*
* Copyright 2014 Chris Banes
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@fredgrott
fredgrott / renameapk
Created December 4, 2014 19:35
rename android app apk
// in your android.applicationVariants.all { variant ->
// or in your android.libraryVariants.all { variant ->
// code block put this:
if (variant.productFlavors[0] == null){
variant.outputs[0].outputFile = new File(variant.outputs[0].outputFile.parent,
project.ext.ourProjectName + "_"
+ variant.buildType.name + "_"
+ android.defaultConfig.versionCode + "_"
+ android.defaultConfig.versionName + ".apk")
}else{
@staltz
staltz / introrx.md
Last active May 17, 2024 07:59
The introduction to Reactive Programming you've been missing
@elsnosrap
elsnosrap / adb-wrapper.sh
Created May 17, 2014 19:19
A useful shell script that wraps Android adb commands when multiple devices or emulators are connected. The script will prompt for a device or emulator to run the command against, if it detects multiple devices / emulators.
#!/bin/bash
# This is a wrapper for adb. If there are multiple devices / emulators, this script will prompt for which device to use
# Then it'll pass whatever commands to that specific device or emulator.
# Run adb devices once, in event adb hasn't been started yet
BLAH=$(adb devices)
# Grab the IDs of all the connected devices / emulators
IDS=($(adb devices | sed '1,1d' | sed '$d' | cut -f 1 | sort))
@scottyab
scottyab / SaferWebViewClient.java
Created May 14, 2014 15:36
Make Webview safer - some of the code based on recommendations in article https://labs.mwrinfosecurity.com/blog/2012/04/23/adventures-with-android-webviews/
/**
* Implements whitelisting on host name
*/
public class SaferWebViewClient extends WebViewClient {
private String[] hostsWhitelist;
public SaferWebViewClient(String hostsWhitelsit){
super();
this.hostsWhitelist = hostsWhitelist;
@swanson
swanson / gist:7dee3f3474e30fe8f15c
Last active January 11, 2024 16:42
Retrofit LocalJsonClient
import android.annotation.SuppressLint;
import android.content.Context;
import android.util.Log;
import retrofit.client.Client;
import retrofit.client.Header;
import retrofit.client.Request;
import retrofit.client.Response;
import retrofit.mime.TypedInput;