Skip to content

Instantly share code, notes, and snippets.

View joyal670's full-sized avatar

Joyal Jose joyal670

View GitHub Profile
Flutter
Flutter create project_name
Code .
jks file
A keystore is a container of certificates, private keys etc. There are specifications of what should be the format of this keystore and the predominant is the #PKCS12. JKS is Java's keystore implementation. There is also BKS etc. These are all keystore types.
FlutterActivity
For android, main activity extends FlutterActivity
/* Declare variables */
private var images: ArrayList<Uri?>? = null
private val PICK_IMAGES_CODE = 0
private lateinit var image_adapter : image_upload_adapter
/* button click */
imagepickBtn.setOnClickListener {
openImageFileChooser()
}
// declare variables
private val PICK_IMAGES_CODE1 = 0
private var file1 : File?=null
// add this libery
implementation 'com.nbsp:materialfilepicker:1.9.1'
// request for permissions
// add this libery
implementation 'com.github.fondesa:kpermissions:3.1.3'
// Adding dependency
def roomVersion = "1.1.1"
implementation "android.arch.persistence.room:runtime:$roomVersion"
kapt "android.arch.persistence.room:compiler:$roomVersion"
// 2: Lifecycle Components
def lifecycleVersion = "1.1.1"
implementation "android.arch.lifecycle:extensions:$lifecycleVersion"
// Room components
// Declare a boolen variable
private var doubleBackToExitPressedOnce = false
// override onBackPress method
override fun onBackPressed() {
if (doubleBackToExitPressedOnce) {
val intent = Intent(this, AuthActivity::class.java)
startActivity(intent)
finish()
// declare variables
FirebaseAuth mAuth;
CallbackManager callbackManager;
FirebaseAuth.AuthStateListener authStateListener;
AccessTokenTracker mAccessTokenTracker;
LoginButton login;
// on button click
mAuth.signOut();
// declare variables
public ProgressDialog progressDialog;
private FirebaseAuth firebaseAuth;
private GoogleSignInClient mGoogleSignInClient;
private final static int RC_SIGN_IN = 123;
ImageButton google_sign_buton;
// initlize variables
Prevent NestedScrollView automatically scrolling to bottom
// add this line to child layout
// android:descendantFocusability="blocksDescendants"
Start activity from adapter
context?.startActivity(Intent(context, ActivityName::class.java))