Skip to content

Instantly share code, notes, and snippets.

View culjo's full-sized avatar

Lekan Oladee culjo

View GitHub Profile
@culjo
culjo / NetworkCall.java
Created January 4, 2018 02:16
Fast Android Networking Network Call Handler
import android.content.Context;
import android.util.Log;
import android.widget.Toast;
import com.androidnetworking.AndroidNetworking;
import com.androidnetworking.common.Priority;
import com.androidnetworking.error.ANError;
import com.androidnetworking.interceptors.HttpLoggingInterceptor;
import com.androidnetworking.interfaces.JSONArrayRequestListener;
import com.androidnetworking.interfaces.JSONObjectRequestListener;
@culjo
culjo / README.md
Created February 14, 2018 23:54 — forked from lopspower/README.md
How to Analyze & Manage Memory on Android Like a Boss

Analyze & Manage Memory on Android Like a Boss

This Blog is all about memory management in Android. It provides information about how you can analyze & reduce memory usage while developing an Android app.

Memory management is a complex field of computer science and there are many techniques being developed to make it more efficient. This guide is designed to introduce you to some of the basic memory management issues that programmers face.

Memory Management in Android

Android is a Linux based operating system. It uses native open source C libraries which power Linux machines. All the basic operating system operations like I/O, memory management and so on are handled by the Linux kernel. Like Java and .NET, Android uses its own run time and virtual machine to manage application memory. Unlike either of these frameworks, the Android run time also manages the lifetime processes. Each Android application runs in a separate process within its own Dalvik instance, relinquishing all responsibility for memo

@culjo
culjo / DistanceCalculator.java
Created February 20, 2018 13:58 — forked from danielgomezrico/DistanceCalculator.java
Java / Android - calculate the distance between two coordinates with great circle formula.
import static java.lang.Math.acos;
import static java.lang.Math.cos;
import static java.lang.Math.sin;
/**
* Calculate distance between coordinates.
*/
public class DistanceCalculator {
static double PI_RAD = Math.PI / 180.0;
@culjo
culjo / MainActivity.java
Created June 3, 2018 23:43 — forked from anandwana001/MainActivity.java
Implementing Bottom Navigation Bar in your Android App with more than 3 items
public class MainActivity extends AppCompatActivity {
@BindView(R.id.navigation)
BottomNavigationView navigation;
@BindView(R.id.toolbar)
Toolbar toolbar;
private int saveState;
private BottomNavigationView.OnNavigationItemSelectedListener mOnNavigationItemSelectedListener
VStack {
Image("logo")
.resizable()
.aspectRatio(contentMode: ContentMode.fit)
.frame(width: 74.0, height: 74.0)
.padding(Edge.Set.bottom, 20)
Text("Login").bold().font(.title)
Text("Explore the world of Swift UI")
@culjo
culjo / tuts-swiftlogin-2.swift
Created June 27, 2019 02:02
A the second snippets from the swift login tutorial
Image("logo")
.resizable() // make the image resizable
.aspectRatio(contentMode: ContentMode.fit)
.frame(width: 74.0, height: 74.0) // constraints the image to a specified width and height
.padding(Edge.Set.bottom, 20) // Adds a 20 space padding to the bottom of the image
Text("Login").bold().font(.title) // text with bold and title font
TextField(.constant(""), placeholder: Text("Email"))
.padding()
.background(Color("flash-white"))
.cornerRadius(4.0)
.padding(EdgeInsets(top: 0, leading: 0, bottom: 15, trailing: 0))
SecureField(.constant(""), placeholder: Text("Password"))
.padding()
.background(Color("flash-white"))
.cornerRadius(4.0)
.padding(.bottom, 10)
Button(action: submit) {
HStack(alignment: .center) {
Spacer()
Text("Login").color(Color.white).bold()
Spacer()
}
}.padding().background(Color.green).cornerRadius(4.0)
//.. remaining body of view
@culjo
culjo / tuts-swiftlogin-contentview.swift
Last active July 15, 2020 00:30
A SwiftUI login screen
import SwiftUI
struct ContentView : View {
@EnvironmentObject var loginViewModel: LoginViewModel
@State var counter: Int = 0
var body: some View {
VStack() {