mardi 17 mai 2016

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



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.

Quote:

Why are so many businesses moving to the cloud? It's because cloud computing increases efficiency, helps improve cash flow and offers many more benefits…Here's ten of the best.
1. Flexibility
2. Disaster recovery
3. Automatic software updates
4. Capital-expenditure Free
5. Increased collaboration
6. Work from anywhere
7. Document control
8. Security
9. Competitiveness
10. Environmentally friendly
READ MORE


If you want to design & develop cloud service for your business it is better to understand What you Know & Need.


Try to read again carefully All descriptions & Link above to get reach knowledge of Cloud.
In This Tutorial I used All Alphabet Services. Google Cloud, Firebase, Google Play Services & etc.
I prefer Alphabet cause It is Google ;)
Quote:

"Firebase — a powerful platform for building iOS, Android, and web-based apps, offering real-time data storage and synchronization, user authentication, and more."
Index:
* Data Transferring By FireBase:
- Send & Receive
* Authentication:
- Google Account By GoogleSignIn API
- Twitter By Fabric API
- Email/Pass By Firebase API

# Let Start #


Quote:

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
HTML Code:

http://ift.tt/24YmmSY
Every task with Firebase API needs this URL.

Go to http://ift.tt/1XygIoH 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 App PackageName then Save.

Go to http://ift.tt/JZUm7Q First of All If you are new to Developing Spend some times in this page & Enjoy All Google Services for Everything. :good:
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.

Attached Thumbnails
Click image for larger version Name: Untitled.jpg Views: N/A Size: 71.5 KB ID: 3754189   Click image for larger version Name: ospUntitled - 3 (3).jpg Views: N/A Size: 211.2 KB ID: 3754197   Click image for larger version Name: + - Copy.jpg Views: N/A Size: 32.1 KB ID: 3754198  


from xda-developers http://ift.tt/24Ym4M2
via IFTTT

Aucun commentaire:

Enregistrer un commentaire