This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.*; | |
public class Sample{ | |
public static void main(String[] args){ | |
System.out.println("Hello world "); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Give Your PackageName Ex:com.companyname.projectname; | |
package com.pgeek.sample; | |
import android.content.Context; | |
import android.net.ConnectivityManager; | |
import android.net.NetworkInfo; | |
public class ConnectionDetector { | |
private Context _context; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class MainActivity extends AppCompatActivity{ | |
SectionsPagerAdapter mSectionsPagerAdapter; | |
static SessioManager session; | |
ViewPager mViewPager; | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
mSectionsPagerAdapter = new SectionsPagerAdapter(getSupportFragmentManager()); | |
// Set up the ViewPager with the sections adapter. | |
mViewPager = (ViewPager) findViewById(R.id.pager); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class AppsListActivity extends Activity { | |
private PackageManager manager; | |
private ArrayList<AppDetail> apps; | |
private ListView list; | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.activity_apps_list); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class LollipopBitmapMemoryCacheParamsSupplier implements Supplier<MemoryCacheParams> { | |
private ActivityManager activityManager; | |
public LollipopBitmapMemoryCacheParamsSupplier(ActivityManager activityManager) { | |
this.activityManager = activityManager; | |
} | |
@Override | |
public MemoryCacheParams get() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
compile 'com.google.code.gson:gson:2.6.2' | |
compile 'com.squareup.retrofit2:retrofit:2.0.2' | |
compile 'com.squareup.retrofit2:converter-gson:2.0.2' | |
public class ApiClient { | |
public static final String BASE_URL = "http://indianvedicschool.com/"; | |
private static Retrofit retrofit = null; | |
public static Retrofit getClient() { | |
if (retrofit==null) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
open class BaseGhattCallback : BluetoothGattCallback() { | |
var mIsDeviceConnected = false | |
internal var mCommandCharacteristic: BluetoothGattCharacteristic? = null | |
open val TAG = BaseGhattCallback::class.java.simpleName | |
private val SUBSCRIBE_CHARACTERISTIC: Int = 0 | |
private val READ_CHARACTERISTIC: Int = 1 | |
private val WRITE_CHARACTERISTIC: Int = 2 | |
fun queueReadDataFromCharacteristic(gatt: BluetoothGatt, characteristic: BluetoothGattCharacteristic) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class LoginActivity : AppCompatActivity() { | |
override fun onCreate(savedInstanceState: Bundle?) { | |
super.onCreate(savedInstanceState) | |
setContentView(R.layout.activity_login) | |
goto_main_screen_button.setOnClickListener { | |
gotoMainScreen() | |
} | |
} | |
private fun gotoMainScreen() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void createOnGlThread() { | |
// 1 texture to hold the video frame. | |
int textures[] = new int[1]; | |
GLES20.glGenTextures(1, textures, 0); | |
mTextureId = textures[0]; | |
int mTextureTarget = GLES11Ext.GL_TEXTURE_EXTERNAL_OES; | |
GLES20.glBindTexture(mTextureTarget, mTextureId); | |
GLES20.glTexParameteri(mTextureTarget, GLES20.GL_TEXTURE_MIN_FILTER, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void update(float[] modelMatrix) { | |
float[] scaleMatrix = new float[16]; | |
Matrix.setIdentityM(scaleMatrix, 0); | |
float SCALE_FACTOR = 1f; | |
scaleMatrix[0] = SCALE_FACTOR; | |
scaleMatrix[5] = SCALE_FACTOR; | |
scaleMatrix[10] = SCALE_FACTOR; | |
Matrix.multiplyMM(this.mModelMatrix, 0, modelMatrix, 0, scaleMatrix, 0); | |
} |
OlderNewer