A Few Android Tutorials

Basic Tutorials concerning: GUI, Views, Activites, XML, Layouts, Intents, ...

A Few Android Tutorials

Postby rob michael » Sat Jun 11, 2011 3:47 pm

Hi All,

I have used this forum a few times in the past to find answers to questions (normally via google) - but have only just signed up, so thanks for the help so far!

I just spotted this tutorials section and thought I would post some that I have done in the last few months. They aren't really in the level of detail you might expect from plusminus over here but hopefully they are still useful - they generally all come with complete app source code to play with:

http://automateddeveloper.blogspot.com/2011/06/getting-started-complete-android-app.html - Getting Started - A Complete Android App walkthrough for Beginners (Part 1)

http://automateddeveloper.blogspot.com/2011/06/getting-started-complete-android-app_11.html - Getting Started - A Complete Android App walkthrough for Beginners (Part 2)

http://automateddeveloper.blogspot.com/2010/08/android-rss-reader-tutorial.html - Implementing a custom RSS Reader for Android using SAX

http://automateddeveloper.blogspot.com/2011/05/android-twitter-reader.html - Implementing a simple Twitter Timeline reader for Android using Twitter4J

Hope they are helpful in some way to someone! :D
Last edited by rob michael on Mon Jun 13, 2011 5:49 pm, edited 1 time in total.
Check out my blog (tutorials, examples, etc): http://automateddeveloper.blogspot.com/
Check out my Android apps website http://www.mobile.thirdmindmedia.co.uk
rob michael
Junior Developer
Junior Developer
 
Posts: 12
Joined: Sat Jun 11, 2011 3:10 pm

Top

Re: A Few Android Tutorials

Postby super » Sun Jun 12, 2011 12:32 am

Hi rob,
thank you for sharing the tutorials.
can you PLEASE please help me with this: http://www.anddev.org/novice-tutorials-f8/need-help-with-discount-calculator-t53562.html

hoping for a positive reply.
super
Junior Developer
Junior Developer
 
Posts: 22
Joined: Sat May 21, 2011 12:56 pm

Re: A Few Android Tutorials

Postby rob michael » Sun Jun 12, 2011 9:21 am

Hi,

is this your first app? is there any part in particular that you are struggling to do or is it just getting started?

do you have the layout xml with a dropdown, textbox and button already? (e.g. just need to do the logic for the onClick handling) or do you have nothing yet?
Check out my blog (tutorials, examples, etc): http://automateddeveloper.blogspot.com/
Check out my Android apps website http://www.mobile.thirdmindmedia.co.uk
rob michael
Junior Developer
Junior Developer
 
Posts: 12
Joined: Sat Jun 11, 2011 3:10 pm

Re: A Few Android Tutorials

Postby super » Sun Jun 12, 2011 3:17 pm

Hi,
firstly thank you very much for replying back.

I am pretty new with android dev.

Just to give you an idea I did create a sample layout, here it is:

Code: Select all
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    >
   
   
    <TextView android:layout_height="wrap_content" android:layout_width="fill_parent" android:text="Please select discount type" android:id="@+id/TextView02"></TextView>
   
   
    <Spinner android:layout_width="match_parent" android:layout_height="wrap_content" android:id="@+id/spinner1"></Spinner>
    <TextView android:layout_height="wrap_content" android:layout_width="fill_parent" android:text="Enter the price" android:id="@+id/textView1"></TextView>
    <EditText android:text="" android:id="@+id/editText1" android:layout_height="wrap_content" android:layout_width="match_parent"></EditText>
    <Button android:text="Calculate Result" android:id="@+id/button1" android:layout_width="wrap_content" android:layout_height="wrap_content"></Button>
    <TextView android:layout_height="wrap_content" android:layout_width="fill_parent" android:text="Final Amount / Result will be diaplayed here in a label in BIG FONT with $ sign (before the amount)" android:id="@+id/TextView01"></TextView>
    </LinearLayout>



In the dropdown menu I would like to have values like this:
Type 1 discount
Type 2 discount
Type 3 discount

Here is the respective discount for the above drop-down values:
Type 1 discount - 10%
Type 2 discount - 15%
Type 3 discount - 18%

To give you an idea about what exactly I want the discount calculator to look like, I designed demo screenshot for you:

Image

In each tab I will put same discount calculator (just like in tab 1) but with different discount rate. If you could help me with the code how to display / put discount calculator in each tab. I will change the values etc by myself within each tab.

I need your help with the code for calculating discount. Please help me, I really want to learn how to apply the logic etc so that I can also start developing android apps like everybody here. I really want to learn.

thank you
Last edited by super on Sat Jun 18, 2011 9:28 pm, edited 1 time in total.
super
Junior Developer
Junior Developer
 
Posts: 22
Joined: Sat May 21, 2011 12:56 pm

Re: A Few Android Tutorials

Postby rob michael » Mon Jun 13, 2011 5:42 pm

Ok, so if you have the design sorted, and have the components required, all that you will need to do is to set a OnClickListener for the Calculate button. The easiest way to do this (if not the tidiest) is to amend your calculator activity to implement the OnClickListenester - this will force you to implement the onClick() method.

In there, you can get the values entered in the text box and perform the calculations.

Is it handling the button events that you need to complete or the actual calculation logic? (just trying to understand what part of the problem you want the help with)
Check out my blog (tutorials, examples, etc): http://automateddeveloper.blogspot.com/
Check out my Android apps website http://www.mobile.thirdmindmedia.co.uk
rob michael
Junior Developer
Junior Developer
 
Posts: 12
Joined: Sat Jun 11, 2011 3:10 pm

Re: A Few Android Tutorials

Postby super » Mon Jun 13, 2011 9:58 pm

thank again rob for replying back.
Frankly speaking whatever I knew, I posted above. Rest I need your help. I will deeply appreciate if you could help me with this (with the code).

thanks
super
Junior Developer
Junior Developer
 
Posts: 22
Joined: Sat May 21, 2011 12:56 pm

Top

Re: A Few Android Tutorials

Postby super » Wed Jun 15, 2011 1:26 am

anyone ? please help
super
Junior Developer
Junior Developer
 
Posts: 22
Joined: Sat May 21, 2011 12:56 pm

Re: A Few Android Tutorials

Postby super » Sat Jun 18, 2011 9:27 pm

bump?
super
Junior Developer
Junior Developer
 
Posts: 22
Joined: Sat May 21, 2011 12:56 pm

Re: A Few Android Tutorials

Postby rob michael » Sun Jun 19, 2011 12:30 pm

Ok - it sounds like you really need to start at the beginning to understand all the different elements - have you walked through my first tutorial I posted above?

The first part of http://automateddeveloper.blogspot.com/2011/06/getting-started-complete-android-app.html - Getting Started - A Complete Android App walkthrough for Beginners (Part 1) - covers both designing an Activity using the layout XMLs and also how to programatically inflate and add listeners to the different components. For example, in your case you will need to add an onClickListener to the button of your activity that can grab all the data from the fields and perform the logic.

Once you have an understanding of how to construct your desired layout and also how to programatically create your Activity to handle the input the task at hand should be relatively simple.

If you can understand what is being done in the above tutorial then you should be able to translate that to the functionality you are trying to achieve.
Check out my blog (tutorials, examples, etc): http://automateddeveloper.blogspot.com/
Check out my Android apps website http://www.mobile.thirdmindmedia.co.uk
rob michael
Junior Developer
Junior Developer
 
Posts: 12
Joined: Sat Jun 11, 2011 3:10 pm

Re: A Few Android Tutorials

Postby super » Sun Jun 19, 2011 2:25 pm

Thanks for the reply rob. Till now I have only developed few hello world apps to get taste of android development.

I will take a look at your tutorial and try to solve my problem as much as I can. If still I need help, I will post back here to get your help, is it ok ?

thanks
super
Junior Developer
Junior Developer
 
Posts: 22
Joined: Sat May 21, 2011 12:56 pm

Re: A Few Android Tutorials

Postby rob michael » Sun Jun 19, 2011 8:40 pm

yeah sure thing - no prob at all.

You will prob find you will get more responses/help if you post a specific problem or error you are trying to work out too :)
Check out my blog (tutorials, examples, etc): http://automateddeveloper.blogspot.com/
Check out my Android apps website http://www.mobile.thirdmindmedia.co.uk
rob michael
Junior Developer
Junior Developer
 
Posts: 12
Joined: Sat Jun 11, 2011 3:10 pm

Re: A Few Android Tutorials

Postby super » Thu Jun 23, 2011 4:59 am

ok rob, as I am new with android and trying my best to learn.

After struggling a lot, I am able to develop till here: http://www.anddev.org/post100529.html#p100529

Now I NEED your HELP - PLEASEEEE HELP ME NOW
super
Junior Developer
Junior Developer
 
Posts: 22
Joined: Sat May 21, 2011 12:56 pm

Re: A Few Android Tutorials

Postby rob michael » Fri Jun 24, 2011 8:09 pm

responded to your linked post.. :)
Check out my blog (tutorials, examples, etc): http://automateddeveloper.blogspot.com/
Check out my Android apps website http://www.mobile.thirdmindmedia.co.uk
rob michael
Junior Developer
Junior Developer
 
Posts: 12
Joined: Sat Jun 11, 2011 3:10 pm

Top

Return to Novice Tutorials

Who is online

Users browsing this forum: No registered users and 7 guests