Skip to content

Instantly share code, notes, and snippets.

tslamic

Block or report user

Report or block tslamic

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@tslamic
tslamic / api.md
Last active Apr 11, 2018
Abstracting APIs
View api.md

Abstracting APIs

Assume you're developing an XKCD comic browser on Android. The API offers two endpoints:

There are numerous ways to access the above endpoints: either with libraries such as Retrofit, Volley, Ion, or manually, using e.g. HttpURLConnectionand AsyncTasks, Services, Loaders or other building blocks offered by the SDK.

With constant improvements, best practices and new libraries, it's good to not be tied to a particular implementation

@tslamic
tslamic / DeviceNames.bytecode
Created Aug 22, 2015
Potential implementations for AndroidDeviceNames. See http://tslamic.github.io/creating-android-device-names/ for more info.
View DeviceNames.bytecode
Compiled from "DeviceNames.java"
public final class io.github.tslamic.adntest.DeviceNames {
public static java.lang.String getCurrentDeviceName(java.lang.String);
Code:
0: getstatic #1 // Field android/os/Build.MODEL:Ljava/lang/String;
3: aload_0
4: invokestatic #2 // Method getDeviceName:(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
7: areturn
public static java.lang.String getDeviceName(java.lang.String, java.lang.String);
You can’t perform that action at this time.