Install Andoid Studio on Ubuntu

Introduction

To be successful, Android developers need a good grasp of the Java Language(or Kotlin), Andoid API’s, and Android application architecture. It’s also important to use an appropriate and effective development environment. For many years, Eclipse IDE with the ADT plugin was the preferred platform for Android development. Today, it’s Andoid Studio.

Android Studio is Google’s officially supported IDE for developing Android apps. This IDE is based on Intellij IDEA, which offers a powerful code editor and developer tools.

Installation

Setting up Android Studio takes just a few commands.

First command is to install Java through this command, if you already installed Java skip this step:

sudo add-apt-repository ppa:webupd8team/java

And then update command:

sudo apt update

And then installation command:

sudo apt-get install oracle-java8-installer

When installation start, the following dialog box popup on your screen for the configuration of Java:

jdk1.png

Read More »

Creating New Activity and Transferring Data

How to create new activities and transfer data from one activity to another activity?

Intro

So far we are working on a single screen on a single activity.
How we start one activity from another activity, instead of having activities directly call each other, android facilitates communication using message object called intent.Intents let an app request that an action take place, that will be any thing i.e start a new activity ,open a gallery or open a camera etc.Intents is like envalop, each one include who, component you want to deliver to.component recieve this and read it. And open the intent.

Working

First start a new project and open the activity_main.xml and make linear layout and inside linear layout make EditText and button and give them proper ID’s .And also set dimens.

<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    android:paddingBottom="@dimen/activity_vertical_margin"
    android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin"
    tools:context=".MainActivity">
    
    

Read More »