পোস্টগুলি

জুন, ২০১৮ থেকে পোস্টগুলি দেখানো হচ্ছে

File Chooser/image upload/ chooser/ galary

ছবি
File Chooser/image upload/ chooser/ galary Bitmap convert. private static final int CHOOSE_IMAGE = 101; private Uri uriProfileImage; /*For Image Chooser and select image*/ private void showImageChooser() { Intent intent = new Intent(); intent.setType( "image/*" ); intent.setAction(Intent. ACTION_GET_CONTENT ); startActivityForResult(Intent. createChooser (intent, "Select Profile Image" ), CHOOSE_IMAGE ); } @Override protected void onActivityResult( int requestCode, int resultCode, Intent data) { super .onActivityResult(requestCode, resultCode, data); if (requestCode == CHOOSE_IMAGE && resultCode == RESULT_OK && data != null && data.getData() != null ) { uriProfileImage = data.getData(); //bitmap try { Bitmap bitmap = MediaStore.Images.Media. getBitmap (getContentResolver(), uriProfileImage ); IV_camera .setImageBitmap(bitmap); ...

How to Check Internet Connection available or not ? ! by java Coding

ছবি
Check Internet Connection public boolean checkInternetConnection() { boolean connected = false ; ConnectivityManager connectivityManager = (ConnectivityManager)getSystemService(Context. CONNECTIVITY_SERVICE ); if (connectivityManager.getNetworkInfo(ConnectivityManager. TYPE_MOBILE ).getState() == NetworkInfo.State. CONNECTED || connectivityManager.getNetworkInfo(ConnectivityManager. TYPE_WIFI ).getState() == NetworkInfo.State. CONNECTED ) { //we are connected to a network connected = true ; } else { connected = false ; } return connected; } https://pastebin.com/u6H3FgZg

Firebase authentication

ছবি
Firebase authentication: Part-1: Create Firebase Project and connect it to your app. check... Part-2: Registration. 1. In firebase, there are many ways of registration.if we go firebase console, we can see these ways.. we should enable one of their Sign-in methods first. 2. Design UI for Signup Page: 3. Now we should do some code for receiving data/email & password from those EditText and write some code for Firebase authentication by Email & Password. Declare & Initialize  mAuth. Pass the Email & Password to Firebase. 4. Above 1st we get the Email & Password from input Field. then pass them as a parameter of mAuth .createUserWithEmailAndPassword(email, password)   method. here is the full java class: package com.nirjhor3029.firebaseauthentication; import android.content.Intent; import android.os.Bundle; import android.support.annotation.NonNull ; import android.support.v7.app.AppCompatActivity; impo...

Android Form Validation:

ছবি
Android Form Validation: private void registerUser() { String email = ET_SignupEmail .getText().toString().trim(); String password = ET_SignupPassword .getText().toString().trim(); if (email.isEmpty()) { ET_SignupEmail .setError( "Email is required" ); ET_SignupEmail .requestFocus(); return ; //prevent code to go below. stop here. } if (!Patterns. EMAIL_ADDRESS .matcher(email).matches()) //import android.util.Patterns; { ET_SignupEmail .setError( "Please enter a Valid Email !" ); ET_SignupEmail .requestFocus(); return ; } if (email.isEmpty()) { ET_SignupPassword .setError( "Password is required" ); ET_SignupPassword .requestFocus(); return ; } if (password.length() < 6 ) { ET_SignupPassword .setError( "Minimum length of password should be 6 ." ); ET_SignupPassword .requestFocus(); retur...

Android Form Validation:

ছবি
Android Form Validation: private void registerUser() { String email = ET_SignupEmail .getText().toString().trim(); String password = ET_SignupPassword .getText().toString().trim(); if (email.isEmpty()) { ET_SignupEmail .setError( "Email is required" ); ET_SignupEmail .requestFocus(); return ; //prevent code to go below. stop here. } if (!Patterns. EMAIL_ADDRESS .matcher(email).matches()) //import android.util.Patterns; { ET_SignupEmail .setError( "Please enter a Valid Email !" ); ET_SignupEmail .requestFocus(); return ; } if (email.isEmpty()) { ET_SignupPassword .setError( "Password is required" ); ET_SignupPassword .requestFocus(); return ; } if (password.length() < 6 ) { ET_SignupPassword .setError( "Minimum length of password should be 6 ." ); ET_SignupPassword .requestFocus(); return ; ...

Firebase Google Cloud Messaging [ Push Notification ]

ছবি
Firebase Google Cloud Messaging [ Push Notification ] For that, 1st of all we need to create a firebase project and connect our app with that ... Part-1: Connect Firebase Project 1. Open your Android project in Android Studio. 2. Goto: Tools -> Firebase   3. Here we can see many options for firebase services. But for now, we need Cloud Messaging . so create a project and connect it . 4. If you create a firebase project by going to firebase console and creating manually then you can select: "Choose an existing firebase or google project". But here  I did not create any project before so I just select "Create a new firebase project" and connect it with my app. [my way is easy :) ] 5. Now we need to add some dependencies for FCM (Firebase Cloud Messaging) service. rather than doing it by manually we can do it as below so easily . 6. It will take some time for adding dependencies and Sync them... 7. Now we are read...