Develop With AWS Mobile Hub and SDK
What is AWS Mobile Hub ?
The AWS Mobile Hub is a collection of Amazon Web Services tools designed to help developers build, test, configure and release cloud-based applications for mobile devices.
Platform supported by AWS Mobile Hub
1. iOS
2. Android
3. Web
4. React Native
Service Provided By AWS Mobile Hub According To Platform
Web : Analytics , User Sign-in , NoSQL Database , User Data Storage , Cloud Logic
React Native : Analytics , User Sign-in , NoSQL Database , User Data Storage , Cloud Logic
Android : Analytics , User Sign-in , Push Notification , NoSQL Database , User Data Storage , Cloud Logic , Messaging , Conversation Bots , Hosting and Streaming
iOS : Analytics , User Sign-in , Push Notification , NoSQL Database , User Data Storage , Cloud Logic , Messaging , Conversation Bots , Hosting and Streaming
Benefits of Using AWS Mobile Hub
1. Start for free : Get started building your app for free. Every AWS service has a free tier. Pay only for the services you use beyond the free tier.
2. Add cloud services fast : Create amazing cloud-enabled apps in minutes. Use serverless technology to run code without provisioning or managing servers.
3. Deliver quality apps : Automate your DevOps pipeline with build, test, and deploy services for your iOS, Android, and web applications.
4. Engage your audience : Analyze app usage, and engage in meaningful conversations with your users using email, two-way SMS, and mobile push.
Working of AWS Mobile Hub
1. Create an app : Start with your own app, or use one of our starter kits which give you a fully functional app with a pre-configured frontend and backend.
2. Set up your backend : AWS Mobile Hub gives you a single place to easily configure AWS services. It generates a cloud configuration file, which stores information about configured services.
2. Set up your backend : AWS Mobile Hub gives you a single place to easily configure AWS services. It generates a cloud configuration file, which stores information about configured services.
3. Connect to your backend : AWS Mobile SDK provides easy access to a range of AWS services. Use the cloud configuration file from Mobile Hub to configure the SDK in your app in minutes.
Features Provided by AWS Mobile Hub
1. Secure Authentication
2. Database
3. Storage
4. Bots
5. Serveless Function
6. Host your web apps
7. Test on Real devices
8. Analytics
9. Email
10. SMS
11. A/B Testing
12. Push Notifications
How To Setup Your Backend ?
1. Sign up for the AWS Free Tier
2. Create a Mobile Hub project by signing into the console. The Mobile Hub console provides a single location for managing and monitoring your app's cloud resources.To integrate existing AWS resources using the SDK directly, without Mobile Hub, see Setup Options for Android.
3. Name your project, check the box to allow Mobile Hub to administer resources for you and then choose Add.
4 . Choose the Download Cloud Config and then choose Next.
The
awsconfiguration.json
file you download contains the configuration of backend resources that Mobile Hub enabled in your project. Analytics cloud services are enabled for your app by default. 5. Add the backend service configuration file to your app.
Right-click your app's
res
folder, and then choose New > Android Resource Directory. Select raw in the Resource type dropdown menu. 6. From the location where configuration file,
awsconfiguration.json
, was downloaded in a previous step, drag it into the res/raw
folder. Android gives a resource ID to any arbitrary file placed in this folder, making it easy to reference in the app. 7. Your backend is now configured. Follow the next steps at Connect to Your Backend.
Now How to Connect to Your Backend ?
1. Add this two permission into your Android App
permission into your Android App
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
2. Add dependency to your app/build.gradle dependencies {
implementation ('com.amazonaws:aws-android-sdk-mobile-client:2.6.+@aar')
{ transitive = true }
}
3 .
Add the following code to the oncreate method of yout main activity
import com.amazonaws.mobile.client.AWSMobileClient;
public class YourMainActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
AWSMobileClient.getInstance().initialize(this, new AWSStartupHandler() {
@Override
public void onComplete(AWSStartupResult awsStartupResult) {
Log.d("YourMainActivity", "AWSMobileClient is instantiated and you are connected to AWS!");
}
}).execute();
// More onCreate code ...
}
}
Written By : Tushar Verma
AWS Official Site : aws.amazon.com
AWS Mobile Hub Official Site : https://aws.amazon.com/mobile/
Linkedin Profile : https://www.linkedin.com/in/tushar-verma-047329154/
Komentar
Posting Komentar