Skip to content

Instantly share code, notes, and snippets.

View ber4444's full-sized avatar

Gábor Berényi ber4444

View GitHub Profile
@ber4444
ber4444 / ConnectivityCheck.kt
Created October 4, 2021 18:56
check network connectivity on android
fun Context.internetAvailable(): Boolean {
val connectivityManager = this.getSystemService(CONNECTIVITY_SERVICE) as ConnectivityManager
return connectivityManager.getNetworkCapabilities(connectivityManager.activeNetwork)?.hasCapability(NET_CAPABILITY_INTERNET) == true
}
#!/usr/bin/env python
from TwitterAPI import TwitterAPI
api = TwitterAPI( \
consumer_key='xxx', \
consumer_secret='xxx', \
access_token_key='xxx', \
access_token_secret='xxx' \
)
apply plugin: 'com.android.application'
repositories {
maven {
name "Fyber's maven repo"
url "https://fyber.bintray.com/maven"
}
maven {
name "ironSource's maven repo"
url "https://dl.bintray.com/ironsource-mobile/android-sdk"
@ber4444
ber4444 / LayarPlayer.java
Created September 15, 2011 14:48
Usage of LayarPlayer library (SDK) for BlackBerry 7 -- how to add augmented reality to your app
/**
* Copyright 2011 Layar BV. All rights reserved.
* Support: http://devsupport.layar.com
* By implementing the LayarPlayer in your application, you agree to the Terms and Conditions
* described in the Layar_Software_Development_Kit_License_Agreement.pdf file which can be found
* in the LayarPlayer SDK zip file.
*/
package com.test.ARdemo;
import java.util.Hashtable;