Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,153,371 members, 7,819,331 topics. Date: Monday, 06 May 2024 at 02:32 PM

Learn How To Develop Android Apps With Your Android Phone - Phones (4) - Nairaland

Nairaland Forum / Science/Technology / Phones / Learn How To Develop Android Apps With Your Android Phone (19871 Views)

Learn To Develop Android & Ios Apps Without Writing Codes(free Tutorial) / How To Lock Apps With Fingerprint On Any Infinix Phone Running Android 7 Nougat / How To Lock Your Apps With Password Or Fingerprint On Infinix XUI 2.0 (2) (3) (4)

(1) (2) (3) (4) (5) (6) (7) (8) (9) (Reply) (Go Down)

Re: Learn How To Develop Android Apps With Your Android Phone by yorex2011: 5:46pm On Jul 09, 2016
Dfinex:


I can't screen shot. but when I get to the Main.xml page....it shows this :

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center">

<TextView
android:text="@string/hello_world"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />

</LinearLayout>
If possible post the code of your mainactivity.java, and maybe also your manifest.xml
Re: Learn How To Develop Android Apps With Your Android Phone by yorex2011: 5:47pm On Jul 09, 2016
Hope OP doesn't mind o.. Me sef i dey learn grin
Re: Learn How To Develop Android Apps With Your Android Phone by yusufibrahim(m): 5:53pm On Jul 09, 2016
Hope am not too late nice work op God bless
Re: Learn How To Develop Android Apps With Your Android Phone by Dfinex(f): 5:59pm On Jul 09, 2016
yorex2011:

If possible post the code of your mainactivity.java, and maybe also your manifest.xml

this is what I got from mainactivity.java:

package com.mylearning.myfirstapp;

import android.app.*;
import android.os.*;

public class MainActivity extends Activity
{
@Override
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
}
Re: Learn How To Develop Android Apps With Your Android Phone by Dfinex(f): 6:01pm On Jul 09, 2016
yorex2011:

If possible post the code of your mainactivity.java, and maybe also your manifest.xml

Ok...this is what I got from mainactivity.java :

package com.mylearning.myfirstapp;

import android.app.*;
import android.os.*;

public class MainActivity extends Activity
{
@Override
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
}
Re: Learn How To Develop Android Apps With Your Android Phone by yorex2011: 6:07pm On Jul 09, 2016
Dfinex:


Ok...this is what I got from mainactivity.java :

package com.mylearning.myfirstapp;

import android.app.*;
import android.os.*;

public class MainActivity extends Activity
{
@Override
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
}
Create a new app, you may have tampered with something, a simple hello world shouldn't be having issues
Re: Learn How To Develop Android Apps With Your Android Phone by Dfinex(f): 6:12pm On Jul 09, 2016
yorex2011:

Create a new app, you may have tampered with something, a simple hello world shouldn't be having issues

yeah...I messed up. I noticed when u requested for the main activity.xml codes.

I've fixed it and I succeeded in creating an empty app. is that it?
Re: Learn How To Develop Android Apps With Your Android Phone by yorex2011: 6:15pm On Jul 09, 2016
Dfinex:


yeah...I messed up. I noticed when u requested for the main activity.xml codes.

I've fixed it and I succeeded in creating an empty app. is that it?

Thats just to get a feeling of the android setting.
OP would soon be back to continue the tutorials.
Re: Learn How To Develop Android Apps With Your Android Phone by Tessyy1701: 6:20pm On Jul 09, 2016
Iya bashirat pls gv Me pen,,,, I'm IN
Re: Learn How To Develop Android Apps With Your Android Phone by Dfinex(f): 6:43pm On Jul 09, 2016
yorex2011:


Thats just to get a feeling of the android setting.
OP would soon be back to continue the tutorials.

Ok...U nko?...U be lecturer 11? Are u into programming too?

Maybe u can just give me a little backdrop. ....I did a little of programming languages and stuffs like that in school, but i couldn't pick a thing so i resorted to hatred for the course as an escape. ....lolss

I just need to understand the basics of what we are doing cos na *follow follow* dey make person fail exam.
Re: Learn How To Develop Android Apps With Your Android Phone by yorex2011: 6:56pm On Jul 09, 2016
Dfinex:


Ok...U nko?...U be lecturer 11? Are u into programming too?

Maybe u can just give me a little backdrop. ....I did a little of programming languages and stuffs like that in school, but i couldn't pick a thing so i resorted to hatred for the course as an escape. ....lolss

I just need to understand the basics of what we are doing cos na *follow follow* dey make person fail exam.

Alright, android is based on java basically, which is an object oriented programming language.

There's procedural method of programming and there's object oriented.

One thing common to all programming languages are logic statements
I.e while, if, else, for etc
These are very easy to understand..
Re: Learn How To Develop Android Apps With Your Android Phone by DavidTheGeek: 7:08pm On Jul 09, 2016
Dfinex:


I can't screen shot. but when I get to the Main.xml page....it shows this :

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center">

<TextView
android:text="@string/hello_world"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />

</LinearLayout>

That's not an error message.
1. That's a ViewGroup. A view group is a subclass of View and provides invisible container that hold other Views. LinearLayout is a view group that aligns all children in a single direction, vertically or horizontally. (In the above code, it hold a TextView, a textview is for writing texts.)

Simply click menu and select Run to create your first app.
Re: Learn How To Develop Android Apps With Your Android Phone by DavidTheGeek: 7:13pm On Jul 09, 2016
folks4luv:

if we will get more and faster updates on WhatsApp, then am in, though here is cool for better referencing but WhatsApp is easier.

Whatsapp would be faster since i can explain step by step with an screenshots.

For referencing you guys could use Whatsapp starred message feature.
Re: Learn How To Develop Android Apps With Your Android Phone by Dfinex(f): 7:15pm On Jul 09, 2016
DavidTheGeek:


That's not an error message.
1. That's a ViewGroup. A view group is a subclass of View and provides invisible container that hold other Views. LinearLayout is a view group that aligns all children in a single direction, vertically or horizontally. (In the above code, it hold a TextView, a textview is for writing texts.)

Simply click menu and select Run to create your first app.

done...thanks
Re: Learn How To Develop Android Apps With Your Android Phone by DavidTheGeek: 7:17pm On Jul 09, 2016
Mrluv:
bro i think here is better cus we can alway come back here if we forget any part

Whatsapp starred message could be used
Re: Learn How To Develop Android Apps With Your Android Phone by Dfinex(f): 7:21pm On Jul 09, 2016
yorex2011:


Alright, android is based on java basically, which is an object oriented programming language.

There's procedural method of programming and there's object oriented.

One thing common to all programming languages are logic statements
I.e while, if, else, for etc
These are very easy to understand..

Ok...taken. Android runs on java programming language.

the logic statements, is this were algorithms come in?
Re: Learn How To Develop Android Apps With Your Android Phone by DavidTheGeek: 7:28pm On Jul 09, 2016
LETS CONTINUE.... Android - User Interface (UI) Controls

User Interface simply means what you see on the screen.

A View is an object that draws something on the screen that the user can interact with and a ViewGroup is an object that holds other View (and ViewGroup) objects in order to define the layout of the user interface.

Layout(s) are defined in an XML file which offers a human-readable structure for the layout

In the main.xml file that was created on aide, ViewGroup is:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
</LinearLayout>

LinearLayout is a view group that aligns all children (view objects eg TextView) in a single direction, vertically or horizontally.

While View object is:
<TextView android:id="@+id/text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="I am a TextView" />

TextView is for showing text.

****************************************

There are a number of View objects provided by Android that allow you to build the user interface for your app.
For example: TextView, EditText, Button, ImageView etc.

In this tutorial, we'll be working with TextView & Button.

***************************************

TextView
This control is used to display text to the user.

Button
A button can be pressed, or clicked, to perform an action.

******************

A view object may have a unique ID assigned to it which will identify the View object uniquely within the View Group.
The syntax for an ID, inside an XML tag is − android:id="@+id/text_id". (Bolded in TextView code above)

LETS GET TO WORK...
In this tutorial, we will buid a simple app that shows a Text and a Button. When the button is clicked, a toast message would show on the screen.

EDIT MAIN.XML.... ADD BUTTON
By defult, there's a TextView already, simply add betton code uder... like this...

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center">

<TextView
android:text="@string/hello_world"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />

<Button
android:id="@+id/click_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Click Me" />

</LinearLayout>

Check image below to see how your main.xml file should look now....

Let's add a background color...
Add this android:background="#ffffff" code to in <LinearLayout........

Also lets add color to our text....

Add this android:textColor="#ff0000" code to in <TextView........

Click menu and select Run.
Install app.

App background should be white. Text should be red and a button should be visible now.

Let me know if you got it right, so i'll continue.

1 Share

Re: Learn How To Develop Android Apps With Your Android Phone by folks4luv(f): 8:35pm On Jul 09, 2016
DavidTheGeek:


Whatsapp would be faster since i can explain step by step with an screenshots.

For referencing you guys could use Whatsapp starred message feature.
so on point, am in. when are we starting? but we need to keep the thread going so that others coming after will be a partaker, like I just stumbled on this thread this morning.
Re: Learn How To Develop Android Apps With Your Android Phone by DavidTheGeek: 8:43pm On Jul 09, 2016
I'm having issues attaching image.... My data is exhausted. I'm using Free Basics.

*******

UPDATED..
Image added
Re: Learn How To Develop Android Apps With Your Android Phone by folks4luv(f): 8:54pm On Jul 09, 2016
DavidTheGeek:
I'm having issues attaching image.... My data is exhausted. I'm using Free Basics.
ehaya. n I just wanted to ask for images cause it's a bit hard figuring this out
Re: Learn How To Develop Android Apps With Your Android Phone by DavidTheGeek: 9:03pm On Jul 09, 2016
folks4luv:

so on point, am in. when are we starting? but we need to keep the thread going so that others coming after will be a partaker, like I just stumbled on this thread this morning.
ASAP.

This tutorial class, though we just started, has started rubbing off on my time & pocket. So i've decided to conclude the tutorial i started here, take a break, do some planning, (thereby giving space for new interested Nairalanders to join and catch up) & proceed in another way.
Re: Learn How To Develop Android Apps With Your Android Phone by Mrluv(m): 9:25pm On Jul 09, 2016
DavidTheGeek:


Whatsapp starred message could be used
bro true whatsapp wud be faster but on the long here is better
Re: Learn How To Develop Android Apps With Your Android Phone by DavidTheGeek: 9:30pm On Jul 09, 2016
folks4luv:

ehaya. n I just wanted to ask for images cause it's a bit hard figuring this out
I've added the screenshots. You can check them now.
Re: Learn How To Develop Android Apps With Your Android Phone by DavidTheGeek: 9:48pm On Jul 09, 2016
fweshskaz:

Thumbs up Bro I really love this but I'll love to get your WhatsApp contact because I'm not able to browse the Internet at all times due to the fact that I only have WhatsApp sub for now.
I'll be glad if I can get your WhatsApp contact. Thanks in anticipation
Sorry bro i'll probably drop my number later.

We are continuing here.
Re: Learn How To Develop Android Apps With Your Android Phone by deekseen(m): 9:50pm On Jul 09, 2016
Mine keeps showing in black and white.

Re: Learn How To Develop Android Apps With Your Android Phone by folks4luv(f): 9:59pm On Jul 09, 2016
DavidTheGeek:
LETS CONTINUE.... Android - User Interface (UI) Controls

A View is an object that draws something on the screen that the user can interact with and a ViewGroup is an object that holds other View (and ViewGroup) objects in order to define the layout of the user interface. You define your layout in an XML file which offers a human-readable structure for the layout

In the main.xml file that was created on aide, ViewGroup is:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
</LinearLayout>

LinearLayout is a view group that aligns all children (view objects eg TextView) in a single direction, vertically or horizontally.

While VIEW object is:
<TextView android:id="@+id/text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="I am a TextView" />

TextView is for showing text.

****************************************

There are a number of UI controls (View objects) provided by Android that allow you to build the graphical user interface for your app.
We have TextView, EditText, Button, ImageView etc.

In this tutorial, we'll be working with TextView & Button.

***************************************

TextView
This control is used to display text to the user.

Button
A button can be pressed, or clicked, to perform an action.

******************

A view object may have a unique ID assigned to it which will identify the View object uniquely within the View Group.
The syntax for an ID, inside an XML tag is − android:id="@+id/text_id". (Bolded in TextView code above)

LETS GET TO WORK...
In this tutorial, we'll buid a simple a app that shows a Text and a Button. When the button is clicked, a toast message would show on the screen.

EDIT MAIN.XML.... ADD BUTTON
By defult, there's a TextView already, simply add betton code uder... like this...

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center">

<TextView
android:text="@string/hello_world"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />

<Button
android:id="@+id/click_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Click Me" />

</LinearLayout>

Check image below to see how your main.xml file should look now....

Let's add a background color...
Add this android:background="#ffffff" code to in <LinearLayout........

Also lets add color to our text....

Add this android:textColor="#ff0000" code to in <TextView........

Click menu and select Run.
Install app.

App background should be white. Text should be red and a button should be visible now.

Let me know if you got it right, so i'll continue.
dunno what I am doing wrong, see my main XML.
color thing not working.

couldn't add image yet. but on the main XML, the codes didn't change to red color after inputting = sign.
Re: Learn How To Develop Android Apps With Your Android Phone by deekseen(m): 10:06pm On Jul 09, 2016
Corrected.

Re: Learn How To Develop Android Apps With Your Android Phone by DavidTheGeek: 10:13pm On Jul 09, 2016
folks4luv:

dunno what I am doing wrong, see my main XML.
color thing not working.

couldn't add image yet. but on the main XML, the codes didn't change to red color after inputting = sign.
That means you wrote a wrong color code. (Most likely you didn't add # before ff0000)

Write "#ff0000" after ="
Re: Learn How To Develop Android Apps With Your Android Phone by DavidTheGeek: 10:19pm On Jul 09, 2016
deekseen:
Corrected.
Good.
Re: Learn How To Develop Android Apps With Your Android Phone by mikky234(m): 10:21pm On Jul 09, 2016
Sweet! This thread is actually ideal for non-computer students that are interested in computer stuffs
Re: Learn How To Develop Android Apps With Your Android Phone by folks4luv(f): 10:27pm On Jul 09, 2016
DavidTheGeek:

That means you wrote a wrong color code. (Most likely you didn't add # before ff0000)

Write "#ff0000" after ="
corrected now. the prob was that I didn't modify d \> and >. guess we need to learn what those symbols mean. .
thanks op. now I can go to bed

Re: Learn How To Develop Android Apps With Your Android Phone by DavidTheGeek: 10:33pm On Jul 09, 2016
mikky234:
Sweet! This thread is actually ideal for non-computer students that are interested in computer stuffs
You're welcome to the thread. Are you following us or you're just passing by?

(1) (2) (3) (4) (5) (6) (7) (8) (9) (Reply)

Internet Users : Nigeria Ranked #1 In Africa , #10 In The World / Etisalat Sues MTN Over Visafone Acquisition / Google’s Equiano Submarine Cable To Begin Operations In Nigeria By December

(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. 58
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.