Skip to content

Instantly share code, notes, and snippets.

View abbasalim's full-sized avatar
👨‍💻
Programing

Abbasali abbasalim

👨‍💻
Programing
View GitHub Profile
# In AppDelegate:
# This is to make sure that it only happens on the first launch
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
let defaults = UserDefaults.standard
let isPreloaded = defaults.bool(forKey: "isPreloaded")
if !isPreloaded {
@mrk-han
mrk-han / emulator-install-using-avdmanager.md
Last active November 7, 2024 04:51
Installing and creating Emulators with AVDMANAGER (For Continuous Integration Server or Local Use)

Install and Create Emulators using AVDMANAGER and SDKMANAGER

TL;DR

For an emulator that mimics a Pixel 5 Device with Google APIs and ARM architecture (for an M1/M2 Macbook):

  1. List All System Images Available for Download: sdkmanager --list | grep system-images

  2. Download Image: sdkmanager --install "system-images;android-30;google_atd;arm64-v8a"

@nikzad-avasam
nikzad-avasam / JsonArrayRequestUtf8.JAVA
Last active April 27, 2024 17:45
Use this class instead JsonArrayRequest OR JsonObjectRequest in Volley Library for support UTF-8 Languages Like Persian ( FARSI )
/**
* Created by Sam Nikzad on 5/27/2016.
*/
public class JsonArrayRequestUtf8 extends JsonArrayRequest {
public JsonArrayRequestUtf8(String url, Response.Listener<JSONArray> listener, Response.ErrorListener errorListener) {
super(url, listener, errorListener);
}
@Override
protected Response<JSONArray> parseNetworkResponse(NetworkResponse response) {
@TWiStErRob
TWiStErRob / SquareFrameLayout.java
Created September 30, 2015 23:33
Make GridView or GridLayoutManager items square.
package net.twisterrob.android.view;
import android.content.Context;
import android.util.AttributeSet;
import android.widget.FrameLayout;
public class SquareFrameLayout extends FrameLayout {
public SquareFrameLayout(Context context) {
super(context);
}