NewImage

 

You can create a multi language android application with Android Studio. Go to Res -> Values-> String.xml folder and right click to choose Open Translation Editor. Translation editor support BCP 47 and will change the locale of the android system including date, time, currency and decimal.

 

NewImage

 

To add language, select the Globe Icon and enter the language. Values-* folder with a strings.xml file is added to the project. For example, values-es for Spanish.

NewImage

 

View translated text in design view.

 

NewImage

 



This is the code to convert old android key.pk8 to android keystone. For example you have the certificate.pem and and key.pk8 of your old android apps.. How to convert to the new android keystore to upload your apps to Google Play store.?

Step 1: Download and install OpenSSL.

Step 2: Open terminal or command prompt and go to the directory where the .pem and .cer files are stored.

>openssl pkcs8 -inform DER -nocrypt -in key.pk8 -out key.pem
> openssl pkcs12 -export -in certificate.pem -inkey key.pem -out platform.p12 -password pass:yourandroidpassword -name yourkey
> keytool -importkeystore -deststorepass yourpassword -destkeystore .keystore -srckeystore platform.p12 -srcstoretype PKCS12 -srcstorepass yourandroidpassword
> keytool -list -v -keystore .keystore

Make sure you change the password to your own password.. And backup the old key and certificate to a safe location. You cannot upload the same apps if you lose the key and certificate password on Google Play.

Step 3: After successful imported, can now use the generated .keystore file in the Android Developer Tools to export the your old android apps.


Step 4: Open Android ADT, open the project files and edit the android manifest version number. Increase your version number to avoid upload failed in Play Store.

Upload failed

You need to use a different version code for your APK because you already have one with version code 2.


Step 5: Goto Android ADT and Click File -> Export. Select Export Android Application.


Step 6: Use existing keystone and browse the generated keystone in the previous step.


Step 7: Enter the password and the key password. (use define password in the previous step) - default is password and android.

Step 8: Finally, upload the latest version of your app APK to play store.




NewImage

 

You can define the color of your app by modifiying the colour.xml in the res folder. 

 

NewImage

NewImage

 

<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="colorPrimary">#125688</color>
<color name="colorPrimaryDark">#125688</color>
<color name="textColorPrimary">#FFFFFF</color>
<color name="windowBackground">#EEEEEE</color>
<color name="navigationBarColor">#000000</color>
<color name="colorAccent">#c8e8ff</color>
</resources>

You can use the following color pallets for your apps.

NewImage

 

NewImage

NewImage

NewImage

NewImage

 

 

NewImage

 

Cardview is a new addition in Material Design. It is best way to display data and a good alternative to a list view. You can add the Cardview code in the xml layout.  Here is the code to add Header in the cardview or add a image and align to the left.

 



<android.support.v7.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:card_view="http://schemas.android.com/apk/res-auto"
android:id="@+id/card_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
app:cardElevation="8dp"
card_view:cardCornerRadius="2dp">

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">

<LinearLayout
android:id="@+id/heading_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#009688"
android:padding="5dp"
android:orientation="vertical">



<TextView
android:id="@+id/tv_subheading"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="24dp"
android:layout_below="@+id/tv_heading"
android:text="Header"
android:textColor="#80CBC4"
android:textSize="24sp" />

</LinearLayout>


<TextView
android:id="@+id/tv_footer"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="16dp"
android:layout_below="@+id/tv_heading"
android:text="CardView"
android:textColor="#9E9E9E"
android:textStyle="bold"
android:textSize="24sp" />

</LinearLayout>
</android.support.v7.widget.CardView>





<android.support.v7.widget.CardView
android:id="@+id/card_view"
xmlns:card_view="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
card_view:cardBackgroundColor="#FFFFFF"
card_view:cardCornerRadius="10dp"
card_view:cardElevation="5dp"
card_view:cardUseCompatPadding="true">

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
>

<ImageView
android:id="@+id/imageView"
android:tag="image_tag"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_margin="5dp"
android:layout_weight="1"
android:src="@drawable/ic_launcher"/>

<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:layout_weight="2"
android:orientation="vertical"
>

<TextView
android:id="@+id/textViewName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="10dp"
android:text="Android Name"
android:textAppearance="?android:attr/textAppearanceLarge"/>

<TextView
android:id="@+id/textViewVersion"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="10dp"

android:text="Android Version"
android:textAppearance="?android:attr/textAppearanceMedium"/>

</LinearLayout>
</LinearLayout>

</android.support.v7.widget.CardView>
NewImage

An Intent is an object that provides runtime binding between separate components such as two activities.

To build intent use the following code. You should create a button with onclick function set to OpenNewForm and textfield with id (edit_message)


public final static String EXTRA_MESSAGE = "com.example.yourapp.MESSAGE";

public void openNewForm(View view) {

    Intent intent = new Intent(this, Main2Activity.class);
    EditText editText = (EditText) findViewById(R.id.edit_message);
    String message = editText.getText().toString();
    intent.putExtra(EXTRA_MESSAGE, message);
    startActivity(intent);
}
 
NewImage
 
Create New Empty Activity and paste the following code.
 
Intent intent = getIntent();
String message = intent.getStringExtra(MainActivity.EXTRA_MESSAGE);
TextView textView = new TextView(this);
textView.setTextSize(40);
textView.setText(message);

ViewGroup layout = (ViewGroup) findViewById(R.id.activity_main2);
layout.addView(textView);
 


If you get can't resolve symbol error. Try pressing Alt + Enter (or Option + Return on Mac) to automatically import the files.

 

NewImage

Creating Native ads is a bit similar to regular banner ads. Native ads have higher CTR compare to normal banner. It is recomended to add native ads in your apps. You can still use both regular smart banner and native ads but you cannot use both in the same page. Be creative and add native ads in your Android Apps to increase your apps revenue.

1. Create Native ads unit with template. 

 

 

NewImage

 

2. Customize the CSS presentation on Admob console page. You can also redesign CSS later without redeploy your apps.

 

NewImage

3. Add native express ads view in the main activity layout. Add the following code. You can modify the adSize according to your need.

<com.google.android.gms.ads.NativeExpressAdView
android:id="@+id/adView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_alignParentBottom="true"
ads:adSize="320x150"
ads:adUnitId="@string/ad_unit_id">
</com.google.android.gms.ads.NativeExpressAdView>

 

3. Load an Ads in the MainActivity.java by adding two line of code in the onCreate()

 

NewImage

 


NativeExpressAdView adView = (NativeExpressAdView) findViewById(R.id.adView);
adView.loadAd(new AdRequest.Builder().build());

 

4. Run the apps and you should see native ads in your android apps.

Firebase is a new tools that allow developer to grow user and monetise the app in one stop solution. You can link your existing Admob apps. Just click Analyize tab and select the existing aps and click link to firebase.
NewImage
Download the google-service config file and link it to your Android Studio project.

NewImage

Next , Configure the Gradle file in the Android Studio.

  1. Project-level build.gradle (<project>/build.gradle):
    buildscript { dependencies {
        // Add this line
        classpath 'com.google.gms:google-services:3.0.0' } }
  2. App-level build.gradle (<project>/<app-module>/build.gradle):
    ...
    // Add to the bottom of the file
    apply plugin: 'com.google.gms.google-services'
    includes Firebase Analytics by default

Next add Individual dependency in your <project>/<app-module>/build.gradle and click sync now. Gradle will refresh the project library and add the dependency that you just added.

...
    dependencies {
            compile fileTree(dir:'libs', include:['*.jar'])
            compile 'com.android.support:appcompat-v7:xx.x.x'
            compile 'com.google.firebase:firebase-ads:9.6.0'
        }
...

apply plugin:'com.google.gms.google-services'



NewImage
Open the activity_main.xml in your res/layout folder and add the following code.
<com.google.android.gms.ads.AdViewandroid:id="@+id/ad_view"android:layout_width="match_parent"android:layout_height="wrap_content"android:layout_centerHorizontal="true"android:layout_alignParentBottom="true"ads:adSize="BANNER"ads:adUnitId="@string/banner_ad_unit_id" />

Next, Open the main activity java files add add the following code to init and display the ads.

NewImage
import com.google.android.gms.ads.AdRequest;
import com.google.android.gms.ads.AdView;
import com.google.android.gms.ads.MobileAds;

/** * Main Activity. Inflates main activity xml and child fragments. */public class MyActivity extends ActionBarActivity {

    private AdView mAdView;

    @Overrideprotected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_my);

        // Initialize the Mobile Ads SDK.MobileAds.initialize(this, "ca-app-pub-3940256099942544~3347511713");

        // Gets the ad view defined in layout/ad_fragment.xml with ad unit ID set in // values/strings.xml.mAdView = (AdView) findViewById(R.id.ad_view);

        // Create an ad request. Check your logcat output for the hashed device ID to // get test ads on a physical device. e.g. // "Use AdRequest.Builder.addTestDevice("ABCDEF012345") to get test ads on this device."AdRequest adRequest = new AdRequest.Builder()
                .addTestDevice(AdRequest.DEVICE_ID_EMULATOR)
                .build();

        // Start loading the ad in the background.mAdView.loadAd(adRequest);
    }
 
}
Now you can add a bunch of Firebase tools such as realtime database, analytics, cloud messaging and user authentication.

How to add Admob with Firebase

by on 3:56 AM
Firebase is a new tools that allow developer to grow user and monetise the app in one stop solution. You can link your existing Admob apps. ...

NewImage

 

Activity is a single screen with user interface in Android just like a window form in visual .net development tools. Just like C++ which start with main() function. Android start its activity with onCreate() method. This is where you should do all of your  create views, bind data to lists, etc. OnStart() is call when the activity is visible to the user. OnResume() is call when the user start interacting with the apps. OnPause() is called when the app cannot receive any user input or execute code. OnStop() is called when the The activity is no longer visible to the user. onDestroy() is called before the activity is being destroy by the system.

 

import android.app.Activity;
import android.os.Bundle;
import android.util.Log;

import androidrich.com.firebaseauthtest.R;

public class TestActivity extends Activity {
/** Called when the activity is first created. */

private final static String TAG = "TestActivity";

@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
Log.i(TAG, "On Create .....");
}
/* (non-Javadoc)
* @see android.app.Activity#onDestroy()
*/
@Override
protected void onDestroy() {
super.onDestroy();
Log.i(TAG, "On Destroy .....");
}
/* (non-Javadoc)
* @see android.app.Activity#onPause()
*/
@Override
protected void onPause() {
super.onPause();
Log.i(TAG, "On Pause .....");
}

/* (non-Javadoc)
* @see android.app.Activity#onRestart()
*/
@Override
protected void onRestart() {
super.onRestart();
Log.i(TAG, "On Restart .....");
}

/* (non-Javadoc)
* @see android.app.Activity#onResume()
*/
@Override
protected void onResume() {
super.onResume();
Log.i(TAG, "On Resume .....");
}

/* (non-Javadoc)
* @see android.app.Activity#onStart()
*/
@Override
protected void onStart() {
super.onStart();
Log.i(TAG, "On Start .....");
}
/* (non-Javadoc)
* @see android.app.Activity#onStop()
*/
@Override
protected void onStop() {
super.onStop();
Log.i(TAG, "On Stop .....");
}
}
NewImage
Firebase Authentication is a good and secure way to get the indentity of your user.It leverages industry standards like OAuth 2.0 and OpenID Connect.
FirebaseUI as a complete drop-in auth solution. The FirebaseUI Auth component implements best practices for authentication on mobile devices and websites, which can maximize sign-in and sign-up conversion for your app. It also handles edge cases like account recovery and account linking that can be security sensitive and error-prone to handle correctly. You can access the user's basic profile information, and you can control the user's access to data stored in other Firebase products.

Step 1: Create New Project on AndroidStudio. Configure your new project such as Application Name, Company Domain, and Project Location.
NewImage

2. Just accept the default form factors your apps will run on.
NewImage

3. Select add Empty Activity for your Mobile Android app.
NewImage

4. Goto Tools menu, and click the new Firebase. Select the  Authentication and Conect to Firebase. next Click Add firebase Authentication to your apps. It will automatically add the following classpath to the build.gradle (project level) and Add the following code to the app/build.gradle
 
  1. Project-level build.gradle (<project>/build.gradle):
    buildscript { dependencies {
        // Add this line
        classpath 'com.google.gms:google-services:3.0.0' } }
  2. App-level build.gradle (<project>/<app-module>/build.gradle):
    ...
    // Add to the bottom of the file
    apply plugin: 'com.google.gms.google-services'
    includes Firebase Analytics by default

NewImage

5. You will got the following error.
Error:Execution failed for task ':app:processDebugGoogleServices'.
> File google-services.json is missing. The Google Services Plugin cannot function without it.  Don’t worry we will fix the error in the next step.
NewImage

6. Add firebase to your Android app and enter the Package name that we created earlier in step 1.

NewImage

For SHA1, go to terminal and type the following code.

keytool -list -v -keystore ~/.android/debug.keystore -alias androiddebugkey -storepass android -keypass android

For window user, follow the StackOverflow discussion over here.

7. Swith to project mode and drag and drop the google-service.jason to you app folder.

NewImage

8. Go to Firebase console and go the Auth menu and enable Google Sign in Provider.
NewImage

9. Add google sign in button in your main layout activity
<com.google.android.gms.common.SignInButtonandroid:id="@+id/sign_in_button"android:layout_width="wrap_content"android:layout_height="wrap_content" />
 
NewImage
 
10. On you onCreate method configure Google Sign in to request user data by using GoogleSignObject
 
  // Configure sign-in to request the user's ID, email address, and basic// profile. ID and basic profile are included in DEFAULT_SIGN_IN.GoogleSignInOptions gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)
                .requestEmail()
                .build();
 
NewImage
 
11. Then also in main_activity onCreate method, create GoogleApiClient object to access Google Sign-In API and the options you specified.
 
 
NewImage
 
Copy the following code.
 
package androidrich.com.firebaseauthtest;
import android.app.ProgressDialog;
import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import android.view.View;
import android.widget.TextView;
import android.widget.Toast;

import com.google.android.gms.auth.api.Auth;
import com.google.android.gms.auth.api.signin.GoogleSignInAccount;
import com.google.android.gms.auth.api.signin.GoogleSignInOptions;
import com.google.android.gms.auth.api.signin.GoogleSignInResult;
import com.google.android.gms.common.ConnectionResult;
import com.google.android.gms.common.api.GoogleApiClient;
import com.google.android.gms.common.api.ResultCallback;
import com.google.android.gms.common.api.Status;
import com.google.android.gms.tasks.OnCompleteListener;
import com.google.android.gms.tasks.Task;
import com.google.firebase.auth.AuthCredential;
import com.google.firebase.auth.AuthResult;
import com.google.firebase.auth.FirebaseAuth;
import com.google.firebase.auth.FirebaseUser;
import com.google.firebase.auth.GoogleAuthProvider;

public class MainActivity extends AppCompatActivity implements        GoogleApiClient.OnConnectionFailedListener,
        View.OnClickListener {

    private static final String TAG = "GoogleActivity";
    private static final int RC_SIGN_IN = 9001;

    // [START declare_auth]    private FirebaseAuth mAuth;
    // [END declare_auth]
    private GoogleApiClient mGoogleApiClient;
    private TextView mStatusTextView;
    private TextView mDetailTextView;
    private ProgressDialog mProgressDialog;

    @Override    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        // Views        mStatusTextView = (TextView) findViewById(R.id.status);
        mDetailTextView = (TextView) findViewById(R.id.detail);

        // Button listeners        findViewById(R.id.sign_in_button).setOnClickListener(this);
        findViewById(R.id.sign_out_button).setOnClickListener(this);
        findViewById(R.id.disconnect_button).setOnClickListener(this);

        // [START config_signin]        // Configure Google Sign In        GoogleSignInOptions gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)
                .requestIdToken(getString(R.string.default_web_client_id))
                .requestEmail()
                .build();
        // [END config_signin]
        mGoogleApiClient = new GoogleApiClient.Builder(this)
                .enableAutoManage(this /* FragmentActivity */, this /* OnConnectionFailedListener */)
                .addApi(Auth.GOOGLE_SIGN_IN_API, gso)
                .build();

        // [START initialize_auth]        mAuth = FirebaseAuth.getInstance();
        // [END initialize_auth]    }

    @Override    public void onStart() {
        super.onStart();

        // Check for existing sign-in        FirebaseUser user = mAuth.getCurrentUser();
        updateUI(user);
    }

    // [START onactivityresult]    @Override    public void onActivityResult(int requestCode, int resultCode, Intent data) {
        super.onActivityResult(requestCode, resultCode, data);

        // Result returned from launching the Intent from GoogleSignInApi.getSignInIntent(...);        if (requestCode == RC_SIGN_IN) {
            GoogleSignInResult result = Auth.GoogleSignInApi.getSignInResultFromIntent(data);
            // [START_EXCLUDE]            handleGoogleSignInResult(result);
            // [END_EXCLUDE]        }
    }
    // [END onactivityresult]
    // [START auth_with_google]    private void firebaseAuthWithGoogle(GoogleSignInAccount acct) {
        Log.d(TAG, "firebaseAuthWithGoogle:" + acct.getId());
        // [START_EXCLUDE silent]        showProgressDialog();
        // [END_EXCLUDE]
        AuthCredential credential = GoogleAuthProvider.getCredential(acct.getIdToken(), null);
        mAuth.signInWithCredential(credential)
                .addOnCompleteListener(this, new OnCompleteListener() {
                    @Override                    public void onComplete(@NonNull Task task) {
                        Log.d(TAG, "signInWithCredential:onComplete:" + task.isSuccessful());

                        // If sign in fails, display a message to the user. If sign in succeeds                        // the auth state listener will be notified and logic to handle the                        // signed in user can be handled in the listener.                        if (!task.isSuccessful()) {
                            Log.w(TAG, "signInWithCredential", task.getException());
                            Toast.makeText(MainActivity.this, "Authentication failed.",
                                    Toast.LENGTH_SHORT).show();
                        }
                        // [START_EXCLUDE]                        hideProgressDialog();
                        // [END_EXCLUDE]                    }
                });
    }
    // [END auth_with_google]

    private void handleGoogleSignInResult(GoogleSignInResult result) {
        Log.d(TAG, "handleSignInResult:" + result.getStatus());
        if (result.isSuccess()) {
            // Successful Google sign in, authenticate with Firebase.            GoogleSignInAccount acct = result.getSignInAccount();
            firebaseAuthWithGoogle(acct);


            

        } else {
            // Unsuccessful Google Sign In, show signed-out UI            updateUI(null);
        }
    }

    // [START signin]    private void signIn() {
        Intent signInIntent = Auth.GoogleSignInApi.getSignInIntent(mGoogleApiClient);
        startActivityForResult(signInIntent, RC_SIGN_IN);
    }
    // [END signin]
    private void signOut() {
        // Firebase sign out        mAuth.signOut();

        // Google sign out        Auth.GoogleSignInApi.signOut(mGoogleApiClient).setResultCallback(
                new ResultCallback() {
                    @Override                    public void onResult(Status status) {
                        updateUI(null);
                    }
                });
    }

    private void revokeAccess() {
        // Firebase sign out        mAuth.signOut();

        // Google revoke access        Auth.GoogleSignInApi.revokeAccess(mGoogleApiClient).setResultCallback(
                new ResultCallback() {
                    @Override                    public void onResult(Status status) {
                        updateUI(null);
                    }
                });
    }

    private void showProgressDialog() {
        if (mProgressDialog == null) {
            mProgressDialog = new ProgressDialog(this);
            mProgressDialog.setMessage(getString(R.string.loading));
            mProgressDialog.setIndeterminate(true);
        }

        mProgressDialog.show();
    }

    private void hideProgressDialog() {
        if (mProgressDialog != null && mProgressDialog.isShowing()) {
            mProgressDialog.hide();
        }
    }

    private void updateUI(FirebaseUser user) {
        hideProgressDialog();
        if (user != null) {
            mStatusTextView.setText(getString(R.string.google_status_fmt, user.getEmail()));
            mDetailTextView.setText(getString(R.string.firebase_status_fmt, user.getUid()));

            findViewById(R.id.sign_in_button).setVisibility(View.GONE);
            findViewById(R.id.sign_out_and_disconnect).setVisibility(View.VISIBLE);
        } else {
            mStatusTextView.setText(R.string.signed_out);
            mDetailTextView.setText(null);

            findViewById(R.id.sign_in_button).setVisibility(View.VISIBLE);
            findViewById(R.id.sign_out_and_disconnect).setVisibility(View.GONE);
        }
    }

    @Override    public void onConnectionFailed(ConnectionResult connectionResult) {
        // An unresolvable error has occurred and Google APIs (including Sign-In) will not        // be available.        Log.d(TAG, "onConnectionFailed:" + connectionResult);
        Toast.makeText(this, "Google Play Services error.", Toast.LENGTH_SHORT).show();
    }

    @Override    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.sign_in_button:
                signIn();
                break;
            case R.id.sign_out_button:
                signOut();
                break;
            case R.id.disconnect_button:
                revokeAccess();
                break;
        }
    }
}




<com.google.android.gms.common.SignInButton
 android:id="@+id/sign_in_button"
 android:layout_width="wrap_content"
 android:layout_height="wrap_content"/>

<com.google.android.gms.common.SignInButton
 android:id="@+id/sign_in_button"
 android:layout_width="wrap_content"
 android:layout_height="wrap_content"/>



Watch Official Video from Google
Prerequisites

You need a device running Android 2.3 (Gingerbread) or newer devices.
NewImage
Make sure the device or emulator has a Google Play Services 9.0 or above.

NewImage

You need to make sure you have atl least Google Play Services rev 30 and Google Repository Rev 30. As per today we have Google Play services rev 33 and Google Repository rev 35. Always update this two repository.

There are plenty of sample code for Andorid and iOS here. You can also Quick Start from GitHub

Step to add firebase project.
 NewImage
1. Add firebase project in https://firebase.google.com/console/.


NewImage
2. Click Add Firebase to your Android app
NewImage
3.When prompted, enter your app's package name. It's important to enter the package name your app is using; this can only be set when you add an app to your Firebase project.

4. Doownload a google-services.json file and drag and drop the file in your android studio app folder.


NewImage

The Google services plugin for Gradle loads the google-services.json file that you just downloaded. Modify your build.gradle files to use the plugin.

  1. Project-level build.gradle (<project>/build.gradle):
    buildscript { dependencies {
        // Add this line
        classpath 'com.google.gms:google-services:3.0.0' } }
  2. App-level build.gradle (<project>/<app-module>/build.gradle):
    ...
    // Add to the bottom of the file
    apply plugin: 'com.google.gms.google-services'
    includes Firebase Analytics by default help_outline
  3. Finally, press "Sync now" in the bar that appears in the IDE:
The Google services plugin for Gradle loads the google-services.json file that you just downloaded. Modify your build.gradle files to use the plugin.

NewImage

 

We recently update our Android Studio (with instant run support) to the latest 2.2 version. It is focus to create a fast and productive integrated development environment (IDE) for Android. We start developing Android on Eclipse IDE but switch to Android Studio 3 years ago. Today 92% of the top 125 apps & game developers on Google Play, plus millions of developers worldwide, use Android Studio.
 
So, today we update our old Android Studio to the latest Android Studio 2.2 stable version. Here is what we like about the new Android Studio 2.2
 
NewImage
 
1. Now your can download the Android SDK component in the background. You can still coding while downloading the new SDK component. It is simple but we love this new features.
 
NewImage
 
2. Now you can build android APK and Analyze back the APK and reduce your APK size. The new APK Analyzer helps you understand the contents and the sizes of different components in your APK. You can also use it to avoid 64K referenced method limit issues in your Dex files, diagnose ProGuard configuration issues, view merged AndroidManifest.xml file, and inspect the compiled resources file (resources.arsc).
 
NewImage
 
3. New Merged Manifest Editor. With new Merge Manifest editor you can find out with legend where the permission of your application come from. 
 
NewImage
 
4. You can also design Android Interface using new layout manager. The new Layout Editor: Android Studio 2.2 features a new user interface designer. There are many enhancements but some of the highlights include: Drag-and-drop widgets from the palette to the design surface .Design surface has a blueprint mode to inspect the spacing and arrangement of your layout. Properties panel can you help edit the value of component quickly.
 
NewImage
 
5. New constraint layout: This new layout is quite similar with RelativeLayout bu the constraint Layout was designed to be used in Studio and it can efficiently express your app design so that you rely on fewer layouts like LinearLayout, FrameLayout, TableLayout, or GridLayout. 
 
NewImage
 
6. The built-in automatic constraints inference engine to automatically predict the layout in potrait and landscape mode. It is huge time saver.
 
NewImage
 
7. Easy firebase integration.Firebase is the new tools for developer that can help you develop high-quality apps, grow your user base, and earn more money. Inside of Android Studio, you can add Firebase to a new or existing Android app with the new Assistant window. You can now explore other Firebase services like Firebase Cloud Messaging or Firease Crash Reporting to add your application. Learn more about firebase integration here.
 
NewImage
 
8. Find sample Code directly from the IDE. Just highlight any code or API and the IDE will find a sample code for you that you can copy and paste or learn more about the documentation.
NewImage
 
9. Help UI test with new Expresso recorder.