Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Dharma Kshetri dharmakshetri

🎯
Focusing
View GitHub Profile
@dharmakshetri
dharmakshetri / AndroidManifest.xml
Created Oct 14, 2019 — forked from BrandonSmith/AndroidManifest.xml
Quick example of how to schedule a notification in the future using AlarmManager
View AndroidManifest.xml
<?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 Mar 19, 2019 — forked from fkrauthan/TLSSocketFactory.java
Custom SSLSocketFactory Implementation to enable tls 1.1 and tls 1.2 for android 4.1 (16+)
View TLSSocketFactory.java
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 Feb 15, 2018
soccer json data
View soccer.json
{
"soccer": {
"clubs": [
{
"clubprofile": {
"clubName": "Barcelona"
},
"asia": [
View arrays.xml
<?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>
View MainActivity.kt
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)
View activity_main.xml
<?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 Sep 21, 2017
second activity of kotlin file
View SecondActivity.kt
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 Sep 21, 2017
Main Activity kotlin file
View MainActivity.kt
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() {
View ExampleUnitTest.kt
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 Sep 15, 2017
source file iframe
View Urls.kt
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>"
}
}
You can’t perform that action at this time.