How to write your first Android App

Last updated on May 8th, 2017 at 01:53 pm

cover - How to write your first Android App
Write your first Android App, will be really easy with these simple steps.

Required Android Studio

 

Create a new project

From the Start menu launch Android Studio

write your first Android app - start

 

 

When you start on Welcome Menu select Start new Android Studio project

write your first Android app - new project

 

 

In order to build a new project we have to choose

  • Application name: The name of our app, it will also be displayed on the device and in the Play Store
  • Company domain: it could be the name of our company, or a mnemonic name of our project
  • Package name: represents the full namespace
  • Project location: indicates the physical directory for saving the entire project developed with Android studio

swrite your first Android app - project settings

 

Continuing with next you have choice of the distribution platform, for which device we want to make our app available, such as Phones and Table, Watches, TV etc ..

Select on the left what kind of platform you want to distribute the app, in this case Phone or Tablet

write your first Android app - selects target device

 

Selected the target, it’s time to choose whether to start using an existing preset template App, or you want to start from scratch. For simplicity we will use Basic Activity

write your first Android app - basic settings

 

 

The last step is the customization for names to use in our Activity, Menu and Layout.

  • Activity name: indicates the class name to the Activity that is being created
  • Layout name: indicates the name of the XML file that will serve as a layout for our GUI
  • Title: indicates the title of this Activity
  • Menu Resource Name: the name of the XML file to be created, by using the menu

write your first Android app - activity settings

 

 

Continuing with Finish your new app will be created.

 

Emulator Setup

UOnce the app is ready we can test it on either a actual device or in the emulator made available by Android Studio.

 

To configure an emulator you have to choose from the top menu, ADV Manager, here we can set up new testing environments, useful if you want to test various devices with different sizes and resolutions.

write your first Android app - ADV Android Device Manager

 

We start the emulator using the green button Play

write your first Android app - virtual device test

 

 

During the installation may not have been installed HAXM, so if it should appear the following message, simple press OK.

write your first Android app - install HAXM

 

Choose the amount of RAM memory that you want to assign to the emulator and click Next.

write your first Android app - emulator in action

Run your first App

At this point you can test our first app.

From the main menu select the green Play symbol, from the target list, select as a device, one on which you want to test the app, here you can choose the same name of emulator or real name of your phone, if it is connected in USB, then click OK

write your first Android app - run your first app

 

 

Within a few seconds the app will start automatically on the device

 

 

Congratulations you have write your first Android App.

WikiRails Team

Staff WikiRails