Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,162,435 members, 7,850,529 topics. Date: Wednesday, 05 June 2024 at 12:54 AM

Getting Your Environment Ready For Android Programming. - Programming - Nairaland

Nairaland Forum / Science/Technology / Programming / Getting Your Environment Ready For Android Programming. (1146 Views)

Who Can Teach Me Android Programming? / Android Programming / Get Your Complete Web Development/android Programming Videos Cheap (2) (3) (4)

(1) (Reply)

Getting Your Environment Ready For Android Programming. by rexben(m): 1:34am On Feb 14, 2018
Sequel to Are you interested in how design Android Apps https://www.nairaland.com/4346930/interested-how-design-android-apps

Things you need to be in place to start designing your app are:
A computer (32bits or 64bits).
JDK. Downloadable through this link http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html .You should download 32bit (x86) if your system is 32bit and 64bit (x64) its if your system is 64bit.
Android Studio. Downloadable through this link https://developer.android.com/studio/index.html.
ADB Driver Installer. Downloadable through this link http://adbdriver.com/downloads/.
An Android Phone.

How to know if your system is 32bit or 64bit

If you don't know what bit is your system, if it is 32bit or 64bit, follow this direction
Go to Control Panel > System and Security > System

Having downloaded JDK, Android Studio and ADB Driver Installer, the next step is to install them. In case you downloaded the zipped files you need to unzip it by using WinRar or any other software application that is responsible for unzipping files.
Note
You should install the JDK first and after you are done installing it. You can install Android Studio. If you do otherwise, your Android Studio won’t be usable.
For ADB Driver Installer, you don’t need to install it. Just move it to your desktop so that it will be easily accessed.
Having Install your Android Studio successfully (in case you have troubles installing your Android Studio, drop your comments stating the error message or what problem you are facing), proceed to the next tutorial.

In this tutorial I will be using Android Studio Version 2.3.3, don’t worry if you have a lower version or a higher version.
Source https://rexdevelopers..com.ng

Re: Getting Your Environment Ready For Android Programming. by rexben(m): 1:58am On Feb 15, 2018
Open a new project by clicking on Open a new project, follow the steps as shown in the below


Click on start a new Android Studio Project



Enter whatever name you want to name your project, Make your Project name start with an Uppercase e.g. BookApp, TextApp etc.



Then click on Next



Just click on Next



Make sure you pick the Empty Activity for the purpose of this tutorial and click on Next.



Just click on Finish and wait for a while the gradle builds and your environment is ready for you to use.

For some people that don’t have internet access, you’ll need to work offline. In order to do so, go to project > Android > Gradle Scripts > build.gradle (Module:app)




Note: There are two build.gradle files, build.gradle (Project:Language) and build.gradle(Module:app), you should select the second build.gradle.
Then you’ll delete some lines of code in the build.gradle, the highlighted lines only. When you are done, you will click on Try Again at the top right side, as it is indicated below. You’ll wait while it finishing building.





Understanding your environment, Android Studio


I will explain some terminologies to you so that you will familiarize yourself with Android Studio. I know many of the names will be strange to you (if you are new to Android Studio and programming). I will explain the basic ones and as we progress, I will explain more.


AndroidManifest.xml is responsible for many things including the first activity that will be launched. To pick the activity that would be launched first, you need to go to AndroidManifest.xml. Your App Icon is set in AndroidManifest.xml. I will say AndroidManifest.xml determines how your codes will run on your phone. Any Activity you open and is not listed in the AndroidManifest.xml will not be accessible when you run your App on a mobile phone.
Java (e.g Details and MainActivity) is the java file where you will be writing all your java codes. If you open another java class, it will display here. As you can see, there are only two java classes.
res folder is the folder where all your resource files are located and stored. Resources like layout, images, strings, color etc. are stored under the resource folder directory.
drawables is the folder responsible for storing images that you want to you in your project. When you want to use an image in your project, you copy the image from PC and paste it the drawables folder.
layout is where all your activities are stored. The activities that you interact with when you run App on your device.
mipmap is where your default Android Icon is stored.
colors.xml is where colors are stored.
strings.xml is where strings are stored. Strings are literal in Android language. “I want to learning Android Programming” is an example of String.
styles.xml is responsible for styling of your App, the color of your status bar, color of your toolbar, text background color, the theme of your App.


Running our App on a physical device like our Android Phone


Tools: An Android Phone and ADB Driver Installer you downloaded.

On your Android Phone, go to Settings > About phone > Build number.
Tap on Build number seven times, then a toast message will appear “You are now a developer”.
Then, press the back button, directly above “About phone”, you will see “Developer options”
Tap on it, enable it by clicking on the on switch. Scroll down and enable the USB debugging.

Connect your Android phone to your computer with a transferrable USB cord/wire.
Launch ADB Driver Installer. Your Android Phone will be displayed on where I highlighted and you will click on Install



So, when your Android phone is successfully installed, go to your Android Studio
Click on “Run” on the menu bar, click on “Run app” on the drop down menu. A box pops up



If your Phone was not successfully installed, it won’t appear, it will bring “No USB devices or running emulators detected”. In case your phone was successfully installed, check your USB cord/ wire.
Click on OK
Click on Proceed without instant run.
Congratulations you just created your first mobile App


Working with Emulator

In case you don’t have an Android phone to debug your App with. Android Studio provides with a tool called Emulator you can use.
An emulator looks an Android mobile, it just that you can touch and feel it. It runs like an Android phone. It is a cool tool. I won’t really advice it and I am not kicking against either. It makes System hangs especially systems with low memory.
Check this link to get started with emulator https://developer.android.com/studio/run/emulator.html

If you have any issues using it, drop your comments and I will help you out.

Check https://rexdevelopers..com.ng/2018/02/getting-familiar-with-android-studio.html for detailed explanation with images

1 Like 1 Share

Re: Getting Your Environment Ready For Android Programming. by rexben(m): 12:30am On Feb 22, 2018
rexben:
Open a new project by clicking on Open a new project, follow the steps as shown in the below


Click on start a new Android Studio Project



Enter whatever name you want to name your project, Make your Project name start with an Uppercase e.g. BookApp, TextApp etc.



Then click on Next



Just click on Next



Make sure you pick the Empty Activity for the purpose of this tutorial and click on Next.



Just click on Finish and wait for a while the gradle builds and your environment is ready for you to use.

For some people that don’t have internet access, you’ll need to work offline. In order to do so, go to project > Android > Gradle Scripts > build.gradle (Module:app)




Note: There are two build.gradle files, build.gradle (Project:Language) and build.gradle(Module:app), you should select the second build.gradle.
Then you’ll delete some lines of code in the build.gradle, the highlighted lines only. When you are done, you will click on Try Again at the top right side, as it is indicated below. You’ll wait while it finishing building.





Understanding your environment, Android Studio


I will explain some terminologies to you so that you will familiarize yourself with Android Studio. I know many of the names will be strange to you (if you are new to Android Studio and programming). I will explain the basic ones and as we progress, I will explain more.


AndroidManifest.xml is responsible for many things including the first activity that will be launched. To pick the activity that would be launched first, you need to go to AndroidManifest.xml. Your App Icon is set in AndroidManifest.xml. I will say AndroidManifest.xml determines how your codes will run on your phone. Any Activity you open and is not listed in the AndroidManifest.xml will not be accessible when you run your App on a mobile phone.
Java (e.g Details and MainActivity) is the java file where you will be writing all your java codes. If you open another java class, it will display here. As you can see, there are only two java classes.
res folder is the folder where all your resource files are located and stored. Resources like layout, images, strings, color etc. are stored under the resource folder directory.
drawables is the folder responsible for storing images that you want to you in your project. When you want to use an image in your project, you copy the image from PC and paste it the drawables folder.
layout is where all your activities are stored. The activities that you interact with when you run App on your device.
mipmap is where your default Android Icon is stored.
colors.xml is where colors are stored.
strings.xml is where strings are stored. Strings are literal in Android language. “I want to learning Android Programming” is an example of String.
styles.xml is responsible for styling of your App, the color of your status bar, color of your toolbar, text background color, the theme of your App.


Running our App on a physical device like our Android Phone


Tools: An Android Phone and ADB Driver Installer you downloaded.

On your Android Phone, go to Settings > About phone > Build number.
Tap on Build number seven times, then a toast message will appear “You are now a developer”.
Then, press the back button, directly above “About phone”, you will see “Developer options”
Tap on it, enable it by clicking on the on switch. Scroll down and enable the USB debugging.

Connect your Android phone to your computer with a transferrable USB cord/wire.
Launch ADB Driver Installer. Your Android Phone will be displayed on where I highlighted and you will click on Install



So, when your Android phone is successfully installed, go to your Android Studio
Click on “Run” on the menu bar, click on “Run app” on the drop down menu. A box pops up



If your Phone was not successfully installed, it won’t appear, it will bring “No USB devices or running emulators detected”. In case your phone was successfully installed, check your USB cord/ wire.
Click on OK
Click on Proceed without instant run.
Congratulations you just created your first mobile App


Working with Emulator

In case you don’t have an Android phone to debug your App with. Android Studio provides with a tool called Emulator you can use.
An emulator looks an Android mobile, it just that you can touch and feel it. It runs like an Android phone. It is a cool tool. I won’t really advice it and I am not kicking against either. It makes System hangs especially systems with low memory.
Check this link to get started with emulator https://developer.android.com/studio/run/emulator.html

If you have any issues using it, drop your comments and I will help you out.

Check [s]https://rexdevelopers..com.ng/2018/02/getting-familiar-with-android-studio.html[/s] for detailed explanation with images
I just changed my domain name from [s]https://rexdevelopers..com.ng/[/s] to https://rexandroid..com.ng/.
Sorry for the inconveniences.

(1) (Reply)

Please Any One Here Ever Used Admob Video Reward? / Hacking Tricks..... Learn How To Create A Payload /backdoor.with Ur Phone. . / Software Developer I At PAMO University (PUMS)

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 39
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.