Friday 29 September 2017

How to Create an Android App With Android Studio


How to Create an Android App With Android Studio

This tutorial will teach you the basics of how to build an Android app using the Android Studio development environment. As Android devices become increasingly more common, demand for new apps will only increase. Android Studio is an easy to use (and free) development environment to learn on. It's best if one has a working knowledge of the Java programming language for this tutorial because it is the language used by Android. There won't be much code used in this tutorial, so I will assume that you know enough Java to understand or are willing to look up what you don't know. This will take roughly 30-60 minutes, depending on how quickly you are able to download and install Android Studio. After using this tutorial to create your first Android app, you'll be well on your way to a fun new hobby or possibly even a promising career in mobile development.


Step 1: Install Android Studio-

1.Go To google and search for "download android studio for PC"


How to Create an Android App With Android Studio


2.Use the installer to install Android Studio following its instructions.


How to Create an Android App With Android Studio




Step 2: Open a New Project


1.Open Android Studio.

2.Under the "Quick Start" menu, select "Start a new Android Studio project."

How to Create an Android App With Android Studio


3.On the "Create New Project" window that opens, name your project "HelloWorld".

How to Create an Android App With Android Studio


4.If you choose to, set the company name as desired*.

5.Note where the project file location is and change it if desired.

6.Click "Next."
How to Create an Android App With Android Studio


7.Make sure on that "Phone and Tablet" is the only box that is checked.

8.If you are planning to test the app on your phone, make sure the minimum SDK is below your .

9.phone's operating system level.

How to Create an Android App With Android Studio


10.Click "Next."

11.Select "Blank Activity."

How to Create an Android App With Android Studio


12.Click "Next."

13.Leave all of the Activity name fields as they are.


14.Click "Finish."

*Note: It is typical naming convention in Android projects to set the company name as some form of "example.name.here.com".


Step 3: Edit the Welcome Message in the Main Activity



1.Navigate to the activity_main.xml tab if it is not already open.

2.Make sure that the Design tab is open on the activity_main.xml display.

30Click and drag the "Hello, world!" from the upper left corner of the phone display to the center of the screen.

4.In the project file system on the left side of the window, open the values folder.

5.In the values folder, double-click the strings.xml file.

6.In this file, find the line "Hello world!".

7.After the "Hello world!" message, add "Welcome to my app!"

8.Navigate back to the activity_main.xml tab.

9.Make sure that your centered text now reads "Hello world! Welcome to my app!"

Step 4: Add a Button to the Main Activity

  1. Navigate to the Design tab of the activity_main.xml display.
  2. In the Palette menu to the left of the phone display, find Button (under the heading Widgets).
  3. Click and drag Button to be centered underneath your welcome message.
  4. Make sure your button is still selected.
  5. In the Properties menu (on the right side of the window), scroll down to find the field for "text."
  6. Change the text from "New Button" to "Next Page."


Step 5: Create a Second Activity

  • At the top of the project's file system tree, right click on "app."
  • Navigate through to New > Activity > Blank Activity.
How to Create an Android App With Android Studio

  • Change the name of this activity to "SecondActivity".
  • Click "Finish."
  • Make sure you are in the Design view of activity_second.xml.
How to Create an Android App With Android Studio
  • Drag the text box in the upper left of the phone display down to the center as you did on the Main Activity.
  • With the text box still selected, find the "id" field in the Properties menu on the right, and set it to "text2".
  • Open strings.xml again.
How to Create an Android App With Android Studio

  • Add a new line under "Hello world! Welcome to my app!" that reads "Welcome to the second page!".
  • Navigate back to activity_second.xml.
  • Select the text box again.
  • In the Properties pane, set the "text" field to "@string/second_page".
  • Make sure that the text box now reads "Welcome to the second page!" and is in the center of the screen in the phone display.

Step 6: Write the Button's "on Click" Method




Select the Main Activity.java tab along the top of the work environment.


2. Add the following lines of code at the end of the on Create method:



Button button = (Button) find View By Id(R.id.button);



button.setOnClickListener(new View.onClickListener() {



@Override

public void onClick(View v) {

goToSecondActivity();

}

});

3. Add the following method to the bottom of the MainActivity class:

private void goToSecondActivity() {

Intent intent = new Intent(this, Second Activity.class);

start Activity(intent);

}

4. Click the + next to import at the third line of MainActivity.java to expand the import statements.

5. Add the following to the end of the import statements if they are not already there:

import android.content.Intent;

import android.view.View;

import android.widget.Text View;

Step 7: Test the Application
How to Create an Android App With Android Studio


1.Click the green play symbol from the toolbar at the top of the Android Studio window.

2.When the "Choose Device" dialog appears (this may take a few moments), select 

3.the "Launch emulator" option.

4.Click OK.

5.When the emulator opens (this too could take awhile), the app will automatically 

6.launch the app upon the virtual phone being unlocked.

7.Make sure that all of your text displays correctly and that the button takes you to the
8.next page.

Step 8: Up, Up, and Away!
How to Create an Android App With Android Studio



Congrats! You've now completed your first Android application with some basic functionality. Your finished app should have a page greeting the user and a button that takes the user to a second page.

Thanks for landing on this post, If you like my post "How to Create an Android App With Android Studio" then give your opinion and feedback in comment box.


Tags:- #How to Create an Android App With Android Studio, #how to create android apps for beginners, #how to create an android app pdf, #how to create an android app without coding, #create android app online, #android studio projects download, #how to make an android game,# android app development software, #android app development for beginners, #Create an Android App With Android Studio, #How to Create an Android App, #How to Create an App With Android Studio, #How to use Android Studio, #How to Create an Android App With a app, #How to using Android Studio, #Learn How to Create an Android App With Android Studio

2 comments:

abhay said... Reply To This Comment

thanks for the nice post it is very informative

ashutosh said... Reply To This Comment

great

Post a Comment

Related Posts Plugin for WordPress, Blogger...

Labels

404 AdBlock Add-on Airtel GPRS Trick Airtel SMS Trick Alexa Amazon Amazon Kindle Amazon Prime Android Android 8 Android Oreo antivirus Apple Apple Mac ASCII Audacity Audio Authotkey Backup Balance Transfer in Vodafone Battery Bing Blogger Blogging Bookmarklet Browser Camera Chromebook clock Cloud colors command lines Computer Computer Tricks configuration Contact Creative Commons Credit Card CSS devolop DIY Doodle DOS Download Dropbox E-Mail eBook Email Email Attachment Embed Encryption English Error Evernote Eyes Facebook Facebook Tricks Feedburner Flipkart Font Foursquare Free Internet Free sms trick in Vodafone G Mail Gadget Game Getty Images GIF Gists Github Google Google AdSense Google Analytics Google Apps Google Chrome Google Contacts Google Currents Google DNS Google Docs Google Drive Google Earth Google Font Google Forms Google Images Google Map Google Photos Google Play Store Google Plus Google Print Google Reader Google Script Google Sheets Google Spreadsheet Google Translate GPRS Setting GPS Hacking Health App HelloFax Hindi Hoodie HTML Icons idea Image Editing Images IMEI Indian Railways Infographics Instagram Internet Internet Explorer Internet Tricks iOS iPad iPhone IRCTC iTunes iTV JavaScript JioCinema JioTV Junglee Kindle Language Translation Laptop Laptop. TV Life Time FREE GPRS Life-Style Link Linkedln Linux logo Make Money Online Microdoft Powerpoint Microdoft Word Microsoft Office Microsoft Outlook Mobile Mosaic Music Name Networking nexus Notepad OCR Online Shopping Open DNS OS Outlook Password PDF Petya Phillips Hue Lights Photogtraphy Pixel Play Station Podcasts Pokemon Pokemon Go Polls Print Productivity Proxy Server Pushbullet QR Code Ransomware Reddit Reliance Hack GPRS Reliance Jio RGB Ringtone Router RSS Safe Mode Samsung Galaxy S Scrabble Screen Capture Screen Sharing Screencast Secrets Security Send free sms from PC SEO Sierra Skype Slideshare SMBv1 SMS Snapchat Snapdeal Social Media Solution Sound Device Speech Recognition Sql Steam Sync Synology NAS Tata Docomo GPRS trick Teleprompter Torrent Trick Tricks TV Twitter UltraISO Unicode Unknown Extension Unlimited 2GB Unlimited 3GB Unlimited GPRS USB USB Security Key Video Editing virtual desktop Virus attack VLC Vodafone 110% working trick for GPRS Vodafone 3g Vodafone GPRS VPN wallpapers WannaCry Web Design Web Domain Website Wget Whatsapp WiFi Wikipedia Windows Windows 10 Windows 10 S Windows KN Windows Tricks windows updates Winows N Wolfarm Alpha WordPress XBox YouTube Zip
Twitter Delicious Facebook Digg Stumbleupon Favorites More