Home » » [Tutorial] Developing Cloud Base App [GoogleCloud][Android]

[Tutorial] Developing Cloud Base App [GoogleCloud][Android]

Posted by Droid Firmware Flash on Wednesday, May 25, 2016

In this Tutorial I try to explain general aspects of Cloud Computing & Cloud Concepts & Authentication You will learn What is Cloud & If already know basics of Android Programming, you will be able to develop your Cloud Base App after reading carefully this guide.

What you Need to Continue is;
1. Google Account
2. Ability to Create Hello World! Project in Android Studio


* Application Configuration
Run Android Studio & Create New Project with Blank Activity. (Set Proper AppName & Package)
After Gradle Building finished go to File > Project Structure > Cloud & Enable Firebase.
Go to Manifest > Add Get_Account & Internet Permissions above the <application />

Code:
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
then Inside Application tag add Google_Play_Service <meta-data />
Code:
<meta-data
android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version" />
Then Open build.gradle (Module: App) & Add these excludes to prevent errors during test process inside android{}
Code:
packagingOptions {
exclude 'META-INF/LICENSE'
exclude 'META-INF/LICENSE-FIREBASE.txt'
exclude 'META-INF/NOTICE'
}
Also Add this library for auth-process into dependencies{}
Code:
compile 'com.google.android.gms:play-services-auth:8.4.0'
Now your App is Ready to Add Codes for Cloud API But your Need to Configure Cloud Side too.

* Google Cloud & Firebase Configuration
Here some parts doesn't need for beginning Android Coding But It can be tricky & easy for you to do everything on Browser for Google Section and then Focus on Coding. At End you can Review All Parts & Test it by yourself. I will explain more about each part.
Generate your Sign APK to Get SHA-1 Key
Code:
keytool -list -v -keystore '/PATH/TO/kEY_STORE'
To Transfer Data to Cloud you need to Have a Cloud Service. Here I am using Firebase. 

Go to www.Firebase.com & Login with your Google Account
Firebase will automatically Create a Project for you named 'MY FIRST APP' that you can delete or modify it. 
Firebase has Free Plan for Small Business, Testing & etc. So after you learn more about cloud you can upgrade your plan for existing projects.
The URL of Firebase for your Project is Like this
Every task with Firebase API needs this URL.Go to https://Console.Gloud.Google.com Sign-Up & Get 60 Days Trial Period & 300$ to spend on Google Cloud Platform. 
So Feel Free to Create Projects & Enabling APIs. 
After Creating Google Cloud Project go to Project Dashboard & from Left Panel navigate to API Manager > Credentials. Click on Create Credential & Select OAuth client ID After Loading New Page Select Android Then Create. Now Set Carefully your SHA-1 key & Android AppPackageName then Save.

Go to https://Developers.Google.com/ First of All If you are new to Developing Spend some times in this page & Enjoy All Google Services for Everything. 
Then Navigate to Google Service for Mobile > Android > Sign-In with Google > Click Get Start > Scroll Down > Click Get Configuration File
Again Type your Android App PackageName then Click Continue & Type SHA-1 Key & Click ENABLE GOOGLE SIGN-IN after that Scroll Down and Click on Generate Configuration File and Download the File. 
Copy google-service.json File & Paste it to App Level Project
Code:
To do this Now Open Android Studio Change View of Project Explorer from Android View to Project View. 
Expand Project and Paste JSON file under the APP Level.
Now you are ready to use Firebase Services & Login with Google.
Next Post is About Working with Firebase Send/Receive Data.


Oo. DOWNLOAD .oO
SOURCE.CODE
APK.FILE


Thanks for Supporting GeeksEmpire projects


0 comments:

Post a Comment

Popular Posts

Blog Archive

.comment-content a {display: none;}