Android studio create and run project on phone

Google released the stable version of Android Studio in December, 8 2014. It is an official and powerful tool to develop Android application. In this Android tip, I am going to show you how to create a new Project in Android Studio and how to run it using a real device.
To create a new Android project, from the menu, you select File. Then select New Project... You will be prompted to enter application name, company domain, and path to store the project.




android studio create project

The next screen allows you select platforms and minimum SDK that your application will run on.

select platforms and sdk


By clicking Next, you will be able to add an Activity to the project. Android Studio provides different options for you. You can choose a blank Activity, a blank Activity with Fragment, Google Map Activity, etc. Now you just select a blank Activity.

select blank activity



Click Next to continue. Then you enter the name of the Activity, the name of layout file for the Activity, the title of the Activity, and the name of menu resource used in the Activity.
Finally click the Finish button to create the project.

activity name

In the left side, you will see a hierarchy tree. The manifest node of the tree contains AndroidManifest.xml file that has essential information about your application. The java node contains java source files in the application. The res node contains fours child notes: drawable, layout, menu, and values. The drawable node contains drawable resources such as images, and shapes defined in xml format. The menu node contains menu xml files. The values node contains xml files that define the default screen margins, string values, and styles to be used in your application.

project structure

You can run the application using an emulator or a real device. Personally, I like running my applications on real devices because it is faster than the emulator.
Before running the application on the real device, you need to make sure that your device is able to communicate with your pc. Currently, I use Samsung Kies software for the communication. You also make sure that the USB debugging of your device is turned on. Then you tell the Android Studio to run the application on the real device. To do so, from the menu, you select Run. Then select Edit Configuration� In the Run/Debug Configurations window, make sure you select USB device option before clicking OK.

run app on read device or phone


Posted by: Dara | post date: 01-28-2015 | Subject: Android Apps Development

write programming tip




This website intents to provide free and high quality tutorials, examples, exercises and solutions, questions and answers of programming and scripting languages:
C, C++, C#, Java, VB.NET, Python, VBA,PHP & Mysql, SQL, JSP, ASP.NET,HTML, CSS, JQuery, JavaScript and other applications such as MS Excel, MS Access, and MS Word. However, we don't guarantee all things of the web are accurate. If you find any error, please report it then we will take actions to correct it as soon as possible.