Guide to Establish Connection with S3 using Python Scripts

We will take a look at using Python Scripts to interact with infrastructure provided by Amazon Web Services(AWS).
In this tutorial, We are considering only Python scripting for S3.

First thing, You have to check python is installed in your machine by typing simple command:

which python

That will show you the path of python executable. If python is not installed in your machine first download it from this site: https://www.python.org/downloads/

After this check the version of python by typing:

python -V

We are using python 2.7.12 and you can use python 2.6 or higher.

Next thing you have to check pip is intall in your machine by typing command:

 which pip

That will show you the path of pip executable.If pip is not installed in your machine first download it from this site: https://pip.pypa.io/en/stable/installing/

Your version of pip should be 9.0.1 or newer.Check your version of pip by typing :

pip -V

Install boto3  and AWS CLI

Now basic installation is completed. Now install the library of python which is used to interact with AWS on by using this command

pip install awscli boto3 -U --ignore-installed six

Now login to your AWS account and select IAM.

Screenshot from 2018-07-16 13-08-51

This window will come on your screen.Read More »

Guide to establish Android Network Connection

Most of the application in android now a days use data from internet it might be contacts, game data, weather or other information.This data is provided from internet through Web API’s.

In this tutorial we can take an example of Github Query App and make a connection of Android App to internet.

Creating Layout

After starting empty activity in a new project in Android Studio,First thing you have to do is  to open activity_main.xml and make some changes.Delete a Constraint Layout and create a new Linear Layout.Create a EditText, inside Linear Layout, where user can enter their input data and give proper ID to EditText and other properties.Create a TextView,inside Linear Layout, to show the Url and give proper ID and other properties.You have to create a ScrollView,inside Linear Layout, to scroll on a result. Create a TextView inside the ScrollView and give proper ID to this and other properties.

<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:paddingLeft="16dp"
    android:paddingRight="16dp"
    android:paddingTop="16dp"
    android:layout_width="match_parent"
    android:layout_height="match_parent">
    <EditText
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:textSize="22sp"
        android:id="@+id/et_search_box"
        android:hint="Enter a query and click search" />
    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:textSize="22sp"
        android:id="@+id/tv_url_display"
        android:layout_marginTop="8dp"
        android:hint="your search will be shown here"/>
    <ScrollView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="16dp">
        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:textSize="18sp"
            android:id="@+id/tv_github_search_result_json"
            android:hint="make a search"/>
    </ScrollView>
</LinearLayout>

Now move to MainActivity.java and make some changes.Create a variable for EditText and TextView inside the MainActivity class.Read More »