Skip to content

Instantly share code, notes, and snippets.

View dharmakshetri's full-sized avatar

Dharma Kshetri dharmakshetri

View GitHub Profile
@dharmakshetri
dharmakshetri / AndroidManifest.xml
Created October 14, 2019 14:15 — forked from BrandonSmith/AndroidManifest.xml
Quick example of how to schedule a notification in the future using AlarmManager
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.cards.notification">
<uses-sdk
android:minSdkVersion="17"
android:targetSdkVersion="17" />
<application
android:allowBackup="true"
@dharmakshetri
dharmakshetri / TLSSocketFactory.java
Created March 19, 2019 14:04 — forked from fkrauthan/TLSSocketFactory.java
Custom SSLSocketFactory Implementation to enable tls 1.1 and tls 1.2 for android 4.1 (16+)
package net.cogindo.ssl;
import java.io.IOException;
import java.net.InetAddress;
import java.net.Socket;
import java.net.UnknownHostException;
import java.security.KeyManagementException;
import java.security.NoSuchAlgorithmException;
import javax.net.ssl.SSLContext;
@dharmakshetri
dharmakshetri / soccer.json
Last active February 15, 2018 18:24
soccer json data
{
"soccer": {
"clubs": [
{
"clubprofile": {
"clubName": "Barcelona"
},
"asia": [
<?xml version="1.0" encoding="utf-8"?>
<resources>
<array name="autosize_text_sizes">
<item>10sp</item>
<item>12sp</item>
<item>20sp</item>
<item>40sp</item>
<item>100sp</item>
</array>
</resources>
class MainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
// Autosizing from programmatically
//configure uniform autosize
textview.setAutoSizeTextTypeWithDefaults(TextView.AUTO_SIZE_TEXT_TYPE_UNIFORM)
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="co.prandroid.autosizingtextview.MainActivity">
<TextView
android:id="@+id/textview"
@dharmakshetri
dharmakshetri / SecondActivity.kt
Created September 21, 2017 06:06
second activity of kotlin file
package co.prandroid.robolectricexample
import android.content.Intent
import android.support.v7.app.AppCompatActivity
import android.os.Bundle
import android.view.View
import co.prandroid.roboelectrickotlinexample.R
class SecondActivity : AppCompatActivity() {
@dharmakshetri
dharmakshetri / MainActivity.kt
Created September 21, 2017 06:06
Main Activity kotlin file
package co.prandroid.robolectricexample
import android.content.Intent
import android.support.v7.app.AppCompatActivity
import android.os.Bundle
import android.view.View
import co.prandroid.roboelectrickotlinexample.R
class MainActivity : AppCompatActivity() {
@dharmakshetri
dharmakshetri / ExampleUnitTest.kt
Created September 21, 2017 06:04
robolectric test file
package co.prandroid.roboelectrickotlinexample
import android.content.Intent
import android.widget.Button
import android.widget.TextView
import co.prandroid.robolectricexample.MainActivity
import co.prandroid.robolectricexample.SecondActivity
import org.junit.Test
@dharmakshetri
dharmakshetri / Urls.kt
Last active September 15, 2017 19:16
source file iframe
class Urls {
companion object {
val YOUTUBE_URL="<iframe width=\"560\" height=\"315\" src=\"https://www.youtube.com/embed/kJQP7kiw5Fk\" frameborder=\"0\" allowfullscreen></iframe>"
val SOCCER_URL="<iframe src=\"http://www.Genti.Stream/hd/hd1.php\" width=\"320\" height=\"400\" frameborder=\"0\" scrolling=\"no\" allowfullscreen</iframe>"
val CRICKET_URL="<iframe frameborder=\"0\" marginheight=\"0\" marginwidth=\"0\" height=\"490\" src=\"http://cricbox.net/embed/star3img.php\" name=\"iframe_a\" scrolling=\"no\" width=\"620\" frameborder=\"0\" allowfullscreen>Your Browser Do not Support Iframe</iframe>"
val GRAPH_URL= "<iframe width=\"450\" height=\"260\" style=\"border: 1px solid #cccccc;\" src=\"http://api.thingspeak.com/channels/31592/charts/1?width=450&height=260&results=60&dynamic=true\" ></iframe>"
}
}