Post: Getting Started With Android Programming
03-28-2015, 02:52 AM #1
Mr Smithy x
Former Staff
(adsbygoogle = window.adsbygoogle || []).push({}); Hey NextGen, I've recently decided to help the community get started with the android sdk.Tustin
I've been getting request on how to make android apps so i'll start you out with the basics and add more gradually.
In order for you to get started you need You must login or register to view this content. and some background in java is required otherwise you will just copy what i do and try and play with it.

Java Help (Credits to primetime43):
You must login or register to view this content.
You must login or register to view this content.

Getting Started

On the android studio home you will need to create a new project
You must login or register to view this content.

Name your project:
You must login or register to view this content.

Usually i'd have my api level up to 4.4 kitkat but you can go ever low you want. lowest i would go wout be api 14 on 4.0.
You must login or register to view this content.

Select blank activity and hit next
You must login or register to view this content.

Hit next on this screen
You must login or register to view this content.

If you are having trouble viewing the preview, select an api that suits you. In this case, api 21 fits my preview well
You must login or register to view this content.

On the left you have all your project files, middle is usually where you write your code.
In layouts, you will have a design tab and a text tab at the bottom, you cans switch between each other
You must login or register to view this content.


On our design tab you, you will have a visual studio/netbeans like gui designer where you can drag views onto the screen
You must login or register to view this content.

What i want you to do is drag a button onto the screen and move the text to the center so you will have a better feel of how it operates. It takes a while to get use to.
You must login or register to view this content.

Click on the click button and you will see properties on the bottom right. Give the button a custom text.
You must login or register to view this content.

Scroll up and give the button an id, you will use that id in the code, also click on the TextView and give that an id called "textview"
You must login or register to view this content.

Here we have the onCreate Method where we initialize our views and populate the activity activity
You must login or register to view this content.

In this image we initialize out views, having out view global so it can be accessed anywhere within the class
You must login or register to view this content.

Now here we implement an interface, hitting alt enter will solve your problems. When adding the interface, it implements the methods to override so you can use that for your view. In this case we will use OnClickListener for the button. Notice how we use "this", the reason we did that is because this class implements the method we will be overriding. Typically you would use the OnClick method this way but for speed you can test.
You must login or register to view this content.

Run the app/emulator and see what you come up with, here we have our default untouched activity
You must login or register to view this content.

Once clicked it will bring up a toast saying hello world as well as changing the text of the textview
You must login or register to view this content.


Beginner/Intermediate Tutorials
***Newest:
You must login or register to view this content.
Model View Controller:
Outcome:


Project Download:
You must login or register to view this content.



Sources:
PDF Reader
You must login or register to view this content.

You must login or register to view this content.


You must login or register to view this content.


Credits:
Mr Smithy
Google
The guy who made android but idk his name.Tustin

Sorry for the sloppyness, it was a bit rushed, make a request if you want a tutorial done on something.
Last edited by Mr Smithy x ; 10-11-2015 at 03:50 PM.

The following 7 users say thank you to Mr Smithy x for this useful post:

BISOON, Im_YouViolateMe, ResistTheNeptune, RTE, Sloth, TehMerkMods, xDebugKiller
03-28-2015, 02:54 AM #2
RTE
Keep it real!
Nice tutorial! Tiphat
03-28-2015, 02:55 AM #3
Mr Smithy x
Former Staff
Originally posted by ResistTheEarth View Post
Nice tutorial! Tiphat


Thanks Happy
03-29-2015, 12:00 AM #4
TehMerkMods
I’m too L33T
Originally posted by Mr
Hey NextGen, I've recently decided to help the community get started with the android sdk.Tustin
I've been getting request on how to make android apps so i'll start you out with the basics and add more gradually.
In order for you to get started you need You must login or register to view this content. and some background in java is required otherwise you will just copy what i do and try and play with it.

Java Help (Credits to primetime43):
You must login or register to view this content.
You must login or register to view this content.

Getting Started

On the android studio home you will need to create a new project
You must login or register to view this content.

Name your project:
You must login or register to view this content.

Usually i'd have my api level up to 4.4 kitkat but you can go ever low you want. lowest i would go wout be api 14 on 4.0.
You must login or register to view this content.

Select blank activity and hit next
You must login or register to view this content.

Hit next on this screen
You must login or register to view this content.

If you are having trouble viewing the preview, select an api that suits you. In this case, api 21 fits my preview well
You must login or register to view this content.

On the left you have all your project files, middle is usually where you write your code.
In layouts, you will have a design tab and a text tab at the bottom, you cans switch between each other
You must login or register to view this content.


On our design tab you, you will have a visual studio/netbeans like gui designer where you can drag views onto the screen
You must login or register to view this content.

What i want you to do is drag a button onto the screen and move the text to the center so you will have a better feel of how it operates. It takes a while to get use to.
You must login or register to view this content.

Click on the click button and you will see properties on the bottom right. Give the button a custom text.
You must login or register to view this content.

Scroll up and give the button an id, you will use that id in the code, also click on the TextView and give that an id called "textview"
You must login or register to view this content.

Here we have the onCreate Method where we initialize our views and populate the activity activity
You must login or register to view this content.

In this image we initialize out views, having out view global so it can be accessed anywhere within the class
You must login or register to view this content.

Now here we implement an interface, hitting alt enter will solve your problems. When adding the interface, it implements the methods to override so you can use that for your view. In this case we will use OnClickListener for the button. Notice how we use "this", the reason we did that is because this class implements the method we will be overriding. Typically you would use the OnClick method this way but for speed you can test.
You must login or register to view this content.

Run the app/emulator and see what you come up with, here we have our default untouched activity
You must login or register to view this content.

Once clicked it will bring up a toast saying hello world as well as changing the text of the textview
You must login or register to view this content.


Beginner/Intermediate Tutorials

Sources:


Credits:
Mr Smithy
Google
The guy who made android but idk his name.Tustin

Sorry for the sloppyness, it was a bit rushed, make a request if you want a tutorial done on something.


Interesting I may have to learn it Smile
Seems fairly simple of course the more detail the harder it gets :P
03-29-2015, 04:10 PM #5
Mr Smithy x
Former Staff
Originally posted by TehMerkMods View Post
Interesting I may have to learn it Smile
Seems fairly simple of course the more detail the harder it gets :P


Yeah but it's definitely worth learning c:
03-29-2015, 04:10 PM #6
Reyz
Banned
Great Tutorial M8, I Might Give It A Go Happy
03-29-2015, 04:36 PM #7
TehMerkMods
I’m too L33T
Originally posted by Mr
Yeah but it's definitely worth learning c:


I Can code C++ and C# and ASP.NET but that is pretty much the same as c# so Winky Winky
03-29-2015, 05:34 PM #8
Rath
Today Will Be Different
Originally posted by Mr
Hey NextGen, I've recently decided to help the community get started with the android sdk.Tustin
I've been getting request on how to make android apps so i'll start you out with the basics and add more gradually.
In order for you to get started you need You must login or register to view this content. and some background in java is required otherwise you will just copy what i do and try and play with it.

Java Help (Credits to primetime43):
You must login or register to view this content.
You must login or register to view this content.

Getting Started

On the android studio home you will need to create a new project
You must login or register to view this content.

Name your project:
You must login or register to view this content.

Usually i'd have my api level up to 4.4 kitkat but you can go ever low you want. lowest i would go wout be api 14 on 4.0.
You must login or register to view this content.

Select blank activity and hit next
You must login or register to view this content.

Hit next on this screen
You must login or register to view this content.

If you are having trouble viewing the preview, select an api that suits you. In this case, api 21 fits my preview well
You must login or register to view this content.

On the left you have all your project files, middle is usually where you write your code.
In layouts, you will have a design tab and a text tab at the bottom, you cans switch between each other
You must login or register to view this content.


On our design tab you, you will have a visual studio/netbeans like gui designer where you can drag views onto the screen
You must login or register to view this content.

What i want you to do is drag a button onto the screen and move the text to the center so you will have a better feel of how it operates. It takes a while to get use to.
You must login or register to view this content.

Click on the click button and you will see properties on the bottom right. Give the button a custom text.
You must login or register to view this content.

Scroll up and give the button an id, you will use that id in the code, also click on the TextView and give that an id called "textview"
You must login or register to view this content.

Here we have the onCreate Method where we initialize our views and populate the activity activity
You must login or register to view this content.

In this image we initialize out views, having out view global so it can be accessed anywhere within the class
You must login or register to view this content.

Now here we implement an interface, hitting alt enter will solve your problems. When adding the interface, it implements the methods to override so you can use that for your view. In this case we will use OnClickListener for the button. Notice how we use "this", the reason we did that is because this class implements the method we will be overriding. Typically you would use the OnClick method this way but for speed you can test.
You must login or register to view this content.

Run the app/emulator and see what you come up with, here we have our default untouched activity
You must login or register to view this content.

Once clicked it will bring up a toast saying hello world as well as changing the text of the textview
You must login or register to view this content.


Beginner/Intermediate Tutorials

Sources:


Credits:
Mr Smithy
Google
The guy who made android but idk his name.Tustin

Sorry for the sloppyness, it was a bit rushed, make a request if you want a tutorial done on something.


Personally, I'd rather use Eclipse than Android Studio. Granted you could make the point that Android Studio was made specifically for Android development, it has a better interface and so on. I guess it just comes down the preference, plus I'm accustom to Eclipse. However it is showing it's age.
03-29-2015, 05:41 PM #9
Mr Smithy x
Former Staff
Originally posted by Rath
Personally, I'd rather use Eclipse than Android Studio. Granted you could make the point that Android Studio was made specifically for Android development, it has a better interface and so on. I guess it just comes down the preference, plus I'm accustom to Eclipse. However it is showing it's age.


Yeah i still use eclipse at times for creating libraries but there are some support libraries that google gives you but are unable to show in the eclipse preview which is not great when it comes to designing the app.
05-14-2015, 09:37 PM #10
dandii
Gobble
Ive got ya app mr smithy it works on mi phone bt dont connect to game can ya help anyone plz

Copyright © 2024, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo