THREAD: Getting Started With Android Programming
  1. 03-28-2015, 02:52 AM
    Mr Smithy x's Avatar
    Mr Smithy x
    Former Staff
    Mr Smithy x's Avatar
    Mr Smithy x
    Former Staff
    465
    Posts
    12,583
    Reputation
    Nov 2013
    NextGenUpdate
    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
    Spoiler:

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


    Name your project:
    Spoiler:
    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.
    Spoiler:
    You must login or register to view this content.


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


    Hit next on this screen
    Spoiler:
    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
    Spoiler:
    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
    Spoiler:
    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
    Spoiler:
    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.
    Spoiler:
    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.
    Spoiler:
    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"
    Spoiler:
    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
    Spoiler:
    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
    Spoiler:
    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.
    Spoiler:
    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
    Spoiler:
    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
    Spoiler:
    You must login or register to view this content.



    Beginner/Intermediate Tutorials
    ***Newest:
    Spoiler:
    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.
    Spoiler:

    You must login or register to view this content.

    Spoiler:

    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.

  2. The Following 7 Users Say Thank You to Mr Smithy x For This Useful Post:

    , , , , , ,

  3. 02-11-2017, 03:38 PM
    AlphaStorm100's Avatar
    AlphaStorm100
    Big Daddy
    AlphaStorm100's Avatar
    AlphaStorm100
    Big Daddy
    926
    Posts
    1,708
    Reputation
    Apr 2013
    NextGenUpdate
    Whats the source of an toast...

    I wanna add some toasts