Getting Started with Firebase on Android - Firecasts

Getting Started with Firebase on Android - Firecasts - Hello friends Android tutorial and tips trik, The article you are reading this time with the title Getting Started with Firebase on Android - Firecasts, we have prepared this article for you to read and download the information therein. hopefully fill posts article -, article android, article Firebase, article Firecasts, article Getting, article on, article Started, article Tutorial, article with, we can write this you understand. Well, happy reading.

Title : Getting Started with Firebase on Android - Firecasts
link : Getting Started with Firebase on Android - Firecasts

Baca juga


Getting Started with Firebase on Android - Firecasts

Welcome, Androiddevelopers, to Firebase.

My name is Doug Stevenson.

And after followingthis Firecast, you should be able to connectyour Android app to Firebase.

It takes just afew minutes, then you can start developingwith Firebase components in your app.

We'll do three thingsto help you get set up.

First, I'll show youhow to check your tools and make sure you have thecorrect version of everything.

Then I'll walk you throughthe creation of your project using the Firebase console.

And finally, I'llshow the changes that you need to maketo your Android app to prepare it fordevelopment with Firebase.

OK, first things first.

Before starting withFirebase on Android, you should check to make sureyou have everything you need.

To run your app, you'll needan Android device or emulator with at least API level 9,which is Android 2.

3, also known as Gingerbread.

And that must have PlayServices 9.

0 or later.

Physical devices should alreadyhave this update by now.

But if you're usingan emulator, you should get the latest updatefor your emulator image and make sure that you're usingone marked "with Google APIs.

" This means it has PlayServices installed.

To check the version ofPlay Services on a device, launch the Settingsapp, and select Apps.

Make sure you're looking at alist of all the installed apps, and scroll down toGoogle Play Services.

Select that and check that theversion is greater than 9.

0.

Now that you'veverified you have a device that canrun Firebase, it's time to check yourAndroid SDK Tools.

Launch Android Studio, runthe Android SDK Manager from the toolbar, andclick the SDK Tools tab.

There you should haveGoogle Play Services Revision 30 or newer, andGoogle Repository Revision 26 or newer.

If you have theseinstalled, you can start building theFirebase client libraries.

And always remember tokeep them up-to-date.

Now that you have a deviceand tools to start building, we can start setting upFirebase to use in your app.

First, I'll navigateto Firebase.

Google.

Com.

This is the home ofeverything Firebase.

To get to the console,I'll click the Console link at the top right.

Now I'll click theenticing blue button in the middle of the screen,which pops up a dialog to create a new project.

Every project needs a name.

Clicking in theProject Name text box suggests that I should onlycreate a single project if my app is cross-platform.

But we're only going todo Android in this video.

If you later create aniOS version of your app, you should reusethe same project if you want to share data andconfiguration between them.

I'll also take the defaultlocation of United States, since I'd like to measure in anycurrency values for the purpose of analytics in US dollars.

Now I'll commit the new projectwith this other attractive blue button.

After a few moments,my project is created and I'm taken tothe dashboard, which shows an overviewpage of everything I can do in the console.

On the left side, you cansee the various Firebase components.

But let's not worryabout those right now.

Instead, click the big buttonin the middle with the Android logo on it to get your appconnected to this project.

To complete theconnection, you'll need two pieces of information.

First, there's theunique package name that you used whenyou created it.

This is typically definedin your apps configuration in the build.

Gradleas applicationId.

I have a basic project alreadycreated in Android Studio, so I'll just copy itsID from build.

Gradle into the dialog at the console.

The second thingyou should provide is the SHA1 hashof your debug key.

This is only requiredif you're going to develop with Remote Config,Authentication, or App Invites, but let's go aheadand do it now.

The SHA1 hash helpsFirebase verify that your debugapp has permission to use these Firebase services.

So to get your SHA1 hash,open up a terminal window and type this command.

It will prompt you for apassword, so type the default password for the debug keystore,which is the word android in all lowercase.

What this does is print someinformation about your debug keystore.

The specific thingyou're looking for is the line thatstarts with SHA1, so you'll want to copythe series of hex values after that, and then pastethat string into the text box in the console.

Now that you've got these twovalues entered into the dialog, you'll want to go ahead andclick the Add App button.

This will start adownload of a file called google-services.

Jsonthat contains your app configuration.

Remember that when your Firebaseconfiguration changes later, you may need to downloadan update a JSON config to add to your project.

What you'll need todo with this file is move it intoyour Android project under the app directory.

I'm going to do thison the command line.

Now I can see it in thecorrect place in my project.

Once that's done, Ican update my Gradle build files to add Firebaseclient libraries to my app.

The first thingI'm going to do is add the Google ServicesGradle plugin to my build script configuration.

By default, this is in thetop level build.

Gradle file.

What I need to do here is add aline to the dependencies block to let Gradle know howto find a plugin that I'm going to add later.

Because I modified thisfile, Android Studio is asking me to syncmy project, but I'm going to ignore that for now.

OK, close that file.

Now I'm going to open up myapp level build.

Gradle file and apply the GoogleServices plugin at the very bottom of this file.

This plugin will read thegoogle-services.

Json file and inject some of itsvalues into your build.

The last change I'll make hereis adding a compile dependency on Firebase core.

The plugin willactually do this for me, but I want to make sure I'musing the latest version.

You should checkthe documentation to make sure you're usingthe latest and greatest.

So I'm going to check hereon the Firebase Android Setup docs.

So here we can see that thelatest at this moment is 9.

0.

2, and that's what I'm goingto use for Firebase core.

All righty.

We're done now with theGradle modifications, so I'll go ahead andtell Android Studio to sync the modificationsinto the project.

Now, to make sure everythingis working as expected, I'll launch this app in anemulator and check the log output to see if Firebaseinitialized correctly.

And we see here thatFirebase initialized just before the log messagein my application object.

So that's all there is to it.

Now, you're ready tomove on to integrate any components ofFirebase that you want to use in your Android app.

Check out the Firebasedocumentation right here for more detailson those components.

And that's it for this Firecast.

Please leave yourquestions in the comments below, or message me directlyat CodingDoug on Twitter.

There will be more Firecastspublished over time, so be sure to subscribe tothe Firebase YouTube channel right here.

[MUSIC PLAYING].



Thus Article Getting Started with Firebase on Android - Firecasts

That article Getting Started with Firebase on Android - Firecasts This time, hopefully we can give you all of the benefits. Well, I'll see you in another article post.

You now read the article Getting Started with Firebase on Android - Firecasts the link address http://svedda79.blogspot.com/2016/06/getting-started-with-firebase-on.html

0 Response to "Getting Started with Firebase on Android - Firecasts"

Post a Comment